gloox  0.9.9.12
privacymanager.h
1 /*
2  Copyright (c) 2005-2008 by Jakob Schroeter <js@camaya.net>
3  This file is part of the gloox library. http://camaya.net/gloox
4 
5  This software is distributed under a license. The full license
6  agreement can be found in the file LICENSE in this distribution.
7  This software may not be copied, modified, sold or distributed
8  other than expressed in the named license agreement.
9 
10  This software is distributed without any warranty.
11 */
12 
13 
14 #ifndef PRIVACYMANAGER_H__
15 #define PRIVACYMANAGER_H__
16 
17 #include "iqhandler.h"
18 #include "privacylisthandler.h"
19 
20 #include <string>
21 
22 namespace gloox
23 {
24 
25  class ClientBase;
26 
33  class GLOOX_API PrivacyManager : public IqHandler
34  {
35  public:
40  PrivacyManager( ClientBase *parent );
41 
45  virtual ~PrivacyManager();
46 
50  std::string requestListNames();
51 
56  std::string requestList( const std::string& name );
57 
64  std::string store( const std::string& name,
65  const PrivacyListHandler::PrivacyList& list );
66 
71  std::string removeList( const std::string& name );
72 
77  std::string setDefault( const std::string& name );
78 
82  std::string unsetDefault();
83 
88  std::string setActive( const std::string& name );
89 
93  std::string unsetActive();
94 
100  void registerPrivacyListHandler( PrivacyListHandler *plh );
101 
105  void removePrivacyListHandler();
106 
107  // reimplemented from IqHandler
108  virtual bool handleIq( Stanza *stanza );
109 
110  // reimplemented from IqHandler
111  virtual bool handleIqID( Stanza *stanza, int context );
112 
113  private:
114  enum IdType
115  {
116  PLRequestNames,
117  PLRequestList,
118  PLActivate,
119  PLDefault,
120  PLUnsetActivate,
121  PLUnsetDefault,
122  PLRemove,
123  PLStore
124  };
125 
126  ClientBase *m_parent;
127  PrivacyListHandler *m_privacyListHandler;
128  };
129 
130 }
131 
132 #endif // PRIVACYMANAGER_H__