privacymanager.h

00001 /*
00002   Copyright (c) 2005-2006 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 
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       // reimplemented from IqHandler
00109       virtual bool handleIq( Stanza *stanza );
00110 
00111       // reimplemented from IqHandler
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__

Generated on Tue May 1 14:20:20 2007 for gloox by  doxygen 1.5.1