Make plasma libs build.
[amarok.git] / src / collection / MetaQueryBuilder.h
blobe3a00197bbea042cc3356762dd21d3ef0dddcb79
1 /*
2 * Copyright (c) 2007 Maximilian Kossick <maximilian.kossick@googlemail.com>
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.
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.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 #ifndef AMAROK_COLLECTION_METAQUERYBUILDER_H
19 #define AMAROK_COLLECTION_METAQUERYBUILDER_H
21 #include "QueryMaker.h"
22 #include "Collection.h"
24 #include <QList>
25 #include <QMutex>
27 class MetaQueryBuilder : public QueryMaker
29 Q_OBJECT
31 public:
32 MetaQueryBuilder( const QList<Collection*> &collections);
33 ~MetaQueryBuilder();
35 virtual QueryMaker* reset();
36 virtual void run();
37 virtual void abortQuery();
38 virtual int resultCount() const;
40 virtual QueryMaker* startTrackQuery();
41 virtual QueryMaker* startArtistQuery();
42 virtual QueryMaker* startAlbumQuery();
43 virtual QueryMaker* startGenreQuery();
44 virtual QueryMaker* startComposerQuery();
45 virtual QueryMaker* startYearQuery();
46 virtual QueryMaker* startCustomQuery();
48 virtual QueryMaker* returnResultAsDataPtrs( bool resultAsDataPtrs );
50 virtual QueryMaker* addReturnValue( qint64 value);
51 virtual QueryMaker* orderBy( qint64 value, bool descending = false );
53 virtual QueryMaker* addMatch( const Meta::TrackPtr &track );
54 virtual QueryMaker* addMatch( const Meta::ArtistPtr &artist );
55 virtual QueryMaker* addMatch( const Meta::AlbumPtr &album );
56 virtual QueryMaker* addMatch( const Meta::ComposerPtr &composer );
57 virtual QueryMaker* addMatch( const Meta::GenrePtr &genre );
58 virtual QueryMaker* addMatch( const Meta::YearPtr &year );
59 virtual QueryMaker* addMatch( const Meta::DataPtr &data );
61 virtual QueryMaker* addFilter( qint64 value, const QString &filter, bool matchBegin, bool matchEnd );
62 virtual QueryMaker* excludeFilter( qint64 value, const QString &filter, bool matchBegin, bool matchEnd );
64 virtual QueryMaker* includeCollection( const QString &collectionId );
65 virtual QueryMaker* excludeCollection( const QString &collectionId );
67 virtual QueryMaker* limitMaxResultSize( int size );
69 virtual QueryMaker* beginAnd();
70 virtual QueryMaker* beginOr();
71 virtual QueryMaker* endAndOr();
73 private slots:
74 void slotQueryDone();
76 private:
77 QList<QueryMaker*> builders;
78 int m_queryDoneCount;
79 QMutex m_queryDoneCountMutex;
83 #endif /* AMAROK_COLLECTION_METAQUERYBUILDER_H */