gloox 1.0
|
00001 /* 00002 Copyright (c) 2006-2009 by Jakob Schroeter <js@camaya.net> 00003 This file is part of the gloox library. http://camaya.net/gloox 00004 00005 This software is distributed under a license. The full license 00006 agreement can be found in the file LICENSE in this distribution. 00007 This software may not be copied, modified, sold or distributed 00008 other than expressed in the named license agreement. 00009 00010 This software is distributed without any warranty. 00011 */ 00012 00013 00014 #ifndef STANZAEXTENSION_H__ 00015 #define STANZAEXTENSION_H__ 00016 00017 #include "macros.h" 00018 00019 #include <string> 00020 00021 namespace gloox 00022 { 00023 00024 class Tag; 00025 00029 enum StanzaExtensionType 00030 { 00031 ExtNone, 00032 ExtVCardUpdate, 00034 ExtOOB, 00036 ExtGPGSigned, 00038 ExtGPGEncrypted, 00040 ExtReceipt, 00042 ExtDelay, 00044 ExtAMP, 00046 ExtError, 00047 ExtCaps, 00049 ExtChatState, 00050 ExtMessageEvent, 00051 ExtDataForm, 00052 ExtNickname, 00053 ExtResourceBind, 00054 ExtSessionCreation, 00055 ExtVersion, 00057 ExtXHtmlIM, 00059 ExtDiscoInfo, 00060 ExtDiscoItems, 00061 ExtAdhocCommand, 00062 ExtPrivateXML, 00063 ExtRoster, 00064 ExtFeatureNeg, 00066 ExtIBB, 00067 ExtNonSaslAuth, 00068 ExtMUC, 00069 ExtMUCOwner, 00070 ExtMUCAdmin, 00071 ExtMUCUser, 00072 ExtMUCUnique, 00073 ExtPing, 00074 ExtSearch, 00075 ExtRegistration, 00076 ExtJingle, 00077 ExtVCard, 00078 ExtPrivacy, 00079 ExtLastActivity, 00080 ExtFlexOffline, 00081 ExtSI, 00082 ExtS5BQuery, 00083 ExtPubSub, 00084 ExtPubSubOwner, 00085 ExtPubSubEvent, 00087 ExtSHIM, 00088 ExtAttention, 00089 ExtUser 00092 }; 00093 00177 class GLOOX_API StanzaExtension 00178 { 00179 public: 00185 StanzaExtension( int type ) : m_valid( false ), m_extensionType( type ) {} 00186 00190 virtual ~StanzaExtension() {} 00191 00198 virtual const std::string& filterString() const = 0; 00199 00211 virtual StanzaExtension* newInstance( const Tag* tag ) const = 0; 00212 00217 virtual Tag* tag() const = 0; 00218 00223 virtual StanzaExtension* clone() const = 0; 00224 00229 int extensionType() const { return m_extensionType; } 00230 00231 protected: 00232 bool m_valid; 00233 00234 private: 00235 int m_extensionType; 00236 00237 }; 00238 00239 } 00240 00241 #endif // STANZAEXTENSION_H__