00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef PRIVACYMANAGER_H__
00015 #define PRIVACYMANAGER_H__
00016
00017 #include "iqhandler.h"
00018 #include "privacylisthandler.h"
00019
00020 #include <string>
00021
00022 namespace gloox
00023 {
00024
00025 class ClientBase;
00026
00033 class GLOOX_API PrivacyManager : public IqHandler
00034 {
00035 public:
00040 PrivacyManager( ClientBase *parent );
00041
00045 virtual ~PrivacyManager();
00046
00050 std::string requestListNames();
00051
00056 std::string requestList( const std::string& name );
00057
00066 std::string store( const std::string& name, PrivacyListHandler::PrivacyList& list );
00067
00072 std::string removeList( const std::string& name );
00073
00078 std::string setDefault( const std::string& name );
00079
00083 std::string unsetDefault();
00084
00089 std::string setActive( const std::string& name );
00090
00094 std::string unsetActive();
00095
00101 void registerPrivacyListHandler( PrivacyListHandler *plh );
00102
00106 void removePrivacyListHandler();
00107
00108
00109 virtual bool handleIq( Stanza *stanza );
00110
00111
00112 virtual bool handleIqID( Stanza *stanza, int context );
00113
00114 private:
00115 enum IdType
00116 {
00117 PL_REQUEST_NAMES,
00118 PL_REQUEST_LIST,
00119 PL_ACTIVATE,
00120 PL_DEFAULT,
00121 PL_UNSET_ACTIVATE,
00122 PL_UNSET_DEFAULT,
00123 PL_REMOVE,
00124 PL_STORE
00125 };
00126
00127 ClientBase *m_parent;
00128 PrivacyListHandler *m_privacyListHandler;
00129 };
00130
00131 }
00132
00133 #endif // PRIVACYMANAGER_H__