00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef PRIVACYITEM_H__
00015 #define PRIVACYITEM_H__
00016
00017 #include "macros.h"
00018
00019 #include <string>
00020
00021 namespace gloox
00022 {
00023
00031 class GLOOX_API PrivacyItem
00032 {
00033 public:
00034
00038 enum ItemType
00039 {
00040 TYPE_UNDEFINED,
00042 TYPE_JID,
00043 TYPE_GROUP,
00045 TYPE_SUBSCRIPTION
00047 };
00048
00052 enum ItemAction
00053 {
00054 ACTION_ALLOW,
00055 ACTION_DENY
00056 };
00057
00061 enum ItemPacketType
00062 {
00063 PACKET_MESSAGE = 1,
00064 PACKET_PRESENCE_IN = 2,
00065 PACKET_PRESENCE_OUT = 4,
00066 PACKET_IQ = 8,
00067 PACKET_ALL = 15
00068 };
00069
00077 PrivacyItem( const ItemType type = TYPE_UNDEFINED, const ItemAction action = ACTION_ALLOW,
00078 const int packetType = 0, const std::string& value = "" );
00079
00083 virtual ~PrivacyItem();
00084
00089 const ItemType type() const { return m_type; };
00090
00095 const ItemAction action() const { return m_action; };
00096
00101 const int packetType() const { return m_packetType; };
00102
00107 const std::string value() const { return m_value; };
00108
00114 bool operator==( PrivacyItem& item ) const;
00115
00116 private:
00117 ItemType m_type;
00118 ItemAction m_action;
00119 int m_packetType;
00120 std::string m_value;
00121 };
00122
00123 }
00124
00125 #endif // PRIVACYITEM_H__