Freya  0.0.1
A Gtk3 MPD Client
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
src/MPD/Query.hh
Go to the documentation of this file.
00001 #ifndef FREYA_MPD_DB_QUERY_HH
00002 #define FREYA_MPD_DB_QUERY_HH
00003 
00004 #include <mpd/client.h>
00005 #include <vector>
00006 
00007 #include "AbstractClientExtension.hh"
00008 
00009 namespace MPD
00010 {
00011     enum QueryType
00012     {
00013         QUERY_TAGS,
00014         QUERY_SONGS
00015     };
00016 
00017     class BaseClient;
00018     class Song;
00019 
00020     typedef std::vector<MPD::Song*> SongVector;
00021     typedef std::vector<char*> TagVector;
00022 
00023     class Query : public AbstractClientExtension
00024     {
00025         // Only MPD::BaseClient may instance Queries
00026         friend class BaseClient;
00027 
00028         public:
00029             void add_tag_constraint(mpd_tag_type tag, const char * value);
00030             void add_tag_constraint(const char * tag, const char * value);
00031             void commit(SongVector &list);
00032             void commit(TagVector  &list);
00033 
00034             void cancel();
00035 
00036         private:
00037             Query(MPD::BaseClient& client, QueryType type, int arg);
00038 
00039             mpd_connection * mConn;
00040             QueryType mType;
00041     };
00042 }
00043 
00044 #endif /* end of include guard: FREYA_MPD_DB_QUERY_HH */
00045