1
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
3
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
4
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
5
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
7
* Tomahawk is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
12
* Tomahawk is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
24
#include "sip/SipPlugin.h"
31
#ifndef ENABLE_HEADLESS
36
* Manages SIP plugins for connecting to friends. External interface to SIP plugins is
37
* through AccountManager, this is an internal class.
40
class DLLEXPORT SipHandler : public QObject
45
static SipHandler* instance();
47
SipHandler( QObject* parent );
50
void loadFromAccountManager();
52
#ifndef ENABLE_HEADLESS
53
const QPixmap avatar( const QString& name ) const;
56
//TODO: implement a proper SipInfo class and maybe attach it to the source
57
const SipInfo sipInfo( const QString& peerId ) const;
58
const QString versionString( const QString& peerId ) const;
60
void hookUpPlugin( SipPlugin* p );
63
void onSipInfo( const QString& peerId, const SipInfo& info );
64
void onSoftwareVersion( const QString& peerId, const QString& versionString );
65
void onMessage( const QString&, const QString& );
66
void onPeerOffline( const QString& );
67
void onPeerOnline( const QString& );
69
#ifndef ENABLE_HEADLESS
70
// set data for local source
71
void onAvatarReceived( const QPixmap& avatar );
73
// set data for other sources
74
void onAvatarReceived( const QString& from, const QPixmap& avatar );
78
static SipHandler *s_instance;
80
//TODO: move this to source
81
QHash<QString, SipInfo> m_peersSipInfos;
82
QHash<QString, QString> m_peersSoftwareVersions;
83
#ifndef ENABLE_HEADLESS
84
QHash<QString, QPixmap> m_usernameAvatars;