1
/***************************************************************************
2
copyright : (C) 2002, 2003 by Scott Wheeler
3
email : wheeler@kde.org
4
copyright : (C) 2006 by Urs Fleisch
5
email : ufleisch@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 *
22
***************************************************************************/
24
#ifndef TAGLIB_URLLINKFRAME_H
25
#define TAGLIB_URLLINKFRAME_H
27
#include <id3v2frame.h>
34
* An implementation of ID3v2 URL link frames.
36
class UrlLinkFrame : public Frame {
37
friend class FrameFactory;
41
* This is a dual purpose constructor. \a data can either be binary data
42
* that should be parsed or (at a minimum) the frame ID.
44
explicit UrlLinkFrame(const ByteVector &data);
47
* Destroys this UrlLinkFrame instance.
49
virtual ~UrlLinkFrame();
54
virtual String url() const;
57
* Sets the URL to \a s.
59
virtual void setUrl(const String &s);
63
virtual void setText(const String &s);
64
virtual String toString() const;
67
virtual void parseFields(const ByteVector &data);
68
virtual ByteVector renderFields() const;
71
* The constructor used by the FrameFactory.
73
UrlLinkFrame(const ByteVector &data, Header *h);
76
UrlLinkFrame(const UrlLinkFrame &);
77
UrlLinkFrame &operator=(const UrlLinkFrame &);
79
class UrlLinkFramePrivate;
80
UrlLinkFramePrivate *d;
84
* This is a specialization of URL link frames that allows for
85
* user defined entries. Each entry has a description in addition to the
86
* normal list of fields that a URL link frame has.
88
* This description identifies the frame and must be unique.
90
class UserUrlLinkFrame : public UrlLinkFrame {
91
friend class FrameFactory;
95
* Constructs an empty user defined URL link frame. For this to be
96
* a useful frame both a description and text must be set.
98
explicit UserUrlLinkFrame(String::Type encoding = String::Latin1);
101
* This is a dual purpose constructor. \a data can either be binary data
102
* that should be parsed or (at a minimum) the frame ID.
104
explicit UserUrlLinkFrame(const ByteVector &data);
107
* Destroys this UserUrlLinkFrame instance.
109
virtual ~UserUrlLinkFrame();
111
// Reimplementations.
113
virtual String toString() const;
116
* Returns the text encoding that will be used in rendering this frame.
117
* This defaults to the type that was either specified in the constructor
118
* or read from the frame when parsed.
120
* \see setTextEncoding()
123
String::Type textEncoding() const;
126
* Sets the text encoding to be used when rendering this frame to
129
* \see textEncoding()
132
void setTextEncoding(String::Type encoding);
135
* Returns the description for this frame.
137
String description() const;
140
* Sets the description of the frame to \a s. \a s must be unique.
142
void setDescription(const String &s);
145
virtual void parseFields(const ByteVector &data);
146
virtual ByteVector renderFields() const;
149
* The constructor used by the FrameFactory.
151
UserUrlLinkFrame(const ByteVector &data, Header *h);
154
UserUrlLinkFrame(const UserUrlLinkFrame &);
155
UserUrlLinkFrame &operator=(const UserUrlLinkFrame &);
157
class UserUrlLinkFramePrivate;
158
UserUrlLinkFramePrivate *d;