1 /* Copyright (C) 2006 by Marc Maurer <uwog@uwog.net> 2 * 3 * This program is free software; you can redistribute it and/or 4 * modify it under the terms of the GNU General Public License 5 * as published by the Free Software Foundation; either version 2 6 * of the License, or (at your option) any later version. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License 14 * along with this program; if not, write to the Free Software 15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 16 * 02110-1301 USA. 17 */ 18 19 #ifndef __EVENT_H__ 20 #define __EVENT_H__ 21 22 #include <vector> 23 #include <account/xp/Buddy.h> 24 #include <packet/xp/EventPacket.h> 25 26 class Event : public EventPacket 27 { 28 public: 29 DECLARE_ABSTRACT_PACKET(Event); 30 Event()31 Event() 32 : m_bBroadcast(false) 33 { 34 } 35 ~Event()36 virtual ~Event() 37 { 38 } 39 getRecipients()40 const std::vector<BuddyPtr>& getRecipients() const 41 { return m_vRecipients; } 42 setRecipients(std::vector<BuddyPtr> & vRecipients)43 void setRecipients(std::vector<BuddyPtr>& vRecipients) 44 { 45 m_vRecipients = vRecipients; 46 } 47 addRecipient(BuddyPtr pBuddy)48 void addRecipient(BuddyPtr pBuddy) 49 { 50 UT_return_if_fail(pBuddy); 51 m_vRecipients.push_back(pBuddy); 52 } 53 setBroadcast(bool bBroadcast)54 void setBroadcast(bool bBroadcast) 55 { m_bBroadcast = bBroadcast; } isBroadcast()56 bool isBroadcast() const 57 { return m_bBroadcast; } 58 59 private: 60 61 std::vector<BuddyPtr> m_vRecipients; 62 bool m_bBroadcast; 63 }; 64 65 #endif /* __EVENT_H__ */ 66