001    /*
002     Copyright (C) 2003 Adam Olsen
003     This program is free software; you can redistribute it and/or modify
004     it under the terms of the GNU General Public License as published by
005     the Free Software Foundation; either version 1, or (at your option)
006     any later version.
007     This program is distributed in the hope that it will be useful,
008     but WITHOUT ANY WARRANTY; without even the implied warranty of
009     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
010     GNU General Public License for more details.
011     You should have received a copy of the GNU General Public License
012     along with this program; if not, write to the Free Software
013     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
014     */
015    
016    package com.valhalla.jbother.plugins.events;
017    
018    import java.util.Date;
019    
020    import com.valhalla.pluginmanager.PluginEvent;
021    
022    /**
023     * Generated when someone clicks on the close button
024     * 
025     * @author Adam Olsen
026     */
027    public class MUCEvent extends PluginEvent {
028        public static final int EVENT_PARTICIPANT_JOINED = 0;
029    
030        public static final int EVENT_PARTICIPANT_PARTED = 1;
031    
032        public static final int EVENT_MESSAGE_RECEIVED = 2;
033    
034        public static final int EVENT_SUBJECT_CHANGED = 3;
035    
036        private int type = 0;
037    
038        private String message;
039    
040        private Date date;
041    
042        public MUCEvent(Object source, int type, String message, Date date) {
043            super(source);
044            this.type = type;
045            this.message = message;
046            this.date = date;
047        }
048    
049        public int getType() {
050            return type;
051        }
052    
053        public String getFrom() {
054            return (String) source;
055        }
056    
057        public String getMessage() {
058            return message;
059        }
060    
061        public Date getDate() {
062            return date;
063        }
064    
065    }