1 | /* |
2 | * MusicBrainz -- The Internet music metadatabase |
3 | * |
4 | * Copyright (C) 2006 Lukas Lalinsky |
5 | * |
6 | * This library is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU Lesser General Public |
8 | * License as published by the Free Software Foundation; either |
9 | * version 2.1 of the License, or (at your option) any later version. |
10 | * |
11 | * This library is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | * Lesser General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU Lesser General Public |
17 | * License along with this library; if not, write to the Free Software |
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
19 | * |
20 | * |
21 | */ |
22 | |
23 | #ifndef __MUSICBRAINZ3_INCLUDES_H__ |
24 | #define __MUSICBRAINZ3_INCLUDES_H__ |
25 | |
26 | #include <string> |
27 | #include <vector> |
28 | #include <musicbrainz3/musicbrainz.h> |
29 | |
30 | namespace MusicBrainz |
31 | { |
32 | |
33 | /** |
34 | * An interface implemented by include tag generators. |
35 | */ |
36 | class MB_API IIncludes |
37 | { |
38 | public: |
39 | typedef std::vector<std::string> IncludeList; |
40 | |
41 | virtual ~IIncludes() {}; |
42 | |
43 | /** |
44 | * Returns a list of strings containing include parameters for |
45 | * the WebService. |
46 | * |
47 | * @return a list of strings |
48 | */ |
49 | virtual IncludeList createIncludeTags() const = 0; |
50 | }; |
51 | |
52 | /** |
53 | * A specification on how much data to return with a artist. |
54 | * |
55 | * This implementation uses \e method \e chaining to define list of includes. |
56 | * |
57 | * Example usage: |
58 | * \code |
59 | * ArtistIncludes inc = ArtistIncludes().aliases().urlRelations(); |
60 | * \endcode |
61 | */ |
62 | class MB_API ArtistIncludes : public IIncludes |
63 | { |
64 | public: |
65 | //! Include aliases. |
66 | ArtistIncludes &aliases(); |
67 | //! Include releases of speficied type. |
68 | ArtistIncludes &releases(const std::string &type); |
69 | //! Include VA releases of speficied type. |
70 | ArtistIncludes &vaReleases(const std::string &type); |
71 | //! Include release events for included releases. |
72 | ArtistIncludes &releaseEvents(); |
73 | //! Include artist relations. |
74 | ArtistIncludes &artistRelations(); |
75 | //! Include label relations. |
76 | ArtistIncludes &labelRelations(); |
77 | //! Include release relations. |
78 | ArtistIncludes &releaseRelations(); |
79 | //! Include track relations. |
80 | ArtistIncludes &trackRelations(); |
81 | //! Include URL relations. |
82 | ArtistIncludes &urlRelations(); |
83 | //! Include ratings. |
84 | ArtistIncludes &ratings(); |
85 | //! Include tags. |
86 | ArtistIncludes &tags(); |
87 | IncludeList createIncludeTags() const; |
88 | private: |
89 | IncludeList includes; |
90 | }; |
91 | |
92 | /** |
93 | * A specification on how much data to return with a label. |
94 | * |
95 | * This implementation uses \e method \e chaining to define list of includes. |
96 | * |
97 | * Example usage: |
98 | * \code |
99 | * LabelIncludes inc = LabelIncludes().aliases().urlRelations(); |
100 | * \endcode |
101 | */ |
102 | class MB_API LabelIncludes : public IIncludes |
103 | { |
104 | public: |
105 | //! Include aliases. |
106 | LabelIncludes &aliases(); |
107 | //! Include artist relations. |
108 | LabelIncludes &artistRelations(); |
109 | //! Include label relations. |
110 | LabelIncludes &labelRelations(); |
111 | //! Include release relations. |
112 | LabelIncludes &releaseRelations(); |
113 | //! Include track relations. |
114 | LabelIncludes &trackRelations(); |
115 | //! Include URL relations. |
116 | LabelIncludes &urlRelations(); |
117 | //! Include ratings. |
118 | LabelIncludes &ratings(); |
119 | //! Include tags. |
120 | LabelIncludes &tags(); |
121 | IncludeList createIncludeTags() const; |
122 | private: |
123 | IncludeList includes; |
124 | }; |
125 | |
126 | /** |
127 | * A specification on how much data to return with a release. |
128 | * |
129 | * This implementation uses \e method \e chaining to define list of includes. |
130 | * |
131 | * Example usage: |
132 | * \code |
133 | * ReleaseIncludes inc = ReleaseIncludes().releaseEvents().disc(); |
134 | * \endcode |
135 | */ |
136 | class MB_API ReleaseIncludes : public IIncludes |
137 | { |
138 | public: |
139 | //! Include artist. |
140 | ReleaseIncludes &artist(); |
141 | //! Include counts. |
142 | ReleaseIncludes &counts(); |
143 | //! Include release events. |
144 | ReleaseIncludes &releaseEvents(); |
145 | //! Include discs. |
146 | ReleaseIncludes &discs(); |
147 | //! Include tracks. |
148 | ReleaseIncludes &tracks(); |
149 | //! Include artist relations. |
150 | ReleaseIncludes &artistRelations(); |
151 | //! Include label relations. |
152 | ReleaseIncludes &labelRelations(); |
153 | //! Include release relations. |
154 | ReleaseIncludes &releaseRelations(); |
155 | //! Include track relations. |
156 | ReleaseIncludes &trackRelations(); |
157 | //! Include URL relations. |
158 | ReleaseIncludes &urlRelations(); |
159 | //! Include ISRCs. |
160 | ReleaseIncludes &isrcs(); |
161 | //! Include ratings. |
162 | ReleaseIncludes &ratings(); |
163 | //! Include tags. |
164 | ReleaseIncludes &tags(); |
165 | IncludeList createIncludeTags() const; |
166 | private: |
167 | IncludeList includes; |
168 | }; |
169 | |
170 | /** |
171 | * A specification on how much data to return with a release group. |
172 | * |
173 | * This implementation uses \e method \e chaining to define list of includes. |
174 | * |
175 | * Example usage: |
176 | * \code |
177 | * ReleaseGroupIncludes inc = ReleaseGroupIncludes().releaseEvents().disc(); |
178 | * \endcode |
179 | */ |
180 | class MB_API ReleaseGroupIncludes : public IIncludes |
181 | { |
182 | public: |
183 | //! Include artist. |
184 | ReleaseGroupIncludes &artist(); |
185 | //! Include release events. |
186 | ReleaseGroupIncludes &releases(); |
187 | IncludeList createIncludeTags() const; |
188 | private: |
189 | IncludeList includes; |
190 | }; |
191 | |
192 | /** |
193 | * A specification on how much data to return with a track. |
194 | * |
195 | * This implementation uses \e method \e chaining to define list of includes. |
196 | * |
197 | * Example usage: |
198 | * \code |
199 | * TrackIncludes inc = TrackIncludes().artist().puids().trackRelations(); |
200 | * \endcode |
201 | */ |
202 | class MB_API TrackIncludes : public IIncludes |
203 | { |
204 | public: |
205 | //! Include artist. |
206 | TrackIncludes &artist(); |
207 | //! Include releases. |
208 | TrackIncludes &releases(); |
209 | //! Include PUIDs. |
210 | TrackIncludes &puids(); |
211 | //! Include artist relations. |
212 | TrackIncludes &artistRelations(); |
213 | //! Include label relations. |
214 | TrackIncludes &labelRelations(); |
215 | //! Include release relations. |
216 | TrackIncludes &releaseRelations(); |
217 | //! Include track relations. |
218 | TrackIncludes &trackRelations(); |
219 | //! Include URL relations. |
220 | TrackIncludes &urlRelations(); |
221 | //! Include ISRCs. |
222 | TrackIncludes &isrcs(); |
223 | //! Include ratings. |
224 | TrackIncludes &ratings(); |
225 | //! Include tags. |
226 | TrackIncludes &tags(); |
227 | IncludeList createIncludeTags() const; |
228 | private: |
229 | IncludeList includes; |
230 | }; |
231 | |
232 | } |
233 | |
234 | #endif |
235 | |