File indexing completed on 2024-05-19 04:50:22

0001 /****************************************************************************************
0002  * Copyright (c) 2007 Nikolaj Hald Nielsen <nhn@kde.org>                                *
0003  * Copyright (c) 2008 Casey Link <unnamedrambler@gmail.com>                             *
0004  *                                                                                      *
0005  * This program is free software; you can redistribute it and/or modify it under        *
0006  * the terms of the GNU General Public License as published by the Free Software        *
0007  * Foundation; either version 2 of the License, or (at your option) any later           *
0008  * version.                                                                             *
0009  *                                                                                      *
0010  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0011  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0012  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0013  *                                                                                      *
0014  * You should have received a copy of the GNU General Public License along with         *
0015  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0016  ****************************************************************************************/
0017 
0018 #ifndef MP3TUNESSERVICECOLLECTION_H
0019 #define MP3TUNESSERVICECOLLECTION_H
0020 
0021 #include <ServiceCollectionLocation.h>
0022 #include "Mp3tunesLockerMeta.h"
0023 #include "Mp3tunesMeta.h"
0024 #include "Mp3tunesLocker.h"
0025 
0026 #include <QMap>
0027 
0028 namespace Collections {
0029 
0030 class Mp3tunesServiceCollection : public ServiceCollection
0031 {
0032     Q_OBJECT
0033     
0034 public:
0035     Mp3tunesServiceCollection( ServiceBase * service, const QString &sessionId,
0036             Mp3tunesLocker * locker );
0037 
0038     virtual ~Mp3tunesServiceCollection();
0039 
0040     virtual QueryMaker* queryMaker();
0041 
0042     virtual QString collectionId() const;
0043     virtual QString prettyName() const;
0044     virtual CollectionLocation* location();
0045     Mp3tunesLocker* locker() const;
0046 
0047     virtual Meta::TrackPtr trackForUrl( const QUrl &url );
0048     virtual bool possiblyContainsTrack( const QUrl &url ) const;
0049 
0050 private Q_SLOTS:
0051     /**
0052      * Handles trackForUrl complete.
0053      */
0054     void trackForUrlComplete( Mp3tunesLockerTrack &track );
0055 
0056 private:
0057     QString m_sessionId;
0058     Mp3tunesLocker * m_locker;
0059     QMap<QString, Meta::Mp3TunesTrack*> m_tracksFetching; // a list of tracks that are being fetched via trackForUrl and their associated threadweaver jobs
0060 };
0061 
0062 } //namespace Collections
0063 
0064 #endif