gloox  1.0.28
forward.h
1 /*
2  Copyright (c) 2013-2023 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 FORWARD_H__
15 #define FORWARD_H__
16 
17 #include "stanzaextension.h"
18 
19 #include <string>
20 
21 namespace gloox
22 {
23 
24  class DelayedDelivery;
25  class Stanza;
26 
40  class GLOOX_API Forward : public StanzaExtension
41  {
42  public:
43 
50  Forward( Stanza* stanza, DelayedDelivery* delay );
51 
59  Forward( const Tag* tag = 0 );
60 
64  virtual ~Forward();
65 
72  const DelayedDelivery* when() const { return m_delay; }
73 
74  // reimplemented from StanzaExtension
75  virtual Stanza* embeddedStanza() const { return m_stanza; }
76 
77  // reimplemented from StanzaExtension
78  virtual Tag* embeddedTag() const { return m_tag; }
79 
80  // reimplemented from StanzaExtension
81  virtual Tag* tag() const;
82 
83  // reimplemented from StanzaExtension
84  const std::string& filterString() const;
85 
86  // reimplemented from StanzaExtension
87  StanzaExtension* newInstance( const Tag* tag ) const
88  {
89  return new Forward( tag );
90  }
91 
92  // reimplemented from StanzaExtension
93  StanzaExtension* clone() const;
94 
95  private:
96  Stanza* m_stanza;
97  Tag* m_tag;
98  DelayedDelivery* m_delay;
99 
100  };
101 
102 }
103 
104 #endif // FORWARD_H__
This is an implementation of XEP-0203 (Delayed Delivery).
This is an implementation of Stanza Forwarding (XEP-0297) as a StanzaExtension.
Definition: forward.h:41
StanzaExtension * newInstance(const Tag *tag) const
Definition: forward.h:87
virtual Tag * embeddedTag() const
Definition: forward.h:78
virtual Stanza * embeddedStanza() const
Definition: forward.h:75
const DelayedDelivery * when() const
Definition: forward.h:72
This class abstracts a stanza extension, which is usually an XML child element in a specific namespac...
This is the base class for XMPP stanza abstractions.
Definition: stanza.h:34
This is an abstraction of an XML element.
Definition: tag.h:47
The namespace for the gloox library.
Definition: adhoc.cpp:28