TagLib  2.0.2
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 #include "id3v2frame.h"
33 
34 namespace TagLib {
35 
36  namespace ID3v2 {
37 
38  class Tag;
40 
42 
106  {
107  friend class FrameFactory;
108 
109  public:
119  TextIdentificationFrame(const ByteVector &type, String::Type encoding);
120 
125  explicit TextIdentificationFrame(const ByteVector &data);
126 
132  static TextIdentificationFrame *createTIPLFrame(const PropertyMap &properties);
133 
140  static TextIdentificationFrame *createTMCLFrame(const PropertyMap &properties);
144  ~TextIdentificationFrame() override;
145 
147  TextIdentificationFrame &operator=(const TextIdentificationFrame &) = delete;
148 
159  void setText(const StringList &l);
160 
161  // Reimplementations.
162 
163  void setText(const String &s) override;
164  String toString() const override;
165  StringList toStringList() const override;
166 
177  String::Type textEncoding() const;
178 
188  void setTextEncoding(String::Type encoding);
189 
193  StringList fieldList() const;
194 
199  static const KeyConversionMap &involvedPeopleMap();
200 
201  PropertyMap asProperties() const override;
202 
203  protected:
204  // Reimplementations.
205 
206  void parseFields(const ByteVector &data) override;
207  ByteVector renderFields() const override;
208 
212  TextIdentificationFrame(const ByteVector &data, Header *h);
213 
214  private:
220  PropertyMap makeTIPLProperties() const;
224  PropertyMap makeTMCLProperties() const;
225  class TextIdentificationFramePrivate;
227  std::unique_ptr<TextIdentificationFramePrivate> d;
228  };
229 
238 
241  {
242  friend class FrameFactory;
243 
244  public:
250 
254  explicit UserTextIdentificationFrame(const ByteVector &data);
255 
260  UserTextIdentificationFrame(const String &description, const StringList &values, String::Type encoding = String::UTF8);
261 
262  ~UserTextIdentificationFrame() override;
263 
265  UserTextIdentificationFrame &operator=(const UserTextIdentificationFrame &) = delete;
266 
267  String toString() const override;
268 
272  String description() const;
273 
279  void setDescription(const String &s);
280 
281  void setText(const String &text) override;
282  void setText(const StringList &fields);
283 
297  PropertyMap asProperties() const override;
298 
303  static UserTextIdentificationFrame *find(const Tag *tag, const String &description);
304 
308  static String keyToTXXX(const String &);
309 
313  static String txxxToKey(const String &);
314 
315  private:
317 
318  void checkFields();
319 
320  class UserTextIdentificationFramePrivate;
322  std::unique_ptr<UserTextIdentificationFramePrivate> d;
323  };
324 
325  } // namespace ID3v2
326 } // namespace TagLib
327 #endif
A map for format-independent <key,values> tag representations.
Definition: tpropertymap.h:122
An implementation of ID3v2 headers.
Definition: id3v2header.h:48
A wide string class suitable for unicode.
Definition: tstring.h:82
An ID3v2 text identification frame implementation.
Definition: textidentificationframe.h:105
A byte vector.
Definition: tbytevector.h:45
A factory for creating ID3v2 frames during parsing.
Definition: id3v2framefactory.h:67
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55
A generic, implicitly shared map.
Definition: tmap.h:44
A list of strings.
Definition: tstringlist.h:43
ID3v2 frame implementation.
Definition: id3v2frame.h:56
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
An ID3v2 custom text identification frame implementation.
Definition: textidentificationframe.h:240
The main class in the ID3v2 implementation.
Definition: id3v2tag.h:133
Type
Definition: tstring.h:96
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
Definition: tstring.h:100
Definition: tstring.h:113