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"
27 class MetaQueryBuilder
: public QueryMaker
32 MetaQueryBuilder( const QList
<Collection
*> &collections
);
35 virtual QueryMaker
* reset();
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();
77 QList
<QueryMaker
*> builders
;
79 QMutex m_queryDoneCountMutex
;
83 #endif /* AMAROK_COLLECTION_METAQUERYBUILDER_H */