gloox  1.0
privacyitem.h
1 /*
2  Copyright (c) 2005-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 
14 #ifndef PRIVACYITEM_H__
15 #define PRIVACYITEM_H__
16 
17 #include "macros.h"
18 #include "gloox.h"
19 
20 #include <string>
21 
22 namespace gloox
23 {
24 
32  class GLOOX_API PrivacyItem
33  {
34  public:
35 
39  enum ItemType
40  {
41  TypeUndefined,
44  TypeGroup,
46  TypeSubscription
48  };
49 
54  {
56  ActionDeny
57  };
58 
63  {
64  PacketMessage = 1,
65  PacketPresenceIn = 2,
66  PacketPresenceOut = 4,
67  PacketIq = 8,
68  PacketAll = 15
69  };
70 
78  PrivacyItem( const ItemType type = TypeUndefined, const ItemAction action = ActionAllow,
79  const int packetType = 0, const std::string& value = EmptyString );
80 
84  virtual ~PrivacyItem();
85 
90  ItemType type() const { return m_type; }
91 
96  ItemAction action() const { return m_action; }
97 
102  int packetType() const { return m_packetType; }
103 
108  const std::string value() const { return m_value; }
109 
115  bool operator==( const PrivacyItem& item ) const;
116 
117  private:
118  ItemType m_type;
119  ItemAction m_action;
120  int m_packetType;
121  std::string m_value;
122  };
123 
124 }
125 
126 #endif // PRIVACYITEM_H__