gloox  1.0.9
pubsubresulthandler.h
1 /*
2  Copyright (c) 2007-2013 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 
168  virtual void handleSubscriptionOptions( const std::string& id,
169  const JID& service,
170  const JID& jid,
171  const std::string& node,
172  const DataForm* options,
173  const std::string& sid = EmptyString,
174  const Error* error = 0 ) = 0;
175 
188  virtual void handleSubscriptionOptionsResult( const std::string& id,
189  const JID& service,
190  const JID& jid,
191  const std::string& node,
192  const std::string& sid = EmptyString,
193  const Error* error = 0 ) = 0;
194 
195 
207  virtual void handleSubscribers( const std::string& id,
208  const JID& service,
209  const std::string& node,
210  const SubscriberList* list,
211  const Error* error = 0 ) = 0;
212 
224  virtual void handleSubscribersResult( const std::string& id,
225  const JID& service,
226  const std::string& node,
227  const SubscriberList* list,
228  const Error* error = 0 ) = 0;
229 
241  virtual void handleAffiliates( const std::string& id,
242  const JID& service,
243  const std::string& node,
244  const AffiliateList* list,
245  const Error* error = 0 ) = 0;
246 
258  virtual void handleAffiliatesResult( const std::string& id,
259  const JID& service,
260  const std::string& node,
261  const AffiliateList* list,
262  const Error* error = 0 ) = 0;
263 
264 
276  virtual void handleNodeConfig( const std::string& id,
277  const JID& service,
278  const std::string& node,
279  const DataForm* config,
280  const Error* error = 0 ) = 0;
281 
292  virtual void handleNodeConfigResult( const std::string& id,
293  const JID& service,
294  const std::string& node,
295  const Error* error = 0 ) = 0;
296 
307  virtual void handleNodeCreation( const std::string& id,
308  const JID& service,
309  const std::string& node,
310  const Error* error = 0 ) = 0;
311 
322  virtual void handleNodeDeletion( const std::string& id,
323  const JID& service,
324  const std::string& node,
325  const Error* error = 0 ) = 0;
326 
327 
338  virtual void handleNodePurge( const std::string& id,
339  const JID& service,
340  const std::string& node,
341  const Error* error = 0 ) = 0;
342 
353  virtual void handleSubscriptions( const std::string& id,
354  const JID& service,
355  const SubscriptionMap& subMap,
356  const Error* error = 0) = 0;
357 
368  virtual void handleAffiliations( const std::string& id,
369  const JID& service,
370  const AffiliationMap& affMap,
371  const Error* error = 0 ) = 0;
372 
383  virtual void handleDefaultNodeConfig( const std::string& id,
384  const JID& service,
385  const DataForm* config,
386  const Error* error = 0 ) = 0;
387 
388  };
389 
390  }
391 
392 }
393 
394 #endif // PUBSUBRESULTHANDLER_H__
395