gloox  1.0.16
Public Types | Public Member Functions | List of all members
PrivacyItem Class Reference

#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
 

Detailed Description

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

Author
Jakob Schröter js@ca.nosp@m.maya.nosp@m..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.

Enumerator
ActionAllow 

The item explicitely allows the described packets.

ActionDeny 

The item forbids the described packets.

Definition at line 53 of file privacyitem.h.

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

Enumerator
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.

Enumerator
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
typeAction is based on matching JID, Group or Subscription.
actionThe action to carry out. (Deny or allow.)
packetTypeAffected packet types. Bit-wise OR'ed ItemPacketType.
valueThe 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
itemThe 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: