privacymanager.h

00001 /*
00002   Copyright (c) 2005-2008 by Jakob Schroeter <js@camaya.net>
00003   This file is part of the gloox library. http://camaya.net/gloox
00004 
00005   This software is distributed under a license. The full license
00006   agreement can be found in the file LICENSE in this distribution.
00007   This software may not be copied, modified, sold or distributed
00008   other than expressed in the named license agreement.
00009 
00010   This software is distributed without any warranty.
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 
00064       std::string store( const std::string& name,
00065                          const PrivacyListHandler::PrivacyList& list );
00066 
00071       std::string removeList( const std::string& name );
00072 
00077       std::string setDefault( const std::string& name );
00078 
00082       std::string unsetDefault();
00083 
00088       std::string setActive( const std::string& name );
00089 
00093       std::string unsetActive();
00094 
00100       void registerPrivacyListHandler( PrivacyListHandler *plh );
00101 
00105       void removePrivacyListHandler();
00106 
00107       // reimplemented from IqHandler
00108       virtual bool handleIq( Stanza *stanza );
00109 
00110       // reimplemented from IqHandler
00111       virtual bool handleIqID( Stanza *stanza, int context );
00112 
00113     private:
00114       enum IdType
00115       {
00116         PLRequestNames,
00117         PLRequestList,
00118         PLActivate,
00119         PLDefault,
00120         PLUnsetActivate,
00121         PLUnsetDefault,
00122         PLRemove,
00123         PLStore
00124       };
00125 
00126       ClientBase *m_parent;
00127       PrivacyListHandler *m_privacyListHandler;
00128   };
00129 
00130 }
00131 
00132 #endif // PRIVACYMANAGER_H__

Generated on Sun Apr 27 11:08:13 2008 for gloox by  doxygen 1.5.5