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>
38
* An implementation of ID3v2 URL link frames.
40
class TAGLIB_EXPORT UrlLinkFrame : public Frame
42
friend class FrameFactory;
46
* This is a dual purpose constructor. \a data can either be binary data
47
* that should be parsed or (at a minimum) the frame ID.
49
explicit UrlLinkFrame(const ByteVector &data);
52
* Destroys this UrlLinkFrame instance.
54
virtual ~UrlLinkFrame();
59
virtual String url() const;
62
* Sets the URL to \a s.
64
virtual void setUrl(const String &s);
68
virtual void setText(const String &s);
69
virtual String toString() const;
72
virtual void parseFields(const ByteVector &data);
73
virtual ByteVector renderFields() const;
76
* The constructor used by the FrameFactory.
78
UrlLinkFrame(const ByteVector &data, Header *h);
81
UrlLinkFrame(const UrlLinkFrame &);
82
UrlLinkFrame &operator=(const UrlLinkFrame &);
84
class UrlLinkFramePrivate;
85
UrlLinkFramePrivate *d;
89
* This is a specialization of URL link frames that allows for
90
* user defined entries. Each entry has a description in addition to the
91
* normal list of fields that a URL link frame has.
93
* This description identifies the frame and must be unique.
95
class TAGLIB_EXPORT UserUrlLinkFrame : public UrlLinkFrame
97
friend class FrameFactory;
101
* Constructs an empty user defined URL link frame. For this to be
102
* a useful frame both a description and text must be set.
104
explicit UserUrlLinkFrame(String::Type encoding = String::Latin1);
107
* This is a dual purpose constructor. \a data can either be binary data
108
* that should be parsed or (at a minimum) the frame ID.
110
explicit UserUrlLinkFrame(const ByteVector &data);
113
* Destroys this UserUrlLinkFrame instance.
115
virtual ~UserUrlLinkFrame();
117
// Reimplementations.
119
virtual String toString() const;
122
* Returns the text encoding that will be used in rendering this frame.
123
* This defaults to the type that was either specified in the constructor
124
* or read from the frame when parsed.
126
* \see setTextEncoding()
129
String::Type textEncoding() const;
132
* Sets the text encoding to be used when rendering this frame to
135
* \see textEncoding()
138
void setTextEncoding(String::Type encoding);
141
* Returns the description for this frame.
143
String description() const;
146
* Sets the description of the frame to \a s. \a s must be unique.
148
void setDescription(const String &s);
151
virtual void parseFields(const ByteVector &data);
152
virtual ByteVector renderFields() const;
155
* The constructor used by the FrameFactory.
157
UserUrlLinkFrame(const ByteVector &data, Header *h);
160
UserUrlLinkFrame(const UserUrlLinkFrame &);
161
UserUrlLinkFrame &operator=(const UserUrlLinkFrame &);
163
class UserUrlLinkFramePrivate;
164
UserUrlLinkFramePrivate *d;