privacyitem.h
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 #include "gloox.h"
00019
00020 #include <string>
00021
00022 namespace gloox
00023 {
00024
00032 class GLOOX_API PrivacyItem
00033 {
00034 public:
00035
00039 enum ItemType
00040 {
00041 TypeUndefined,
00043 TypeJid,
00044 TypeGroup,
00046 TypeSubscription
00048 };
00049
00053 enum ItemAction
00054 {
00055 ActionAllow,
00056 ActionDeny
00057 };
00058
00062 enum ItemPacketType
00063 {
00064 PacketMessage = 1,
00065 PacketPresenceIn = 2,
00066 PacketPresenceOut = 4,
00067 PacketIq = 8,
00068 PacketAll = 15
00069 };
00070
00078 PrivacyItem( const ItemType type = TypeUndefined, const ItemAction action = ActionAllow,
00079 const int packetType = 0, const std::string& value = EmptyString );
00080
00084 virtual ~PrivacyItem();
00085
00090 ItemType type() const { return m_type; }
00091
00096 ItemAction action() const { return m_action; }
00097
00102 int packetType() const { return m_packetType; }
00103
00108 const std::string value() const { return m_value; }
00109
00115 bool operator==( const PrivacyItem& item ) const;
00116
00117 private:
00118 ItemType m_type;
00119 ItemAction m_action;
00120 int m_packetType;
00121 std::string m_value;
00122 };
00123
00124 }
00125
00126 #endif // PRIVACYITEM_H__