1
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
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>
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.
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.
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/>.
29
#include <QNetworkProxy>
31
#include "accounts/Account.h"
32
#ifndef ENABLE_HEADLESS
40
class DLLEXPORT SipPlugin : public QObject
46
explicit SipPlugin( Tomahawk::Accounts::Account *account, QObject* parent = 0 );
49
// plugin id is "pluginfactoryname_someuniqueid". get it from SipPluginFactory::generateId
50
QString pluginId() const;
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();
59
virtual Tomahawk::Accounts::Account* account() const;
62
virtual const QStringList peersOnline() const;
65
virtual void connectPlugin() = 0;
66
virtual void disconnectPlugin() = 0;
67
virtual void checkSettings() = 0;
68
virtual void configurationChanged() = 0;
70
virtual void addContact( const QString &jid, const QString& msg = QString() ) = 0;
71
virtual void sendMsg( const QString& to, const SipInfo& info ) = 0;
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 );
80
#ifndef ENABLE_HEADLESS
81
// new data for own source
82
void avatarReceived ( const QPixmap& avatar );
84
// new data for other sources;
85
void avatarReceived ( const QString& from, const QPixmap& avatar);
87
void addMenu( QMenu* menu );
88
void removeMenu( QMenu* menu );
91
void dataError( bool );
94
void onPeerOnline( const QString &peerId );
95
void onPeerOffline( const QString &peerId );
98
Tomahawk::Accounts::Account *m_account;
101
QStringList m_peersOnline;