gloox
1.0.9
|
#include <privacyitem.h>
Public Types | |
enum | ItemType { TypeUndefined, TypeJid, TypeGroup, TypeSubscription } |
enum | ItemAction { ActionAllow, ActionDeny } |
enum | ItemPacketType { PacketMessage = 1, PacketPresenceIn = 2, PacketPresenceOut = 4, PacketIq = 8, PacketAll = 15 } |
Public Member Functions | |
PrivacyItem (const ItemType type=TypeUndefined, const ItemAction action=ActionAllow, const int packetType=0, const std::string &value=EmptyString) | |
virtual | ~PrivacyItem () |
ItemType | type () const |
ItemAction | action () const |
int | packetType () const |
const std::string | value () const |
bool | operator== (const PrivacyItem &item) const |
This is an abstraction of a single item of a privacy list, describing an allowed or forbidden action.
Definition at line 32 of file privacyitem.h.
enum ItemAction |
Two possible actions. Only one is allowed at a time.
ActionAllow |
The item explicitely allows the described packets. |
ActionDeny |
The item forbids the described packets. |
Definition at line 53 of file privacyitem.h.
enum ItemPacketType |
The packet type a privacy item affects (blocks). Combinations are allowed.
PacketMessage |
The item blocks message stanzas. |
PacketPresenceIn |
The item blocks incoming presence stanzas. |
PacketPresenceOut |
The item blocks outgoing presence stanzas. |
PacketIq |
The item blocks IQ stanzas. |
PacketAll |
The item blocks all of these stanza types. |
Definition at line 62 of file privacyitem.h.
enum ItemType |
Three possible types of an item. Only one is allowed at a time.
TypeUndefined |
None of the types below is explicitely selected, "fall-through" case. |
TypeJid |
The item affects the JID which is given in the value attribute. |
TypeGroup |
The item affects the group which is given in the value attribute and which must exist at least once in the users roster. |
TypeSubscription |
The item affects the subscription type which is given in the value attribute. |
Definition at line 39 of file privacyitem.h.
PrivacyItem | ( | const ItemType | type = TypeUndefined , |
const ItemAction | action = ActionAllow , |
||
const int | packetType = 0 , |
||
const std::string & | value = EmptyString |
||
) |
Constructs a new privacy item.
type | Action is based on matching JID, Group or Subscription. |
action | The action to carry out. (Deny or allow.) |
packetType | Affected packet types. Bit-wise OR'ed ItemPacketType. |
value | The value to check for and match. |
Definition at line 20 of file privacyitem.cpp.
|
virtual |
Virtual destructor.
Definition at line 27 of file privacyitem.cpp.
|
inline |
Returns the item's action.
Definition at line 96 of file privacyitem.h.
bool operator== | ( | const PrivacyItem & | item | ) | const |
Compares the current PrivacyItem with another one.
item | The item which shall be compared. |
Definition at line 31 of file privacyitem.cpp.
|
inline |
Returns the packet type the item affects.
Definition at line 102 of file privacyitem.h.
|
inline |
|
inline |
Returns the value of the item's 'value' attribute.
Definition at line 108 of file privacyitem.h.