Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

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 { 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


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 32 of file privacyitem.h.


Member Enumeration Documentation

enum ItemAction
 

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

Enumeration values:
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.

Enumeration values:
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.

Enumeration values:
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.


Constructor & Destructor Documentation

PrivacyItem const ItemType  type = TypeUndefined,
const ItemAction  action = ActionAllow,
const int  packetType = 0,
const std::string &  value = EmptyString
 

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

ItemAction action  )  const [inline]
 

Returns the item's action.

Returns:
The action of the item.

Definition at line 96 of file privacyitem.h.

bool operator== const 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.

int packetType  )  const [inline]
 

Returns the packet type the item affects.

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

Definition at line 102 of file privacyitem.h.

ItemType type  )  const [inline]
 

Returns the item type.

Returns:
The type of the item.

Definition at line 90 of file privacyitem.h.

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 108 of file privacyitem.h.


The documentation for this class was generated from the following files:
Generated on Sat Oct 31 19:54:39 2009 for gloox by  doxygen 1.4.1