mucroomconfighandler.h
/*
Copyright (c) 2006-2023 by Jakob Schröter <js@camaya.net>
This file is part of the gloox library. http://camaya.net/gloox
This software is distributed under a license. The full license
agreement can be found in the file LICENSE in this distribution.
This software may not be copied, modified, sold or distributed
other than expressed in the named license agreement.
This software is distributed without any warranty.
*/
#ifndef MUCROOMCONFIGHANDLER_H__
#define MUCROOMCONFIGHANDLER_H__
#include "gloox.h"
#include "jid.h"
#include <string>
#include <list>
namespace gloox
{
class MUCRoom;
class DataForm;
class MUCListItem
{
public:
MUCListItem( const JID& jid )
: m_jid( jid ), m_affiliation( AffiliationInvalid ), m_role( RoleInvalid )
{}
MUCListItem( const JID& jid, MUCRoomRole role, MUCRoomAffiliation affiliation,
const std::string& nick )
: m_jid( jid ), m_nick( nick ), m_affiliation( affiliation ), m_role( role )
{}
MUCListItem( const std::string& nick, MUCRoomAffiliation affiliation, const std::string& reason )
: m_nick( nick ), m_affiliation( affiliation ), m_role( RoleInvalid ),
m_reason( reason )
{}
MUCListItem( const std::string& nick, MUCRoomRole role, const std::string& reason )
: m_nick( nick ), m_affiliation( AffiliationInvalid ), m_role( role ),
m_reason( reason )
{}
~MUCListItem() {}
const JID& jid() const { return m_jid; }
const std::string& nick() const { return m_nick; }
MUCRoomAffiliation affiliation() const { return m_affiliation; }
MUCRoomRole role() const { return m_role; }
const std::string& reason() const { return m_reason; }
private:
JID m_jid;
std::string m_nick;
MUCRoomAffiliation m_affiliation;
MUCRoomRole m_role;
std::string m_reason;
};
typedef std::list<MUCListItem> MUCListItemList;
enum MUCOperation
{
RequestUniqueName,
CreateInstantRoom,
CancelRoomCreation,
RequestRoomConfig,
SendRoomConfig,
DestroyRoom,
GetRoomInfo,
GetRoomItems,
SetRNone,
SetVisitor,
SetParticipant,
SetModerator,
SetANone,
SetOutcast,
SetMember,
SetAdmin,
SetOwner,
RequestVoiceList,
StoreVoiceList,
RequestBanList,
StoreBanList,
RequestMemberList,
StoreMemberList,
RequestModeratorList,
StoreModeratorList,
RequestOwnerList,
StoreOwnerList,
RequestAdminList,
StoreAdminList,
InvalidOperation
};
class GLOOX_API MUCRoomConfigHandler
{
public:
virtual ~MUCRoomConfigHandler() {}
virtual void handleMUCConfigList( MUCRoom* room, const MUCListItemList& items,
MUCOperation operation ) = 0;
virtual void handleMUCConfigForm( MUCRoom* room, const DataForm& form ) = 0;
virtual void handleMUCConfigResult( MUCRoom* room, bool success, MUCOperation operation ) = 0;
virtual void handleMUCRequest( MUCRoom* room, const DataForm& form ) = 0;
};
}
#endif // MUCROOMCONFIGHANDLER_H__
gloox::DataForm
An abstraction of a XEP-0004 Data Form.
Definition dataform.h:57
gloox::JID
An abstraction of a JID.
Definition jid.h:31
gloox::MUCListItem::affiliation
MUCRoomAffiliation affiliation() const
Definition mucroomconfighandler.h:104
gloox::MUCListItem::nick
const std::string & nick() const
Definition mucroomconfighandler.h:98
gloox::MUCListItem::~MUCListItem
~MUCListItem()
Definition mucroomconfighandler.h:86
gloox::MUCListItem::MUCListItem
MUCListItem(const JID &jid, MUCRoomRole role, MUCRoomAffiliation affiliation, const std::string &nick)
Definition mucroomconfighandler.h:56
gloox::MUCListItem::MUCListItem
MUCListItem(const std::string &nick, MUCRoomAffiliation affiliation, const std::string &reason)
Definition mucroomconfighandler.h:67
gloox::MUCListItem::MUCListItem
MUCListItem(const JID &jid)
Definition mucroomconfighandler.h:45
gloox::MUCListItem::reason
const std::string & reason() const
Definition mucroomconfighandler.h:116
gloox::MUCListItem::jid
const JID & jid() const
Definition mucroomconfighandler.h:92
gloox::MUCListItem::role
MUCRoomRole role() const
Definition mucroomconfighandler.h:110
gloox::MUCListItem::MUCListItem
MUCListItem(const std::string &nick, MUCRoomRole role, const std::string &reason)
Definition mucroomconfighandler.h:78
gloox::MUCRoomConfigHandler
An abstract interface that can be implemented for MUC room configuration.
Definition mucroomconfighandler.h:177
gloox::MUCRoomConfigHandler::handleMUCConfigResult
virtual void handleMUCConfigResult(MUCRoom *room, bool success, MUCOperation operation)=0
gloox::MUCRoomConfigHandler::handleMUCConfigList
virtual void handleMUCConfigList(MUCRoom *room, const MUCListItemList &items, MUCOperation operation)=0
gloox::MUCRoomConfigHandler::handleMUCRequest
virtual void handleMUCRequest(MUCRoom *room, const DataForm &form)=0
gloox::MUCRoomConfigHandler::handleMUCConfigForm
virtual void handleMUCConfigForm(MUCRoom *room, const DataForm &form)=0
gloox::MUCRoomConfigHandler::~MUCRoomConfigHandler
virtual ~MUCRoomConfigHandler()
Definition mucroomconfighandler.h:182
gloox::MUCRoom
This is an implementation of XEP-0045 (Multi-User Chat).
Definition mucroom.h:87
gloox
The namespace for the gloox library.
Definition adhoc.cpp:28
gloox::MUCRoomRole
MUCRoomRole
Definition gloox.h:1164
gloox::RoleInvalid
@ RoleInvalid
Definition gloox.h:1169
gloox::MUCListItemList
std::list< MUCListItem > MUCListItemList
Definition mucroomconfighandler.h:131
gloox::MUCOperation
MUCOperation
Definition mucroomconfighandler.h:137
gloox::SetOutcast
@ SetOutcast
Definition mucroomconfighandler.h:151
gloox::SetOwner
@ SetOwner
Definition mucroomconfighandler.h:154
gloox::RequestAdminList
@ RequestAdminList
Definition mucroomconfighandler.h:165
gloox::GetRoomInfo
@ GetRoomInfo
Definition mucroomconfighandler.h:144
gloox::SetANone
@ SetANone
Definition mucroomconfighandler.h:150
gloox::GetRoomItems
@ GetRoomItems
Definition mucroomconfighandler.h:145
gloox::RequestVoiceList
@ RequestVoiceList
Definition mucroomconfighandler.h:155
gloox::StoreVoiceList
@ StoreVoiceList
Definition mucroomconfighandler.h:156
gloox::SetAdmin
@ SetAdmin
Definition mucroomconfighandler.h:153
gloox::StoreOwnerList
@ StoreOwnerList
Definition mucroomconfighandler.h:164
gloox::RequestModeratorList
@ RequestModeratorList
Definition mucroomconfighandler.h:161
gloox::StoreBanList
@ StoreBanList
Definition mucroomconfighandler.h:158
gloox::StoreAdminList
@ StoreAdminList
Definition mucroomconfighandler.h:166
gloox::SetMember
@ SetMember
Definition mucroomconfighandler.h:152
gloox::StoreModeratorList
@ StoreModeratorList
Definition mucroomconfighandler.h:162
gloox::RequestOwnerList
@ RequestOwnerList
Definition mucroomconfighandler.h:163
gloox::SetRNone
@ SetRNone
Definition mucroomconfighandler.h:146
gloox::CreateInstantRoom
@ CreateInstantRoom
Definition mucroomconfighandler.h:139
gloox::SendRoomConfig
@ SendRoomConfig
Definition mucroomconfighandler.h:142
gloox::InvalidOperation
@ InvalidOperation
Definition mucroomconfighandler.h:167
gloox::SetParticipant
@ SetParticipant
Definition mucroomconfighandler.h:148
gloox::SetVisitor
@ SetVisitor
Definition mucroomconfighandler.h:147
gloox::RequestMemberList
@ RequestMemberList
Definition mucroomconfighandler.h:159
gloox::RequestBanList
@ RequestBanList
Definition mucroomconfighandler.h:157
gloox::DestroyRoom
@ DestroyRoom
Definition mucroomconfighandler.h:143
gloox::StoreMemberList
@ StoreMemberList
Definition mucroomconfighandler.h:160
gloox::SetModerator
@ SetModerator
Definition mucroomconfighandler.h:149
gloox::RequestUniqueName
@ RequestUniqueName
Definition mucroomconfighandler.h:138
gloox::CancelRoomCreation
@ CancelRoomCreation
Definition mucroomconfighandler.h:140
gloox::RequestRoomConfig
@ RequestRoomConfig
Definition mucroomconfighandler.h:141
gloox::MUCRoomAffiliation
MUCRoomAffiliation
Definition gloox.h:1151
gloox::AffiliationInvalid
@ AffiliationInvalid
Definition gloox.h:1157