gloox  1.0
pubsubresulthandler.h
1 /*
2  Copyright (c) 2007-2009 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 #ifndef PUBSUBRESULTHANDLER_H__
14 #define PUBSUBRESULTHANDLER_H__
15 
16 #include "error.h"
17 #include "jid.h"
18 #include "macros.h"
19 #include "pubsub.h"
20 #include "tag.h"
21 
22 #include <string>
23 #include <list>
24 #include <map>
25 
26 namespace gloox
27 {
28 
29  class Tag;
30  class Error;
31  class DataForm;
32 
33  namespace PubSub
34  {
49  class GLOOX_API ResultHandler
50  {
51  public:
55  virtual ~ResultHandler() {}
56 
64  virtual void handleItem( const JID& service,
65  const std::string& node,
66  const Tag* entry ) = 0;
67 
79  virtual void handleItems( const std::string& id,
80  const JID& service,
81  const std::string& node,
82  const ItemList& itemList,
83  const Error* error = 0 ) = 0;
84 
96  virtual void handleItemPublication( const std::string& id,
97  const JID& service,
98  const std::string& node,
99  const ItemList& itemList,
100  const Error* error = 0 ) = 0;
101 
113  virtual void handleItemDeletion( const std::string& id,
114  const JID& service,
115  const std::string& node,
116  const ItemList& itemList,
117  const Error* error = 0 ) = 0;
118 
133  virtual void handleSubscriptionResult( const std::string& id,
134  const JID& service,
135  const std::string& node,
136  const std::string& sid,
137  const JID& jid,
138  const SubscriptionType subType,
139  const Error* error = 0 ) = 0;
140 
151  virtual void handleUnsubscriptionResult( const std::string& id,
152  const JID& service,
153  const Error* error = 0 ) = 0;
154 
167  virtual void handleSubscriptionOptions( const std::string& id,
168  const JID& service,
169  const JID& jid,
170  const std::string& node,
171  const DataForm* options,
172  const Error* error = 0 ) = 0;
173 
185  virtual void handleSubscriptionOptionsResult( const std::string& id,
186  const JID& service,
187  const JID& jid,
188  const std::string& node,
189  const Error* error = 0 ) = 0;
190 
191 
203  virtual void handleSubscribers( const std::string& id,
204  const JID& service,
205  const std::string& node,
206  const SubscriberList* list,
207  const Error* error = 0 ) = 0;
208 
220  virtual void handleSubscribersResult( const std::string& id,
221  const JID& service,
222  const std::string& node,
223  const SubscriberList* list,
224  const Error* error = 0 ) = 0;
225 
237  virtual void handleAffiliates( const std::string& id,
238  const JID& service,
239  const std::string& node,
240  const AffiliateList* list,
241  const Error* error = 0 ) = 0;
242 
254  virtual void handleAffiliatesResult( const std::string& id,
255  const JID& service,
256  const std::string& node,
257  const AffiliateList* list,
258  const Error* error = 0 ) = 0;
259 
260 
272  virtual void handleNodeConfig( const std::string& id,
273  const JID& service,
274  const std::string& node,
275  const DataForm* config,
276  const Error* error = 0 ) = 0;
277 
288  virtual void handleNodeConfigResult( const std::string& id,
289  const JID& service,
290  const std::string& node,
291  const Error* error = 0 ) = 0;
292 
303  virtual void handleNodeCreation( const std::string& id,
304  const JID& service,
305  const std::string& node,
306  const Error* error = 0 ) = 0;
307 
318  virtual void handleNodeDeletion( const std::string& id,
319  const JID& service,
320  const std::string& node,
321  const Error* error = 0 ) = 0;
322 
323 
334  virtual void handleNodePurge( const std::string& id,
335  const JID& service,
336  const std::string& node,
337  const Error* error = 0 ) = 0;
338 
349  virtual void handleSubscriptions( const std::string& id,
350  const JID& service,
351  const SubscriptionMap& subMap,
352  const Error* error = 0) = 0;
353 
364  virtual void handleAffiliations( const std::string& id,
365  const JID& service,
366  const AffiliationMap& affMap,
367  const Error* error = 0 ) = 0;
368 
379  virtual void handleDefaultNodeConfig( const std::string& id,
380  const JID& service,
381  const DataForm* config,
382  const Error* error = 0 ) = 0;
383 
384  };
385 
386  }
387 
388 }
389 
390 #endif // PUBSUBRESULTHANDLER_H__
391