00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef MUCROOMCONFIGHANDLER_H__
00016 #define MUCROOMCONFIGHANDLER_H__
00017
00018 #include "gloox.h"
00019 #include "jid.h"
00020
00021 #include <string>
00022 #include <list>
00023
00024 namespace gloox
00025 {
00026
00027 class MUCRoom;
00028 class DataForm;
00029
00038 class MUCListItem
00039 {
00040 public:
00045 MUCListItem( const JID& jid )
00046 : m_jid( jid ), m_affiliation( AffiliationInvalid ), m_role( RoleInvalid )
00047 {}
00048
00056 MUCListItem( const JID& jid, MUCRoomRole role, MUCRoomAffiliation affiliation,
00057 const std::string& nick )
00058 : m_jid( jid ), m_nick( nick ), m_affiliation( affiliation ), m_role( role )
00059 {}
00060
00067 MUCListItem( const std::string& nick, MUCRoomAffiliation affiliation, const std::string& reason )
00068 : m_nick( nick ), m_affiliation( affiliation ), m_role( RoleInvalid ),
00069 m_reason( reason )
00070 {}
00071
00078 MUCListItem( const std::string& nick, MUCRoomRole role, const std::string& reason )
00079 : m_nick( nick ), m_affiliation( AffiliationInvalid ), m_role( role ),
00080 m_reason( reason )
00081 {}
00082
00086 ~MUCListItem() {}
00087
00092 const JID& jid() const { return m_jid; }
00093
00098 const std::string& nick() const { return m_nick; }
00099
00104 MUCRoomAffiliation affiliation() const { return m_affiliation; }
00105
00110 MUCRoomRole role() const { return m_role; }
00111
00116 const std::string& reason() const { return m_reason; }
00117
00118 private:
00119 JID m_jid;
00120 std::string m_nick;
00121 MUCRoomAffiliation m_affiliation;
00122 MUCRoomRole m_role;
00123 std::string m_reason;
00126 };
00127
00131 typedef std::list<MUCListItem> MUCListItemList;
00132
00136 enum MUCOperation
00137 {
00138 RequestUniqueName,
00139 CreateInstantRoom,
00140 CancelRoomCreation,
00141 RequestRoomConfig,
00142 DestroyRoom,
00143 GetRoomInfo,
00144 GetRoomItems,
00145 SetRNone,
00146 SetVisitor,
00147 SetParticipant,
00148 SetModerator,
00149 SetANone,
00150 SetOutcast,
00151 SetMember,
00152 SetAdmin,
00153 SetOwner,
00154 RequestVoiceList,
00155 StoreVoiceList,
00156 RequestBanList,
00157 StoreBanList,
00158 RequestMemberList,
00159 StoreMemberList,
00160 RequestModeratorList,
00161 StoreModeratorList,
00162 RequestOwnerList,
00163 StoreOwnerList,
00164 RequestAdminList,
00165 StoreAdminList,
00166 InvalidOperation
00167 };
00168
00175 class GLOOX_API MUCRoomConfigHandler
00176 {
00177 public:
00181 virtual ~MUCRoomConfigHandler() {}
00182
00190 virtual void handleMUCConfigList( MUCRoom* room, const MUCListItemList& items,
00191 MUCOperation operation ) = 0;
00192
00200 virtual void handleMUCConfigForm( MUCRoom* room, const DataForm& form ) = 0;
00201
00209 virtual void handleMUCConfigResult( MUCRoom* room, bool success, MUCOperation operation ) = 0;
00210
00218 virtual void handleMUCRequest( MUCRoom* room, const DataForm& form ) = 0;
00219
00220 };
00221
00222 }
00223
00224 #endif // MUCROOMCONFIGHANDLER_H__