1
/***************************************************************************
2
copyright : (C) 2002 - 2008 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 *
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_URLLINKFRAME_H
29
#define TAGLIB_URLLINKFRAME_H
31
#include <id3v2frame.h>
39
* An implementation of ID3v2 URL link frames.
41
class TAGLIB_EXPORT UrlLinkFrame : public Frame
43
friend class FrameFactory;
47
* This is a dual purpose constructor. \a data can either be binary data
48
* that should be parsed or (at a minimum) the frame ID.
50
explicit UrlLinkFrame(const ByteVector &data);
53
* Destroys this UrlLinkFrame instance.
55
virtual ~UrlLinkFrame();
60
virtual String url() const;
63
* Sets the URL to \a s.
65
virtual void setUrl(const String &s);
69
virtual void setText(const String &s);
70
virtual String toString() const;
73
virtual void parseFields(const ByteVector &data);
74
virtual ByteVector renderFields() const;
77
* The constructor used by the FrameFactory.
79
UrlLinkFrame(const ByteVector &data, Header *h);
82
UrlLinkFrame(const UrlLinkFrame &);
83
UrlLinkFrame &operator=(const UrlLinkFrame &);
85
class UrlLinkFramePrivate;
86
UrlLinkFramePrivate *d;
89
//! ID3v2 User defined URL frame
92
* This is a specialization of URL link frames that allows for
93
* user defined entries. Each entry has a description in addition to the
94
* normal list of fields that a URL link frame has.
96
* This description identifies the frame and must be unique.
98
class TAGLIB_EXPORT UserUrlLinkFrame : public UrlLinkFrame
100
friend class FrameFactory;
104
* Constructs an empty user defined URL link frame. For this to be
105
* a useful frame both a description and text must be set.
107
explicit UserUrlLinkFrame(String::Type encoding = String::Latin1);
110
* This is a dual purpose constructor. \a data can either be binary data
111
* that should be parsed or (at a minimum) the frame ID.
113
explicit UserUrlLinkFrame(const ByteVector &data);
116
* Destroys this UserUrlLinkFrame instance.
118
virtual ~UserUrlLinkFrame();
120
// Reimplementations.
122
virtual String toString() const;
125
* Returns the text encoding that will be used in rendering this frame.
126
* This defaults to the type that was either specified in the constructor
127
* or read from the frame when parsed.
129
* \see setTextEncoding()
132
String::Type textEncoding() const;
135
* Sets the text encoding to be used when rendering this frame to
138
* \see textEncoding()
141
void setTextEncoding(String::Type encoding);
144
* Returns the description for this frame.
146
String description() const;
149
* Sets the description of the frame to \a s. \a s must be unique.
151
void setDescription(const String &s);
154
virtual void parseFields(const ByteVector &data);
155
virtual ByteVector renderFields() const;
158
* The constructor used by the FrameFactory.
160
UserUrlLinkFrame(const ByteVector &data, Header *h);
163
UserUrlLinkFrame(const UserUrlLinkFrame &);
164
UserUrlLinkFrame &operator=(const UserUrlLinkFrame &);
166
class UserUrlLinkFramePrivate;
167
UserUrlLinkFramePrivate *d;