001    /****************************************************************
002     * Licensed to the Apache Software Foundation (ASF) under one   *
003     * or more contributor license agreements.  See the NOTICE file *
004     * distributed with this work for additional information        *
005     * regarding copyright ownership.  The ASF licenses this file   *
006     * to you under the Apache License, Version 2.0 (the            *
007     * "License"); you may not use this file except in compliance   *
008     * with the License.  You may obtain a copy of the License at   *
009     *                                                              *
010     *   http://www.apache.org/licenses/LICENSE-2.0                 *
011     *                                                              *
012     * Unless required by applicable law or agreed to in writing,   *
013     * software distributed under the License is distributed on an  *
014     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
015     * KIND, either express or implied.  See the License for the    *
016     * specific language governing permissions and limitations      *
017     * under the License.                                           *
018     ****************************************************************/
019    
020    package org.apache.hupa.shared.events;
021    
022    import org.apache.hupa.shared.data.IMAPFolder;
023    import org.apache.hupa.shared.data.User;
024    
025    import com.google.gwt.event.shared.GwtEvent;
026    
027    public class DecreaseUnseenEvent extends GwtEvent<DecreaseUnseenEventHandler>{
028    
029        public final static Type<DecreaseUnseenEventHandler> TYPE = new Type<DecreaseUnseenEventHandler>();
030        private User user;
031        private IMAPFolder folder;
032        private int amount;
033        
034        public DecreaseUnseenEvent(User user, IMAPFolder folder) {
035            this(user, folder, 1);
036        }
037        
038        public DecreaseUnseenEvent(User user, IMAPFolder folder, int amount) {
039            this.user =user;
040            this.folder = folder;
041            this.amount = amount;
042        }
043        
044        public IMAPFolder getFolder() {
045            return folder;
046        }
047        
048        public User getUser() {
049            return user;
050        }
051        
052        public int getAmount() {
053            return amount;
054        }
055        
056        @Override
057        protected void dispatch(DecreaseUnseenEventHandler handler) {
058            handler.onDecreaseUnseenEvent(this);
059            
060        }
061    
062        @Override
063        public com.google.gwt.event.shared.GwtEvent.Type<DecreaseUnseenEventHandler> getAssociatedType() {
064            return TYPE;
065        }
066    
067    }