PageRenderTime 183ms CodeModel.GetById 100ms app.highlight 4ms RepoModel.GetById 76ms app.codeStats 0ms

/src/libtomahawk/infosystem/infoplugins/mac/adiumplugin.h

http://github.com/tomahawk-player/tomahawk
C++ Header | 91 lines | 51 code | 23 blank | 17 comment | 0 complexity | d110ba620b74ad13001dbcf01c20c9e2 MD5 | raw file
 1/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
 2 *
 3 *   Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
 4 *
 5 *   Tomahawk is free software: you can redistribute it and/or modify
 6 *   it under the terms of the GNU General Public License as published by
 7 *   the Free Software Foundation, either version 3 of the License, or
 8 *   (at your option) any later version.
 9 *
10 *   Tomahawk is distributed in the hope that it will be useful,
11 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
12 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 *   GNU General Public License for more details.
14 *
15 *   You should have received a copy of the GNU General Public License
16 *   along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef ADIUMPLUGIN_H
20#define ADIUMPLUGIN_H
21
22#include "infosystem/infosystem.h"
23
24#include <QNetworkAccessManager>
25#include <QObject>
26#include <QVariant>
27#include <QWeakPointer>
28
29class QTimer;
30
31namespace Tomahawk {
32
33namespace InfoSystem {
34
35class AdiumPlugin : public InfoPlugin
36{
37    Q_OBJECT
38
39public:
40    AdiumPlugin();
41    virtual ~AdiumPlugin();
42
43protected slots:
44    virtual void getInfo( Tomahawk::InfoSystem::InfoRequestData requestData )
45    {
46        Q_UNUSED( requestData );
47    }
48    
49    void pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type, QVariant input );
50
51public slots:
52    virtual void notInCacheSlot( const Tomahawk::InfoSystem::InfoStringHash criteria, Tomahawk::InfoSystem::InfoRequestData requestData )
53    {
54        Q_UNUSED( criteria );
55        Q_UNUSED( requestData );
56    }
57
58private slots:
59    void shortLinkReady( QUrl longUrl, QUrl shortUrl );
60
61    void clearStatus();
62    void settingsChanged();
63
64private:
65    void audioStarted( const QVariant &input );
66    void audioFinished( const QVariant &input );
67    void audioStopped();
68    void audioPaused();
69    void audioResumed( const QVariant &input );
70
71    QUrl openLinkFromHash( const InfoStringHash& hash ) const;
72
73    bool m_active;
74    QString m_beforeStatus;
75    QString m_afterStatus;
76
77    QString m_currentTitle;
78    QString m_currentArtist;
79    QUrl m_currentLongUrl;
80
81    QTimer* m_pauseTimer;
82    QWeakPointer<QNetworkAccessManager> m_nam;
83
84};
85
86
87}
88
89}
90
91#endif // ADIUMPLUGIN_H