gloox  1.0.9
forward.h
1 /*
2  Copyright (c) 2013 by Jakob Schroeter <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 Stanza
75  virtual Stanza* embeddedStanza() const { return m_stanza; }
76 
77  // reimplemented from Stanza
78  virtual Tag* embeddedTag() const { return m_tag; }
79 
80  // reimplemented from Stanza
81  virtual Tag* tag() const;
82 
83  // reimplemented from Stanza
84  const std::string& filterString() const;
85 
86  // reimplemented from Stanza
87  StanzaExtension* newInstance( const Tag* tag ) const
88  {
89  return new Forward( tag );
90  }
91 
92  // reimplemented from Stanza
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__