gloox  1.0.27
jinglesessionmanager.h
1 /*
2  Copyright (c) 2013-2023 by Jakob Schröter <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 JINGLESESSIONMANAGER_H__
15 #define JINGLESESSIONMANAGER_H__
16 
17 #include "macros.h"
18 #include "iqhandler.h"
19 #include "jinglepluginfactory.h"
20 
21 #include <list>
22 
23 namespace gloox
24 {
25 
26  class ClientBase;
27 
28  namespace Jingle
29  {
30 
31  class Session;
32  class SessionHandler;
33 
59  class GLOOX_API SessionManager : public IqHandler
60  {
61  public:
69 
73  virtual ~SessionManager();
74 
79  void registerPlugin( Plugin* plugin );
80 
88  Session* createSession( const JID& callee, SessionHandler* handler );
89 
94  void discardSession( Session* session );
95 
96 
97  // reimplemented from IqHandler
98  virtual bool handleIq( const IQ& iq );
99 
100  // reimplemented from IqHandler
101  virtual void handleIqID( const IQ& /*iq*/, int /*context*/ ) {}
102 
103  private:
104  typedef std::list<Jingle::Session*> SessionList;
105 
106  SessionList m_sessions;
107  ClientBase* m_parent;
108  SessionHandler* m_handler;
109  PluginFactory m_factory;
110 
111  };
112 
113  }
114 
115 }
116 
117 #endif // JINGLESESSIONMANAGER_H__
This is the common base class for a Jabber/XMPP Client and a Jabber Component.
Definition: clientbase.h:79
An abstraction of an IQ stanza.
Definition: iq.h:34
A virtual interface which can be reimplemented to receive IQ stanzas.
Definition: iqhandler.h:32
An abstraction of a JID.
Definition: jid.h:31
A factory for which creates Plugin instances based on Tags. This is part of Jingle (XEP-0166).
An abstraction of a Jingle plugin. This is part of Jingle (XEP-0166 et al.)
Definition: jingleplugin.h:68
A Jingle session handler.
The SessionManager is responsible for creating and destroying Jingle sessions, as well as for delegat...
virtual void handleIqID(const IQ &, int)
This is an implementation of a Jingle Session (XEP-0166).
Definition: jinglesession.h:81
The namespace for the gloox library.
Definition: adhoc.cpp:28