1
/***************************************************************************
2
copyright : (C) 2004 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>
38
//! An ID3v2 general encapsulated object frame implementation
41
* This is an implementation of ID3v2 general encapsulated objects.
42
* Arbitrary binary data may be included in tags, stored in GEOB frames.
43
* There may be multiple GEOB frames in a single tag. Each GEOB it
44
* labelled with a content description (which may be blank), a required
45
* mime-type, and a file name (may be blank). The content description
46
* uniquely identifies the GEOB frame in the tag.
49
class GeneralEncapsulatedObjectFrame : public Frame
51
friend class FrameFactory;
56
* Constructs an empty object frame. The description, file name and text
57
* encoding should be set manually.
59
GeneralEncapsulatedObjectFrame();
62
* Constructs a GeneralEncapsulatedObjectFrame frame based on \a data.
64
explicit GeneralEncapsulatedObjectFrame(const ByteVector &data);
67
* Destroys the GeneralEncapsulatedObjectFrame instance.
69
virtual ~GeneralEncapsulatedObjectFrame();
72
* Returns a string containing the description, file name and mime-type
74
virtual String toString() const;
77
* Returns the text encoding used for the description and file name.
79
* \see setTextEncoding()
83
String::Type textEncoding() const;
86
* Set the text encoding used for the description and file name.
91
void setTextEncoding(String::Type encoding);
94
* Returns the mime type of the object.
96
String mimeType() const;
99
* Sets the mime type of the object.
101
void setMimeType(const String &type);
104
* Returns the file name of the object.
108
String fileName() const;
111
* Sets the file name for the object.
115
void setFileName(const String &name);
118
* Returns the content description of the object.
120
* \see setDescription()
121
* \see textEncoding()
122
* \see setTextEncoding()
125
String description() const;
128
* Sets the content description of the object to \a desc.
131
* \see textEncoding()
132
* \see setTextEncoding()
135
void setDescription(const String &desc);
138
* Returns the object data as a ByteVector.
140
* \note ByteVector has a data() method that returns a const char * which
141
* should make it easy to export this data to external programs.
146
ByteVector object() const;
149
* Sets the object data to \a data. \a data should be of the type specified in
150
* this frame's mime-type specification.
156
void setObject(const ByteVector &object);
159
virtual void parseFields(const ByteVector &data);
160
virtual ByteVector renderFields() const;
163
GeneralEncapsulatedObjectFrame(const ByteVector &data, Header *h);
164
GeneralEncapsulatedObjectFrame(const GeneralEncapsulatedObjectFrame &);
165
GeneralEncapsulatedObjectFrame &operator=(const GeneralEncapsulatedObjectFrame &);
167
class GeneralEncapsulatedObjectFramePrivate;
168
GeneralEncapsulatedObjectFramePrivate *d;