1 /****************************************************************************************
2  * Copyright (c) 2010-2012 Leo Franchi <lfranchi@kde.org>                               *
3  *                                                                                      *
4  * This program is free software; you can redistribute it and/or modify it under        *
5  * the terms of the GNU General Public License as published by the Free Software        *
6  * Foundation; either version 2 of the License, or (at your option) any later           *
7  * version.                                                                             *
8  *                                                                                      *
9  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
10  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
11  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
12  *                                                                                      *
13  * You should have received a copy of the GNU General Public License along with         *
14  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
15  ****************************************************************************************/
16 
17 
18 #ifndef ECHONEST_TYPEINFORMATION_H
19 #define ECHONEST_TYPEINFORMATION_H
20 
21 #include "echonest_export.h"
22 
23 #include <qglobal.h>
24 #include <QStringList>
25 #include <QMetaType>
26 
27 namespace Echonest {
28     class ArtistInformationPrivate;
29     class SongInformationPrivate;
30     class GenreInformationPrivate;
31 
32     /**
33      * This class describes what artist information to return with a query.
34      *
35      * The default behaviour is NoInformation.
36      */
37     class ECHONEST_EXPORT ArtistInformation
38     {
39     public:
40         enum ArtistInformationFlag {
41             NoInformation = 0x0000,
42             Audio = 0x0001,
43             Biographies = 0x0002,
44             Blogs = 0x0004,
45             Familiarity = 0x0008,
46             Hotttnesss = 0x0010,
47             Images = 0x0020,
48             News = 0x0040,
49             Reviews = 0x0080,
50             Terms = 0x0100,
51             Urls = 0x200,
52             Videos = 0x0400,
53             Genre = 0x0800
54         };
55         Q_DECLARE_FLAGS( ArtistInformationFlags, ArtistInformationFlag )
56 
57         ArtistInformation();
58         ArtistInformation( ArtistInformationFlags flags );
59         ArtistInformation( ArtistInformationFlags flags, const QStringList& idSpaces );
60         ArtistInformation( const ArtistInformation& other );
61         ~ArtistInformation();
62         ArtistInformation& operator=( const ArtistInformation& typeInfo );
63 
64         /**
65          * The individual pieces of information to fetch for this artist.
66          *
67          * Use \c setIdSpaces to set an id space for this query.
68          */
69         ArtistInformationFlags flags() const;
70         void setArtistInformationFlags( ArtistInformationFlags flags );
71 
72         /**
73          * The id spaces to limit this to. Do not include the "id:" prefix.
74          */
75         QStringList idSpaces() const;
76         void setIdSpaces( const QStringList& idspaces );
77 
78         private:
79             ArtistInformationPrivate* d_ptr;
80             Q_DECLARE_PRIVATE( ArtistInformation )
81     };
82 
Q_DECLARE_OPERATORS_FOR_FLAGS(ArtistInformation::ArtistInformationFlags)83     Q_DECLARE_OPERATORS_FOR_FLAGS( ArtistInformation::ArtistInformationFlags )
84 
85     /**
86      * This class describes what song information to return with a query.
87      *
88      * The default behaviour is NoInformation.
89      */
90     class ECHONEST_EXPORT SongInformation
91     {
92     public:
93         enum SongInformationFlag {
94             AudioSummaryInformation = 0x001,
95             Tracks = 0x002,
96             Hotttnesss = 0x04,
97             ArtistHotttnesss = 0x008,
98             ArtistFamiliarity = 0x010,
99             ArtistLocation = 0x020,
100             SongType = 0x40,
101 
102             NoInformation = 0x800
103         };
104         Q_DECLARE_FLAGS( SongInformationFlags, SongInformationFlag )
105 
106         SongInformation();
107         SongInformation( SongInformationFlags flags );
108         SongInformation( SongInformationFlags flags, const QStringList& idSpaces );
109         SongInformation( const SongInformation& other );
110         ~SongInformation();
111         SongInformation& operator=( const SongInformation& info );
112 
113         /**
114          * The individual pieces of information to fetch for this song.
115          *  If id spaces are desired,see \c setIdSpaces for more information.
116          */
117         SongInformationFlags flags() const;
118         void setSongInformationFlags( SongInformationFlags flags );
119 
120         /**
121          * The id spaces to limit this to. Do not include the "id:" prefix.
122          */
123         QStringList idSpaces() const;
124         void setIdSpaces( const QStringList& idspaces );
125 
126     private:
127         SongInformationPrivate* d_ptr;
128         Q_DECLARE_PRIVATE( SongInformation )
129 
130     };
131 
Q_DECLARE_OPERATORS_FOR_FLAGS(SongInformation::SongInformationFlags)132     Q_DECLARE_OPERATORS_FOR_FLAGS(SongInformation::SongInformationFlags)
133 
134     /**
135      * This class describes what genre information to return with a query.
136      *
137      * The default behaviour is NoInformation.
138      */
139     class ECHONEST_EXPORT GenreInformation
140     {
141     public:
142         enum GenreInformationFlag {
143             Description = 0x001,
144             Urls = 0x002,
145 
146             NoInformation = 0x800
147         };
148         Q_DECLARE_FLAGS( GenreInformationFlags, GenreInformationFlag )
149 
150         GenreInformation();
151         GenreInformation( GenreInformationFlags flags );
152         GenreInformation( const GenreInformation& other );
153         ~GenreInformation();
154         GenreInformation& operator=( const GenreInformation& info );
155 
156         /**
157          * The individual pieces of information to fetch for this song.
158          */
159         GenreInformationFlags flags() const;
160         void setGenreInformationFlags( GenreInformationFlags flags );
161 
162     private:
163         GenreInformationPrivate* d_ptr;
164         Q_DECLARE_PRIVATE( GenreInformation )
165 
166     };
167 
168     Q_DECLARE_OPERATORS_FOR_FLAGS(GenreInformation::GenreInformationFlags)
169 
170 }
171 
172 Q_DECLARE_METATYPE( Echonest::ArtistInformation )
173 Q_DECLARE_METATYPE( Echonest::SongInformation )
174 Q_DECLARE_METATYPE( Echonest::GenreInformation )
175 
176 #endif
177