stanzaextension.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 STANZAEXTENSION_H__
#define STANZAEXTENSION_H__
#include "macros.h"
#include <string>
namespace gloox
{
class Tag;
class Stanza;
enum StanzaExtensionType
{
ExtNone,
ExtVCardUpdate,
ExtOOB,
ExtGPGSigned,
ExtGPGEncrypted,
ExtReceipt,
ExtDelay,
ExtAMP,
ExtError,
ExtCaps,
ExtChatState,
ExtMessageEvent,
ExtDataForm,
ExtNickname,
ExtResourceBind,
ExtSessionCreation,
ExtVersion,
ExtXHtmlIM,
ExtDiscoInfo,
ExtDiscoItems,
ExtAdhocCommand,
ExtPrivateXML,
ExtRoster,
ExtFeatureNeg,
ExtIBB,
ExtNonSaslAuth,
ExtMUC,
ExtMUCOwner,
ExtMUCAdmin,
ExtMUCUser,
ExtMUCUnique,
ExtPing,
ExtSearch,
ExtRegistration,
ExtJingle,
ExtVCard,
ExtPrivacy,
ExtLastActivity,
ExtFlexOffline,
ExtSI,
ExtS5BQuery,
ExtPubSub,
ExtPubSubOwner,
ExtPubSubEvent,
ExtSHIM,
ExtAttention,
ExtForward,
ExtCarbons,
ExtIOData,
ExtUser
};
class GLOOX_API StanzaExtension
{
public:
StanzaExtension( int type ) : m_valid( false ), m_extensionType( type ) {}
virtual ~StanzaExtension() {}
virtual Stanza* embeddedStanza() const { return 0; }
virtual Tag* embeddedTag() const { return 0; }
virtual const std::string& filterString() const = 0;
virtual StanzaExtension* newInstance( const Tag* tag ) const = 0;
virtual Tag* tag() const = 0;
virtual StanzaExtension* clone() const = 0;
int extensionType() const { return m_extensionType; }
protected:
bool m_valid;
private:
int m_extensionType;
};
}
#endif // STANZAEXTENSION_H__
gloox::StanzaExtension::newInstance
virtual StanzaExtension * newInstance(const Tag *tag) const =0
gloox::StanzaExtension::StanzaExtension
StanzaExtension(int type)
Definition stanzaextension.h:211
gloox::StanzaExtension::tag
virtual Tag * tag() const =0
gloox::StanzaExtension::clone
virtual StanzaExtension * clone() const =0
gloox::StanzaExtension::filterString
virtual const std::string & filterString() const =0
gloox::StanzaExtension::embeddedTag
virtual Tag * embeddedTag() const
Definition stanzaextension.h:232
gloox::StanzaExtension::embeddedStanza
virtual Stanza * embeddedStanza() const
Definition stanzaextension.h:224
gloox::StanzaExtension::~StanzaExtension
virtual ~StanzaExtension()
Definition stanzaextension.h:216
gloox::StanzaExtension::extensionType
int extensionType() const
Definition stanzaextension.h:271
gloox::Stanza
This is the base class for XMPP stanza abstractions.
Definition stanza.h:34
gloox::Tag
This is an abstraction of an XML element.
Definition tag.h:47
gloox
The namespace for the gloox library.
Definition adhoc.cpp:28
gloox::StanzaExtensionType
StanzaExtensionType
Definition stanzaextension.h:31
gloox::ExtMUCAdmin
@ ExtMUCAdmin
Definition stanzaextension.h:71
gloox::ExtPubSub
@ ExtPubSub
Definition stanzaextension.h:84
gloox::ExtVersion
@ ExtVersion
Definition stanzaextension.h:56
gloox::ExtGPGEncrypted
@ ExtGPGEncrypted
Definition stanzaextension.h:39
gloox::ExtSI
@ ExtSI
Definition stanzaextension.h:82
gloox::ExtMUC
@ ExtMUC
Definition stanzaextension.h:69
gloox::ExtCarbons
@ ExtCarbons
Definition stanzaextension.h:91
gloox::ExtRegistration
@ ExtRegistration
Definition stanzaextension.h:76
gloox::ExtIBB
@ ExtIBB
Definition stanzaextension.h:67
gloox::ExtMUCUser
@ ExtMUCUser
Definition stanzaextension.h:72
gloox::ExtLastActivity
@ ExtLastActivity
Definition stanzaextension.h:80
gloox::ExtMUCUnique
@ ExtMUCUnique
Definition stanzaextension.h:73
gloox::ExtAMP
@ ExtAMP
Definition stanzaextension.h:45
gloox::ExtIOData
@ ExtIOData
Definition stanzaextension.h:92
gloox::ExtPing
@ ExtPing
Definition stanzaextension.h:74
gloox::ExtJingle
@ ExtJingle
Definition stanzaextension.h:77
gloox::ExtAdhocCommand
@ ExtAdhocCommand
Definition stanzaextension.h:62
gloox::ExtSHIM
@ ExtSHIM
Definition stanzaextension.h:88
gloox::ExtPrivateXML
@ ExtPrivateXML
Definition stanzaextension.h:63
gloox::ExtDelay
@ ExtDelay
Definition stanzaextension.h:43
gloox::ExtNickname
@ ExtNickname
Definition stanzaextension.h:53
gloox::ExtUser
@ ExtUser
Definition stanzaextension.h:94
gloox::ExtFeatureNeg
@ ExtFeatureNeg
Definition stanzaextension.h:65
gloox::ExtPubSubEvent
@ ExtPubSubEvent
Definition stanzaextension.h:86
gloox::ExtMUCOwner
@ ExtMUCOwner
Definition stanzaextension.h:70
gloox::ExtDataForm
@ ExtDataForm
Definition stanzaextension.h:52
gloox::ExtDiscoItems
@ ExtDiscoItems
Definition stanzaextension.h:61
gloox::ExtRoster
@ ExtRoster
Definition stanzaextension.h:64
gloox::ExtOOB
@ ExtOOB
Definition stanzaextension.h:35
gloox::ExtDiscoInfo
@ ExtDiscoInfo
Definition stanzaextension.h:60
gloox::ExtXHtmlIM
@ ExtXHtmlIM
Definition stanzaextension.h:58
gloox::ExtSearch
@ ExtSearch
Definition stanzaextension.h:75
gloox::ExtS5BQuery
@ ExtS5BQuery
Definition stanzaextension.h:83
gloox::ExtPubSubOwner
@ ExtPubSubOwner
Definition stanzaextension.h:85
gloox::ExtCaps
@ ExtCaps
Definition stanzaextension.h:48
gloox::ExtReceipt
@ ExtReceipt
Definition stanzaextension.h:41
gloox::ExtMessageEvent
@ ExtMessageEvent
Definition stanzaextension.h:51
gloox::ExtPrivacy
@ ExtPrivacy
Definition stanzaextension.h:79
gloox::ExtGPGSigned
@ ExtGPGSigned
Definition stanzaextension.h:37
gloox::ExtForward
@ ExtForward
Definition stanzaextension.h:90
gloox::ExtVCardUpdate
@ ExtVCardUpdate
Definition stanzaextension.h:33
gloox::ExtError
@ ExtError
Definition stanzaextension.h:47
gloox::ExtVCard
@ ExtVCard
Definition stanzaextension.h:78
gloox::ExtAttention
@ ExtAttention
Definition stanzaextension.h:89
gloox::ExtSessionCreation
@ ExtSessionCreation
Definition stanzaextension.h:55
gloox::ExtFlexOffline
@ ExtFlexOffline
Definition stanzaextension.h:81
gloox::ExtNone
@ ExtNone
Definition stanzaextension.h:32
gloox::ExtNonSaslAuth
@ ExtNonSaslAuth
Definition stanzaextension.h:68
gloox::ExtChatState
@ ExtChatState
Definition stanzaextension.h:50
gloox::ExtResourceBind
@ ExtResourceBind
Definition stanzaextension.h:54