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 #include "TypeInformation.h"
18 
19 #include <QStringList>
20 
21 namespace Echonest {
22 
23 class ArtistInformationPrivate
24 {
25 public:
26 
ArtistInformationPrivate()27     ArtistInformationPrivate() : flags( ArtistInformation::NoInformation )
28     {}
29 
30     Echonest::ArtistInformation::ArtistInformationFlags flags;
31     QStringList idSpaces;
32 };
33 
34 class SongInformationPrivate
35 {
36 public:
37 
SongInformationPrivate()38     SongInformationPrivate() : flags( SongInformation::NoInformation )
39     {}
40 
41     SongInformation::SongInformationFlags flags;
42     QStringList idSpaces;
43 };
44 
45 class GenreInformationPrivate
46 {
47 public:
48 
GenreInformationPrivate()49     GenreInformationPrivate() : flags( GenreInformation::NoInformation )
50     {}
51 
52     GenreInformation::GenreInformationFlags flags;
53 };
54 
55 } // namespace
ArtistInformation()56 Echonest::ArtistInformation::ArtistInformation()
57     : d_ptr( new Echonest::ArtistInformationPrivate )
58 {
59     Q_D( ArtistInformation );
60     d->flags = Echonest::ArtistInformation::NoInformation;
61 }
62 
63 
ArtistInformation(ArtistInformationFlags flags)64 Echonest::ArtistInformation::ArtistInformation( ArtistInformationFlags flags )
65 : d_ptr( new Echonest::ArtistInformationPrivate )
66 {
67     Q_D( ArtistInformation );
68     d->flags = flags;
69 }
70 
ArtistInformation(ArtistInformation::ArtistInformationFlags flags,const QStringList & idSpaces)71 Echonest::ArtistInformation::ArtistInformation( ArtistInformation::ArtistInformationFlags flags, const QStringList& idSpaces )
72     : d_ptr( new Echonest::ArtistInformationPrivate )
73 {
74     Q_D( Echonest::ArtistInformation );
75     d->flags = flags;
76     d->idSpaces = idSpaces;
77 }
78 
ArtistInformation(const Echonest::ArtistInformation & other)79 Echonest::ArtistInformation::ArtistInformation( const Echonest::ArtistInformation& other )
80     : d_ptr( new Echonest::ArtistInformationPrivate( *other.d_ptr ) )
81 {
82 }
83 
~ArtistInformation()84 Echonest::ArtistInformation::~ArtistInformation()
85 {
86     delete d_ptr;
87 }
operator =(const Echonest::ArtistInformation & typeInfo)88 Echonest::ArtistInformation& Echonest::ArtistInformation::operator=( const Echonest::ArtistInformation& typeInfo )
89 {
90     d_ptr = new Echonest::ArtistInformationPrivate( *typeInfo.d_ptr );
91     return *this;
92 }
93 
flags() const94 Echonest::ArtistInformation::ArtistInformationFlags Echonest::ArtistInformation::flags() const
95 {
96     Q_D( const Echonest::ArtistInformation );
97 
98     return d->flags;
99 }
100 
setArtistInformationFlags(ArtistInformationFlags flags)101 void Echonest::ArtistInformation::setArtistInformationFlags( ArtistInformationFlags flags)
102 {
103     Q_D( Echonest::ArtistInformation );
104 
105     d->flags = flags;
106 }
107 
idSpaces() const108 QStringList Echonest::ArtistInformation::idSpaces() const
109 {
110     Q_D( const Echonest::ArtistInformation );
111 
112     return d->idSpaces;
113 }
114 
setIdSpaces(const QStringList & idspaces)115 void Echonest::ArtistInformation::setIdSpaces(const QStringList& idspaces)
116 {
117     Q_D( Echonest::ArtistInformation );
118 
119     d->idSpaces = idspaces;
120 }
121 
SongInformation()122 Echonest::SongInformation::SongInformation()
123     : d_ptr( new Echonest::SongInformationPrivate )
124 {
125     Q_D( Echonest::SongInformation );
126 
127     d->flags = Echonest::SongInformation::NoInformation;
128 }
129 
SongInformation(SongInformationFlags flags)130 Echonest::SongInformation::SongInformation( SongInformationFlags flags )
131     : d_ptr( new Echonest::SongInformationPrivate )
132 {
133     Q_D( SongInformation );
134 
135     d->flags = flags;
136 }
137 
SongInformation(SongInformation::SongInformationFlags flags,const QStringList & idSpaces)138 Echonest::SongInformation::SongInformation( SongInformation::SongInformationFlags flags, const QStringList& idSpaces )
139     : d_ptr( new Echonest::SongInformationPrivate )
140 {
141     Q_D( Echonest::SongInformation );
142 
143     d->flags = flags;
144     d->idSpaces = idSpaces;
145 }
146 
SongInformation(const Echonest::SongInformation & other)147 Echonest::SongInformation::SongInformation( const Echonest::SongInformation& other )
148     : d_ptr( new Echonest::SongInformationPrivate( *other.d_ptr ) )
149 {
150 
151 }
152 
~SongInformation()153 Echonest::SongInformation::~SongInformation()
154 {
155     delete d_ptr;
156 }
157 
operator =(const Echonest::SongInformation & info)158 Echonest::SongInformation& Echonest::SongInformation::operator=( const Echonest::SongInformation& info )
159 {
160     d_ptr = new Echonest::SongInformationPrivate( *info.d_ptr );
161 
162     return *this;
163 }
164 
165 
flags() const166 Echonest::SongInformation::SongInformationFlags Echonest::SongInformation::flags() const
167 {
168     Q_D( const Echonest::SongInformation );
169 
170     return d->flags;
171 }
172 
setSongInformationFlags(SongInformationFlags flags)173 void Echonest::SongInformation::setSongInformationFlags( SongInformationFlags flags )
174 {
175     Q_D( Echonest::SongInformation );
176 
177     d->flags = flags;
178 }
179 
idSpaces() const180 QStringList Echonest::SongInformation::idSpaces() const
181 {
182     Q_D( const Echonest::SongInformation );
183 
184     return d->idSpaces;
185 }
186 
setIdSpaces(const QStringList & idspaces)187 void Echonest::SongInformation::setIdSpaces(const QStringList& idspaces)
188 {
189     Q_D( Echonest::SongInformation );
190 
191     d->idSpaces = idspaces;
192 }
193 
GenreInformation()194 Echonest::GenreInformation::GenreInformation()
195     : d_ptr( new Echonest::GenreInformationPrivate )
196 {
197     Q_D( Echonest::GenreInformation );
198 
199     d->flags = Echonest::GenreInformation::NoInformation;
200 }
201 
GenreInformation(GenreInformationFlags flags)202 Echonest::GenreInformation::GenreInformation( GenreInformationFlags flags )
203     : d_ptr( new Echonest::GenreInformationPrivate )
204 {
205     Q_D( GenreInformation );
206 
207     d->flags = flags;
208 }
209 
GenreInformation(const Echonest::GenreInformation & other)210 Echonest::GenreInformation::GenreInformation( const Echonest::GenreInformation& other )
211     : d_ptr( new Echonest::GenreInformationPrivate( *other.d_ptr ) )
212 {
213 
214 }
215 
~GenreInformation()216 Echonest::GenreInformation::~GenreInformation()
217 {
218     delete d_ptr;
219 }
220 
operator =(const Echonest::GenreInformation & info)221 Echonest::GenreInformation& Echonest::GenreInformation::operator=( const Echonest::GenreInformation& info )
222 {
223     d_ptr = new Echonest::GenreInformationPrivate( *info.d_ptr );
224 
225     return *this;
226 }
227 
228 
flags() const229 Echonest::GenreInformation::GenreInformationFlags Echonest::GenreInformation::flags() const
230 {
231     Q_D( const Echonest::GenreInformation );
232 
233     return d->flags;
234 }
235 
setGenreInformationFlags(GenreInformationFlags flags)236 void Echonest::GenreInformation::setGenreInformationFlags( GenreInformationFlags flags )
237 {
238     Q_D( Echonest::GenreInformation );
239 
240     d->flags = flags;
241 }
242