TagLib 1.11.1 (textidentificationframe.h Source File)

textidentificationframe.h
Go to the documentation of this file.
1 /***************************************************************************
2  copyright : (C) 2002 - 2008 by Scott Wheeler
3  email : wheeler@kde.org
4  ***************************************************************************/
5 
6 /***************************************************************************
7  * This library is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU Lesser General Public License version *
9  * 2.1 as published by the Free Software Foundation. *
10  * *
11  * This library is distributed in the hope that it will be useful, but *
12  * 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 *
19  * 02110-1301 USA *
20  * *
21  * Alternatively, this file is available under the Mozilla Public *
22  * License Version 1.1. You may obtain a copy of the License at *
23  * http://www.mozilla.org/MPL/ *
24  ***************************************************************************/
25 
26 #ifndef TAGLIB_TEXTIDENTIFICATIONFRAME_H
27 #define TAGLIB_TEXTIDENTIFICATIONFRAME_H
28 
29 #include "tstringlist.h"
30 #include "tmap.h"
31 #include "taglib_export.h"
32 
33 #include "id3v2frame.h"
34 
35 namespace TagLib {
36 
37  namespace ID3v2 {
38 
39  class Tag;
40  typedef Map<String, String> KeyConversionMap;
41 
43 
106  class TAGLIB_EXPORT TextIdentificationFrame : public Frame
107  {
108  friend class FrameFactory;
109 
110  public:
120  TextIdentificationFrame(const ByteVector &type, String::Type encoding);
121 
126  explicit TextIdentificationFrame(const ByteVector &data);
127 
133  static TextIdentificationFrame *createTIPLFrame(const PropertyMap &properties);
134 
141  static TextIdentificationFrame *createTMCLFrame(const PropertyMap &properties);
145  virtual ~TextIdentificationFrame();
146 
157  void setText(const StringList &l);
158 
159  // Reimplementations.
160 
161  virtual void setText(const String &s);
162  virtual String toString() const;
163 
174  String::Type textEncoding() const;
175 
185  void setTextEncoding(String::Type encoding);
186 
190  StringList fieldList() const;
191 
196  static const KeyConversionMap &involvedPeopleMap();
197 
198  PropertyMap asProperties() const;
199 
200  protected:
201  // Reimplementations.
202 
203  virtual void parseFields(const ByteVector &data);
204  virtual ByteVector renderFields() const;
205 
209  TextIdentificationFrame(const ByteVector &data, Header *h);
210 
211  private:
212  TextIdentificationFrame(const TextIdentificationFrame &);
213  TextIdentificationFrame &operator=(const TextIdentificationFrame &);
214 
220  PropertyMap makeTIPLProperties() const;
224  PropertyMap makeTMCLProperties() const;
225  class TextIdentificationFramePrivate;
226  TextIdentificationFramePrivate *d;
227  };
228 
237 
239  class TAGLIB_EXPORT UserTextIdentificationFrame : public TextIdentificationFrame
240  {
241  friend class FrameFactory;
242 
243  public:
248  explicit UserTextIdentificationFrame(String::Type encoding = String::Latin1);
249 
253  explicit UserTextIdentificationFrame(const ByteVector &data);
254 
259  UserTextIdentificationFrame(const String &description, const StringList &values, String::Type encoding = String::UTF8);
260 
261  virtual String toString() const;
262 
266  String description() const;
267 
273  void setDescription(const String &s);
274 
275  StringList fieldList() const;
276  void setText(const String &text);
277  void setText(const StringList &fields);
278 
292  PropertyMap asProperties() const;
293 
298  static UserTextIdentificationFrame *find(Tag *tag, const String &description);
299 
300  private:
304 
305  void checkFields();
306 
307  class UserTextIdentificationFramePrivate;
308  UserTextIdentificationFramePrivate *d;
309  };
310 
311  }
312 }
313 #endif
Map< String, String > KeyConversionMap
Definition: textidentificationframe.h:75
A list of strings.
Definition: tstringlist.h:62
An ID3v2 custom text identification frame implementation.
Definition: textidentificationframe.h:275
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
The main class in the ID3v2 implementation.
Definition: id3v2tag.h:154
Type
Definition: tstring.h:95
Definition: tstring.h:112
A map for format-independent <key,valuelist> tag representations.
Definition: tpropertymap.h:127
Definition: tstring.h:99
A byte vector.
Definition: tbytevector.h:64
An ID3v2 text identification frame implementation.
Definition: textidentificationframe.h:142
#define TAGLIB_EXPORT
Definition: taglib_export.h:38
An implementation of ID3v2 headers.
Definition: id3v2header.h:83
A wide string class suitable for unicode.
Definition: tstring.h:82