gloox  1.0.16
carbons.h
1 /*
2  Copyright (c) 2013-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 CARBONS_H__
15 #define CARBONS_H__
16 
17 #include "macros.h"
18 
19 #include "stanzaextension.h"
20 #include "tag.h"
21 
22 namespace gloox
23 {
24 
25  class Forward;
26 
116  class GLOOX_API Carbons : public StanzaExtension
117  {
118  public:
122  enum Type
123  {
129  Invalid
130  };
131 
137  Carbons( Type type );
138 
143  Carbons( const Tag* tag = 0 );
144 
148  virtual ~Carbons();
149 
154  Type type() const { return m_type; }
155 
156  // reimplemented from StanzaExtension
157  virtual Stanza* embeddedStanza() const;
158 
159  // reimplemented from StanzaExtension
160  virtual Tag* embeddedTag() const;
161 
162  // reimplemented from StanzaExtension
163  virtual const std::string& filterString() const;
164 
165  // reimplemented from StanzaExtension
166  virtual StanzaExtension* newInstance( const Tag* tag ) const
167  {
168  return new Carbons( tag );
169  }
170 
171  // reimplemented from StanzaExtension
172  virtual Tag* tag() const;
173 
174  // reimplemented from StanzaExtension
175  virtual StanzaExtension* clone() const;
176 
177  private:
178  Forward* m_forward;
179  Type m_type;
180 
181  };
182 
183 }
184 
185 #endif // CARBONS_H__
This is an implementation of Stanza Forwarding (XEP-0297) as a StanzaExtension.
Definition: forward.h:40
This is the base class for XMPP stanza abstractions.
Definition: stanza.h:33
virtual StanzaExtension * newInstance(const Tag *tag) const
Definition: carbons.h:166
Type type() const
Definition: carbons.h:154
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
An implementation of Message Carbons (XEP-0280) as a StanzaExtension.
Definition: carbons.h:116