gloox  1.1-svn
receipt.h
1 /*
2  Copyright (c) 2007-2009 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 #ifndef RECEIPT_H__
14 #define RECEIPT_H__
15 
16 #include "gloox.h"
17 #include "stanzaextension.h"
18 
19 #include <string>
20 
21 namespace gloox
22 {
23 
24  class Tag;
25 
32  class GLOOX_API Receipt : public StanzaExtension
33  {
34  public:
39  {
42  Invalid
43  };
44 
49  Receipt( const Tag* tag );
50 
56  : StanzaExtension( ExtReceipt ), m_rcpt( rcpt )
57  {}
58 
62  virtual ~Receipt() {}
63 
68  ReceiptType rcpt() const { return m_rcpt; }
69 
70  // reimplemented from StanzaExtension
71  virtual const std::string& filterString() const;
72 
73  // reimplemented from StanzaExtension
74  virtual StanzaExtension* newInstance( const Tag* tag ) const
75  {
76  return new Receipt( tag );
77  }
78 
79  // reimplemented from StanzaExtension
80  Tag* tag() const;
81 
82  // reimplemented from StanzaExtension
83  virtual StanzaExtension* clone() const
84  {
85  return new Receipt( *this );
86  }
87 
88  private:
89  ReceiptType m_rcpt;
90 
91  };
92 
93 }
94 
95 #endif // RECEIPT_H__