Use a KPluginSelector instead of the custom crap that, in my ignorance, I had half...
[amarok.git] / src / servicebrowser / mp3tunes / mp3tunesservice.h
blob26d12cb3600a2a963a303b5020fe30370e26358d
1 /***************************************************************************
2 * Copyright (c) 2007 Nikolaj Hald Nielsen <nhnFreespirit@gmail.com> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
20 #ifndef MP3TUNESSERVICE_H
21 #define MP3TUNESSERVICE_H
25 #include "../servicebase.h"
26 #include "Mp3tunesServiceCollection.h"
28 #include <kio/jobclasses.h>
29 #include <kio/job.h>
32 class Mp3tunesServiceFactory: public ServiceFactory
34 Q_OBJECT
36 public:
37 Mp3tunesServiceFactory() {}
38 virtual ~Mp3tunesServiceFactory() {}
40 virtual void init();
41 virtual QString name();
42 virtual KPluginInfo info();
46 /**
47 A service for displaying, previewing and downloading music from Mp3tunes.com
49 @author
51 class Mp3tunesService : public ServiceBase
54 Q_OBJECT
55 public:
56 Mp3tunesService( const QString &name );
58 ~Mp3tunesService();
60 void polish();
62 private:
64 void authenticate( const QString & uname = "", const QString & passwd = "" );
66 private slots:
68 void authenticationComplete( KJob *job );
70 private:
72 KIO::StoredTransferJob *m_xmlDownloadJob;
73 QString m_partnerToken;
74 QString m_apiOutputFormat;
76 bool m_authenticated;
77 QString m_sessionId;
79 Mp3tunesServiceCollection * m_collection;
82 #endif