PrivacyItem Class Reference

This is an abstraction of a single item of a privacy list, describing an allowed or forbidden action. More...

#include <privacyitem.h>

List of all members.

Public Types

enum  ItemType { TYPE_UNDEFINED, TYPE_JID, TYPE_GROUP, TYPE_SUBSCRIPTION }
enum  ItemAction { ACTION_ALLOW, ACTION_DENY }
enum  ItemPacketType {
  PACKET_MESSAGE = 1, PACKET_PRESENCE_IN = 2, PACKET_PRESENCE_OUT = 4, PACKET_IQ = 8,
  PACKET_ALL = 15
}

Public Member Functions

 PrivacyItem (const ItemType type=TYPE_UNDEFINED, const ItemAction action=ACTION_ALLOW, const int packetType=0, const std::string &value="")
virtual ~PrivacyItem ()
const ItemType type () const
const ItemAction action () const
const int packetType () const
const std::string value () const
bool operator== (PrivacyItem &item) const


Detailed Description

This is an abstraction of a single item of a privacy list, describing an allowed or forbidden action.

Author:
Jakob Schroeter <js@camaya.net>
Since:
0.3

Definition at line 31 of file privacyitem.h.


Member Enumeration Documentation

enum ItemType

Three possible types of an item. Only one is allowed at a time.

Enumerator:
TYPE_UNDEFINED  None of the types below is explicitely selected, "fall-through" case.
TYPE_JID  The item affects the JID which is given in the value attribute.
TYPE_GROUP  The item affects the group which is given in the value attribute and which must exist at least once in the users roster.
TYPE_SUBSCRIPTION  The item affects the subscription type which is given in the value attribute.

Definition at line 38 of file privacyitem.h.

enum ItemAction

Two possible actions. Only one is allowed at a time.

Enumerator:
ACTION_ALLOW  The item explicitely allows the described packets.
ACTION_DENY  The item forbids the described packets.

Definition at line 52 of file privacyitem.h.

enum ItemPacketType

The packet type a privacy item affects (blocks). Combinations are allowed.

Enumerator:
PACKET_MESSAGE  The item blocks message stanzas.
PACKET_PRESENCE_IN  The item blocks incoming presence stanzas.
PACKET_PRESENCE_OUT  The item blocks outgoing presence stanzas.
PACKET_IQ  The item blocks IQ stanzas.
PACKET_ALL  The item blocks all of these stanza types.

Definition at line 61 of file privacyitem.h.


Constructor & Destructor Documentation

PrivacyItem ( const ItemType  type = TYPE_UNDEFINED,
const ItemAction  action = ACTION_ALLOW,
const int  packetType = 0,
const std::string &  value = "" 
)

Constructs a new privacy item.

Parameters:
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.

~PrivacyItem (  )  [virtual]

Virtual destructor.

Definition at line 27 of file privacyitem.cpp.


Member Function Documentation

const ItemType type (  )  const [inline]

Returns the item type.

Returns:
The type of the item.

Definition at line 89 of file privacyitem.h.

Referenced by PrivacyItem::operator==().

const ItemAction action (  )  const [inline]

Returns the item's action.

Returns:
The action of the item.

Definition at line 95 of file privacyitem.h.

Referenced by PrivacyItem::operator==().

const int packetType (  )  const [inline]

Returns the packet type the item affects.

Returns:
An OR'ed list of affected packet types.

Definition at line 101 of file privacyitem.h.

Referenced by PrivacyItem::operator==().

const std::string value (  )  const [inline]

Returns the value of the item's 'value' attribute.

Returns:
value The 'value' attribute's value.

Definition at line 107 of file privacyitem.h.

Referenced by PrivacyItem::operator==().

bool operator== ( PrivacyItem item  )  const

Compares the current PrivacyItem with another one.

Parameters:
item The item which shall be compared.
Returns:
True if both items are equal, false otherwise.

Definition at line 31 of file privacyitem.cpp.


The documentation for this class was generated from the following files:
Generated on Tue May 1 14:20:25 2007 for gloox by  doxygen 1.5.1