gloox  1.0.16
stanzaextension.h
1 /*
2  Copyright (c) 2006-2015 by Jakob Schröter <js@camaya.net>
3  This file is part of the gloox library. http://camaya.net/gloox
4 
5  This software is distributed under a license. The full license
6  agreement can be found in the file LICENSE in this distribution.
7  This software may not be copied, modified, sold or distributed
8  other than expressed in the named license agreement.
9 
10  This software is distributed without any warranty.
11 */
12 
13 
14 #ifndef STANZAEXTENSION_H__
15 #define STANZAEXTENSION_H__
16 
17 #include "macros.h"
18 
19 #include <string>
20 
21 namespace gloox
22 {
23 
24  class Tag;
25  class Stanza;
26 
31  {
97  };
98 
182  class GLOOX_API StanzaExtension
183  {
184  public:
190  StanzaExtension( int type ) : m_valid( false ), m_extensionType( type ) {}
191 
195  virtual ~StanzaExtension() {}
196 
203  virtual Stanza* embeddedStanza() const { return 0; }
204 
211  virtual Tag* embeddedTag() const { return 0; }
212 
219  virtual const std::string& filterString() const = 0;
220 
232  virtual StanzaExtension* newInstance( const Tag* tag ) const = 0;
233 
238  virtual Tag* tag() const = 0;
239 
244  virtual StanzaExtension* clone() const = 0;
245 
250  int extensionType() const { return m_extensionType; }
251 
252  protected:
253  bool m_valid;
254 
255  private:
256  int m_extensionType;
257 
258  };
259 
260 }
261 
262 #endif // STANZAEXTENSION_H__
virtual Stanza * embeddedStanza() const
This is the base class for XMPP stanza abstractions.
Definition: stanza.h:33
virtual Tag * embeddedTag() const
The namespace for the gloox library.
Definition: adhoc.cpp:27
This class abstracts a stanza extension, which is usually an element in a specific namespace...
This is an abstraction of an XML element.
Definition: tag.h:46
StanzaExtensionType