| TagLib 1.13 |  |

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
238
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:
301 UserTextIdentificationFrame(const ByteVector &data, Header *h);
302 UserTextIdentificationFrame(const TextIdentificationFrame &);
303 UserTextIdentificationFrame &operator=(const UserTextIdentificationFrame &);
304
305 void checkFields();
306
307 class UserTextIdentificationFramePrivate;
308 UserTextIdentificationFramePrivate *d;
309 };
310
311 }
312}
313#endif
TagLib::ByteVector
A byte vector.
Definition: tbytevector.h:46
TagLib::ID3v2::FrameFactory
A factory for creating ID3v2 frames during parsing.
Definition: id3v2framefactory.h:66
TagLib::ID3v2::Frame
ID3v2 frame implementation.
Definition: id3v2frame.h:55
TagLib::ID3v2::Header
An implementation of ID3v2 headers.
Definition: id3v2header.h:49
TagLib::ID3v2::Tag
The main class in the ID3v2 implementation.
Definition: id3v2tag.h:128
TagLib::ID3v2::TextIdentificationFrame
An ID3v2 text identification frame implementation.
Definition: textidentificationframe.h:107
TagLib::ID3v2::TextIdentificationFrame::renderFields
virtual ByteVector renderFields() const
TagLib::ID3v2::TextIdentificationFrame::setTextEncoding
void setTextEncoding(String::Type encoding)
TagLib::ID3v2::TextIdentificationFrame::setText
void setText(const StringList &l)
TagLib::ID3v2::TextIdentificationFrame::~TextIdentificationFrame
virtual ~TextIdentificationFrame()
TagLib::ID3v2::TextIdentificationFrame::toString
virtual String toString() const
TagLib::ID3v2::TextIdentificationFrame::TextIdentificationFrame
TextIdentificationFrame(const ByteVector &data, Header *h)
TagLib::ID3v2::TextIdentificationFrame::TextIdentificationFrame
TextIdentificationFrame(const ByteVector &data)
TagLib::ID3v2::TextIdentificationFrame::fieldList
StringList fieldList() const
TagLib::ID3v2::TextIdentificationFrame::parseFields
virtual void parseFields(const ByteVector &data)
TagLib::ID3v2::TextIdentificationFrame::textEncoding
String::Type textEncoding() const
TagLib::ID3v2::TextIdentificationFrame::setText
virtual void setText(const String &s)
TagLib::ID3v2::TextIdentificationFrame::createTMCLFrame
static TextIdentificationFrame * createTMCLFrame(const PropertyMap &properties)
TagLib::ID3v2::TextIdentificationFrame::asProperties
PropertyMap asProperties() const
TagLib::ID3v2::TextIdentificationFrame::createTIPLFrame
static TextIdentificationFrame * createTIPLFrame(const PropertyMap &properties)
TagLib::ID3v2::TextIdentificationFrame::involvedPeopleMap
static const KeyConversionMap & involvedPeopleMap()
TagLib::ID3v2::TextIdentificationFrame::TextIdentificationFrame
TextIdentificationFrame(const ByteVector &type, String::Type encoding)
TagLib::ID3v2::UserTextIdentificationFrame
An ID3v2 custom text identification frame implementation.
Definition: textidentificationframe.h:240
TagLib::ID3v2::UserTextIdentificationFrame::UserTextIdentificationFrame
UserTextIdentificationFrame(const String &description, const StringList &values, String::Type encoding=String::UTF8)
TagLib::ID3v2::UserTextIdentificationFrame::asProperties
PropertyMap asProperties() const
TagLib::ID3v2::UserTextIdentificationFrame::setText
void setText(const StringList &fields)
TagLib::ID3v2::UserTextIdentificationFrame::find
static UserTextIdentificationFrame * find(Tag *tag, const String &description)
TagLib::ID3v2::UserTextIdentificationFrame::setDescription
void setDescription(const String &s)
TagLib::ID3v2::UserTextIdentificationFrame::toString
virtual String toString() const
TagLib::ID3v2::UserTextIdentificationFrame::UserTextIdentificationFrame
UserTextIdentificationFrame(const ByteVector &data)
TagLib::ID3v2::UserTextIdentificationFrame::fieldList
StringList fieldList() const
TagLib::ID3v2::UserTextIdentificationFrame::setText
void setText(const String &text)
TagLib::ID3v2::UserTextIdentificationFrame::description
String description() const
TagLib::ID3v2::UserTextIdentificationFrame::UserTextIdentificationFrame
UserTextIdentificationFrame(String::Type encoding=String::Latin1)
TagLib::Map
A generic, implicitly shared map.
Definition: tmap.h:44
TagLib::PropertyMap
A map for format-independent <key,valuelist> tag representations.
Definition: tpropertymap.h:119
TagLib::StringList
A list of strings.
Definition: tstringlist.h:46
TagLib::String
A wide string class suitable for unicode.
Definition: tstring.h:85
TagLib::String::Type
Type
Definition: tstring.h:97
TagLib::String::Latin1
@ Latin1
Definition: tstring.h:101
TagLib::String::UTF8
@ UTF8
Definition: tstring.h:114
id3v2frame.h
TagLib::ID3v2::KeyConversionMap
Map< String, String > KeyConversionMap
Definition: textidentificationframe.h:39
TagLib
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
taglib_export.h
TAGLIB_EXPORT
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
tmap.h
tstringlist.h