~ubuntu-branches/ubuntu/trusty/tomahawk/trusty-proposed

« back to all changes in this revision

Viewing changes to src/libtomahawk/sip/SipPlugin.h

  • Committer: Package Import Robot
  • Author(s): Harald Sitter
  • Date: 2013-03-07 21:50:13 UTC
  • Revision ID: package-import@ubuntu.com-20130307215013-6gdjkdds7i9uenvs
Tags: upstream-0.6.0+dfsg
ImportĀ upstreamĀ versionĀ 0.6.0+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
 
2
 *
 
3
 *   Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
 
4
 *             2011, Dominik Schmidt <dev@dominik-schmidt.de>
 
5
 *             2010-2011, Leo Franchi <lfranchi@kde.org>
 
6
 *   Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
 
7
 *
 
8
 *   Tomahawk is free software: you can redistribute it and/or modify
 
9
 *   it under the terms of the GNU General Public License as published by
 
10
 *   the Free Software Foundation, either version 3 of the License, or
 
11
 *   (at your option) any later version.
 
12
 *
 
13
 *   Tomahawk is distributed in the hope that it will be useful,
 
14
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
16
 *   GNU General Public License for more details.
 
17
 *
 
18
 *   You should have received a copy of the GNU General Public License
 
19
 *   along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
 
20
 */
 
21
 
 
22
#ifndef SIPPLUGIN_H
 
23
#define SIPPLUGIN_H
 
24
 
 
25
#include "SipInfo.h"
 
26
 
 
27
#include <QObject>
 
28
#include <QString>
 
29
#include <QNetworkProxy>
 
30
 
 
31
#include "accounts/Account.h"
 
32
#ifndef ENABLE_HEADLESS
 
33
    #include <QMenu>
 
34
#endif
 
35
 
 
36
#include "DllMacro.h"
 
37
 
 
38
class SipPlugin;
 
39
 
 
40
class DLLEXPORT SipPlugin : public QObject
 
41
{
 
42
    Q_OBJECT
 
43
 
 
44
public:
 
45
    SipPlugin();
 
46
    explicit SipPlugin( Tomahawk::Accounts::Account *account, QObject* parent = 0 );
 
47
    virtual ~SipPlugin();
 
48
 
 
49
    // plugin id is "pluginfactoryname_someuniqueid".  get it from SipPluginFactory::generateId
 
50
    QString pluginId() const;
 
51
 
 
52
    virtual bool isValid() const = 0;
 
53
    virtual const QString friendlyName() const;
 
54
    virtual const QString serviceName() const;
 
55
    virtual QString inviteString() const;
 
56
#ifndef ENABLE_HEADLESS
 
57
    virtual QMenu* menu();
 
58
#endif
 
59
    virtual Tomahawk::Accounts::Account* account() const;
 
60
 
 
61
    // peer infos
 
62
    virtual const QStringList peersOnline() const;
 
63
 
 
64
public slots:
 
65
    virtual void connectPlugin() = 0;
 
66
    virtual void disconnectPlugin() = 0;
 
67
    virtual void checkSettings() = 0;
 
68
    virtual void configurationChanged() = 0;
 
69
 
 
70
    virtual void addContact( const QString &jid, const QString& msg = QString() ) = 0;
 
71
    virtual void sendMsg( const QString& to, const SipInfo& info ) = 0;
 
72
 
 
73
signals:
 
74
    void peerOnline( const QString& );
 
75
    void peerOffline( const QString& );
 
76
    void msgReceived( const QString& from, const QString& msg );
 
77
    void sipInfoReceived( const QString& peerId, const SipInfo& info );
 
78
    void softwareVersionReceived( const QString& peerId, const QString& versionString );
 
79
 
 
80
#ifndef ENABLE_HEADLESS
 
81
    // new data for own source
 
82
    void avatarReceived ( const QPixmap& avatar );
 
83
 
 
84
    // new data for other sources;
 
85
    void avatarReceived ( const QString& from,  const QPixmap& avatar);
 
86
 
 
87
    void addMenu( QMenu* menu );
 
88
    void removeMenu( QMenu* menu );
 
89
#endif
 
90
 
 
91
    void dataError( bool );
 
92
 
 
93
private slots:
 
94
    void onPeerOnline( const QString &peerId );
 
95
    void onPeerOffline( const QString &peerId );
 
96
 
 
97
protected:
 
98
    Tomahawk::Accounts::Account *m_account;
 
99
 
 
100
private:
 
101
    QStringList m_peersOnline;
 
102
};
 
103
 
 
104
#endif