From bcb704366cb5e333a626c18c308c7e0448a8e69f Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kopete/protocols/jabber/jingle/jinglesession.h | 94 ++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 kopete/protocols/jabber/jingle/jinglesession.h (limited to 'kopete/protocols/jabber/jingle/jinglesession.h') diff --git a/kopete/protocols/jabber/jingle/jinglesession.h b/kopete/protocols/jabber/jingle/jinglesession.h new file mode 100644 index 00000000..00c192bd --- /dev/null +++ b/kopete/protocols/jabber/jingle/jinglesession.h @@ -0,0 +1,94 @@ +/* + jinglesession.h - Define a Jingle session. + + Copyright (c) 2006 by Michaël Larouche + + Kopete (c) 2001-2006 by the Kopete developers + + ************************************************************************* + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ************************************************************************* +*/ +#ifndef JINGLESESSION_H +#define JINGLESESSION_H + +#include +#include + +#include // XMPP::Jid +#include + +class JabberAccount; +/** + * @brief Base class for peer-to-peer session that use Jingle signaling + * + * @author Michaël Larouche + */ +class JingleSession : public QObject +{ + Q_OBJECT +public: + typedef QValueList JidList; + + JingleSession(JabberAccount *account, const JidList &peers); + virtual ~JingleSession(); + + /** + * Return the JabberAccount associated with this session. + */ + JabberAccount *account(); + + const XMPP::Jid &myself() const; + const JidList &peers() const; + JidList &peers(); + + /** + * Return the type of session(ex: voice, video, games) + * Note that you must return the XML namespace that define + * the session: ex:(http://jabber.org/protocol/jingle/sessions/audio) + */ + virtual QString sessionType() = 0; + +public slots: + /** + * @brief Start a session with the give JID. + * You should begin the negociation here. + */ + virtual void start() = 0; + /** + * @brief Acept a session request. + */ + virtual void accept() = 0; + /** + * @brief Decline a session request. + */ + virtual void decline() = 0; + /** + * @brief Terminate a Jingle session. + */ + virtual void terminate() = 0; + +protected slots: + void sendStanza(const QString &stanza); + +signals: + /** + * Session is started(negocation and connection test are done). + */ + void sessionStarted(); + + void accepted(); + void declined(); + void terminated(); + +private: + class Private; + Private *d; +}; + +#endif -- cgit v1.2.1