TagLib  2.0.2
attachedpictureframe.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_ATTACHEDPICTUREFRAME_H
27 #define TAGLIB_ATTACHEDPICTUREFRAME_H
28 
29 #include "taglib_export.h"
30 #include "tpicturetype.h"
31 #include "id3v2frame.h"
32 
33 namespace TagLib {
34 
35  namespace ID3v2 {
36 
38 
47  {
48  friend class FrameFactory;
49 
50  public:
51 
52  /*
53  * This describes the function or content of the picture.
54  */
55  DECLARE_PICTURE_TYPE_ENUM(Type)
56 
57 
62 
66  explicit AttachedPictureFrame(const ByteVector &data);
67 
71  ~AttachedPictureFrame() override;
72 
74  AttachedPictureFrame &operator=(const AttachedPictureFrame &) = delete;
75 
79  String toString() const override;
80 
84  StringList toStringList() const override;
85 
92  String::Type textEncoding() const;
93 
99  void setTextEncoding(String::Type t);
100 
105  String mimeType() const;
106 
111  void setMimeType(const String &m);
112 
119  Type type() const;
120 
127  void setType(Type t);
128 
137  String description() const;
138 
147  void setDescription(const String &desc);
148 
158  ByteVector picture() const;
159 
168  void setPicture(const ByteVector &p);
169 
170  protected:
171  void parseFields(const ByteVector &data) override;
172  ByteVector renderFields() const override;
173  class AttachedPictureFramePrivate;
175  std::unique_ptr<AttachedPictureFramePrivate> d;
176 
177  private:
178  AttachedPictureFrame(const ByteVector &data, Header *h);
179  };
180 
183  {
184  protected:
185  void parseFields(const ByteVector &data) override;
186  private:
187  AttachedPictureFrameV22(const ByteVector &data, Header *h);
188  friend class FrameFactory;
189  };
190  } // namespace ID3v2
191 } // namespace TagLib
192 
193 #endif
An ID3v2 attached picture frame implementation.
Definition: attachedpictureframe.h:46
An implementation of ID3v2 headers.
Definition: id3v2header.h:48
A wide string class suitable for unicode.
Definition: tstring.h:82
A byte vector.
Definition: tbytevector.h:45
A factory for creating ID3v2 frames during parsing.
Definition: id3v2framefactory.h:67
support for ID3v2.2 PIC frames
Definition: attachedpictureframe.h:182
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55
A list of strings.
Definition: tstringlist.h:43
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE std::unique_ptr< AttachedPictureFramePrivate > d
Definition: attachedpictureframe.h:173
ID3v2 frame implementation.
Definition: id3v2frame.h:56
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
Type
Definition: tstring.h:96
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41