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 explicit GeneralEncapsulatedObjectFrame(const ByteVector &data);
68 * Destroys the GeneralEncapsulatedObjectFrame instance.
70 virtual ~GeneralEncapsulatedObjectFrame();
73 * Returns a string containing the description, file name and mime-type
75 virtual String toString() const;
78 * Returns the text encoding used for the description and file name.
80 * \see setTextEncoding()
84 String::Type textEncoding() const;
87 * Set the text encoding used for the description and file name.
92 void setTextEncoding(String::Type encoding);
95 * Returns the mime type of the object.
97 String mimeType() const;
100 * Sets the mime type of the object.
102 void setMimeType(const String &type);
105 * Returns the file name of the object.
109 String fileName() const;
112 * Sets the file name for the object.
116 void setFileName(const String &name);
119 * Returns the content description of the object.
121 * \see setDescription()
122 * \see textEncoding()
123 * \see setTextEncoding()
126 String description() const;
129 * Sets the content description of the object to \a desc.
132 * \see textEncoding()
133 * \see setTextEncoding()
136 void setDescription(const String &desc);
139 * Returns the object data as a ByteVector.
141 * \note ByteVector has a data() method that returns a const char * which
142 * should make it easy to export this data to external programs.
147 ByteVector object() const;
150 * Sets the object data to \a data. \a data should be of the type specified in
151 * this frame's mime-type specification.
157 void setObject(const ByteVector &object);
160 virtual void parseFields(const ByteVector &data);
161 virtual ByteVector renderFields() const;
164 GeneralEncapsulatedObjectFrame(const ByteVector &data, Header *h);
165 GeneralEncapsulatedObjectFrame(const GeneralEncapsulatedObjectFrame &);
166 GeneralEncapsulatedObjectFrame &operator=(const GeneralEncapsulatedObjectFrame &);
168 class GeneralEncapsulatedObjectFramePrivate;
169 GeneralEncapsulatedObjectFramePrivate *d;