1 /***************************************************************************
2 copyright : (C) 2002 - 2008 by Scott Wheeler
3 email : wheeler@kde.org
4 copyright : (C) 2006 by Aaron VonderHaar
5 email : avh4@users.sourceforge.net
6 ***************************************************************************/
8 /***************************************************************************
9 * This library is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU Lesser General Public License version *
11 * 2.1 as published by the Free Software Foundation. *
13 * This library is distributed in the hope that it will be useful, but *
14 * WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
23 * Alternatively, this file is available under the Mozilla Public *
24 * License Version 1.1. You may obtain a copy of the License at *
25 * http://www.mozilla.org/MPL/ *
26 ***************************************************************************/
28 #ifndef TAGLIB_GENERALENCAPSULATEDOBJECT_H
29 #define TAGLIB_GENERALENCAPSULATEDOBJECT_H
31 #include "id3v2frame.h"
32 #include "id3v2header.h"
33 #include "taglib_export.h"
39 //! An ID3v2 general encapsulated object frame implementation
42 * This is an implementation of ID3v2 general encapsulated objects.
43 * Arbitrary binary data may be included in tags, stored in GEOB frames.
44 * There may be multiple GEOB frames in a single tag. Each GEOB it
45 * labelled with a content description (which may be blank), a required
46 * mime-type, and a file name (may be blank). The content description
47 * uniquely identifies the GEOB frame in the tag.
50 class TAGLIB_EXPORT GeneralEncapsulatedObjectFrame : public Frame
52 friend class FrameFactory;
57 * Constructs an empty object frame. The description, file name and text
58 * encoding should be set manually.
60 GeneralEncapsulatedObjectFrame();
63 * Constructs a GeneralEncapsulatedObjectFrame frame based on \a data.
65 * \warning This is \em not data for the encapsulated object, for that use
66 * setObject(). This constructor is used when reading the frame from the
69 explicit GeneralEncapsulatedObjectFrame(const ByteVector &data);
72 * Destroys the GeneralEncapsulatedObjectFrame instance.
74 virtual ~GeneralEncapsulatedObjectFrame();
77 * Returns a string containing the description, file name and mime-type
79 virtual String toString() const;
82 * Returns the text encoding used for the description and file name.
84 * \see setTextEncoding()
88 String::Type textEncoding() const;
91 * Set the text encoding used for the description and file name.
96 void setTextEncoding(String::Type encoding);
99 * Returns the mime type of the object.
101 String mimeType() const;
104 * Sets the mime type of the object.
106 void setMimeType(const String &type);
109 * Returns the file name of the object.
113 String fileName() const;
116 * Sets the file name for the object.
120 void setFileName(const String &name);
123 * Returns the content description of the object.
125 * \see setDescription()
126 * \see textEncoding()
127 * \see setTextEncoding()
130 String description() const;
133 * Sets the content description of the object to \a desc.
136 * \see textEncoding()
137 * \see setTextEncoding()
140 void setDescription(const String &desc);
143 * Returns the object data as a ByteVector.
145 * \note ByteVector has a data() method that returns a const char * which
146 * should make it easy to export this data to external programs.
151 ByteVector object() const;
154 * Sets the object data to \a data. \a data should be of the type specified in
155 * this frame's mime-type specification.
161 void setObject(const ByteVector &object);
164 virtual void parseFields(const ByteVector &data);
165 virtual ByteVector renderFields() const;
168 GeneralEncapsulatedObjectFrame(const ByteVector &data, Header *h);
169 GeneralEncapsulatedObjectFrame(const GeneralEncapsulatedObjectFrame &);
170 GeneralEncapsulatedObjectFrame &operator=(const GeneralEncapsulatedObjectFrame &);
172 class GeneralEncapsulatedObjectFramePrivate;
173 GeneralEncapsulatedObjectFramePrivate *d;