PrivacyManager Class Reference

This class implements a manager for privacy lists as defined in section 10 of RFC 3921. More...

#include <privacymanager.h>

Inherits IqHandler.

Inheritance diagram for PrivacyManager:

Inheritance graph
[legend]
Collaboration diagram for PrivacyManager:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PrivacyManager (ClientBase *parent)
virtual ~PrivacyManager ()
std::string requestListNames ()
std::string requestList (const std::string &name)
std::string store (const std::string &name, PrivacyListHandler::PrivacyList &list)
std::string removeList (const std::string &name)
std::string setDefault (const std::string &name)
std::string unsetDefault ()
std::string setActive (const std::string &name)
std::string unsetActive ()
void registerPrivacyListHandler (PrivacyListHandler *plh)
void removePrivacyListHandler ()
virtual bool handleIq (Stanza *stanza)
virtual bool handleIqID (Stanza *stanza, int context)

Detailed Description

This class implements a manager for privacy lists as defined in section 10 of RFC 3921.

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

Definition at line 33 of file privacymanager.h.


Constructor & Destructor Documentation

PrivacyManager ( ClientBase parent  ) 

Constructs a new PrivacyManager.

Parameters:
parent The ClientBase to use for communication.

Definition at line 23 of file privacymanager.cpp.

~PrivacyManager (  )  [virtual]

Virtual destructor.

Definition at line 30 of file privacymanager.cpp.


Member Function Documentation

std::string requestListNames (  ) 

Triggers the request of the privacy lists currently stored on the server.

Definition at line 36 of file privacymanager.cpp.

std::string requestList ( const std::string &  name  ) 

Triggers the retrieval of the named privacy lists.

Parameters:
name The name of the list to retrieve.

Definition at line 51 of file privacymanager.cpp.

std::string store ( const std::string &  name,
PrivacyListHandler::PrivacyList list 
)

Stores the given list on the server. If a list with the given name exists, the existing list is overwritten.

Parameters:
name The list's name.
list A list of privacy items which describe the list.
Note:
If list is empty the privacy list with the given name will be removed if it exists on the server. (Same as removeList().)

Definition at line 151 of file privacymanager.cpp.

std::string removeList ( const std::string &  name  ) 

Removes a list by its name.

Parameters:
name The name of the list to remove.

Definition at line 68 of file privacymanager.cpp.

std::string setDefault ( const std::string &  name  ) 

Sets the named list as the default list, i.e. active by default after login.

Parameters:
name The name of the list to set as default.

Definition at line 85 of file privacymanager.cpp.

std::string unsetDefault (  ) 

This function declines the use of any default list.

Definition at line 102 of file privacymanager.cpp.

std::string setActive ( const std::string &  name  ) 

Sets the named list as active, i.e. active for this session

Parameters:
name The name of the list to set active.

Definition at line 118 of file privacymanager.cpp.

std::string unsetActive (  ) 

This function declines the use of any active list.

Definition at line 135 of file privacymanager.cpp.

void registerPrivacyListHandler ( PrivacyListHandler plh  ) 

Use this function to register an object as PrivacyListHandler. Only one PrivacyListHandler at a time is possible.

Parameters:
plh The object to register as handler for privacy list related events.

Definition at line 368 of file privacymanager.cpp.

void removePrivacyListHandler (  ) 

Use this function to clear the registered PrivacyListHandler.

Definition at line 373 of file privacymanager.cpp.

bool handleIq ( Stanza stanza  )  [virtual]

Reimplement this function if you want to be notified about incoming IQs.

Parameters:
stanza The complete Stanza.
Returns:
Indicates whether a request of type 'get' or 'set' has been handled. This includes the obligatory 'result' answer. If you return false, a 'error' will be sent.

Implements IqHandler.

Definition at line 219 of file privacymanager.cpp.

bool handleIqID ( Stanza stanza,
int  context 
) [virtual]

Reimplement this function if you want to be notified about incoming IQs with a specific value of the id attribute. You have to enable tracking of those IDs using Client::trackID(). This is usually useful for IDs that generate a positive reply, i.e. <iq type='result' id='reg'/> where a namespace filter wouldn't work.

Parameters:
stanza The complete Stanza.
context A value to restore context, stored with ClientBase::trackID().
Returns:
Indicates whether a request of type 'get' or 'set' has been handled. This includes the obligatory 'result' answer. If you return false, a 'error' will be sent.

Implements IqHandler.

Definition at line 240 of file privacymanager.cpp.


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