TagLib  2.0.2
urllinkframe.h
Go to the documentation of this file.
1 /***************************************************************************
2  copyright : (C) 2002 - 2008 by Scott Wheeler
3  email : wheeler@kde.org
4 
5  copyright : (C) 2006 by Urs Fleisch
6  email : ufleisch@users.sourceforge.net
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * This library is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU Lesser General Public License version *
12  * 2.1 as published by the Free Software Foundation. *
13  * *
14  * This library is distributed in the hope that it will be useful, but *
15  * WITHOUT ANY WARRANTY; without even the implied warranty of *
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
17  * Lesser General Public License for more details. *
18  * *
19  * You should have received a copy of the GNU Lesser General Public *
20  * License along with this library; if not, write to the Free Software *
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
22  * 02110-1301 USA *
23  * *
24  * Alternatively, this file is available under the Mozilla Public *
25  * License Version 1.1. You may obtain a copy of the License at *
26  * http://www.mozilla.org/MPL/ *
27  ***************************************************************************/
28 
29 #ifndef TAGLIB_URLLINKFRAME_H
30 #define TAGLIB_URLLINKFRAME_H
31 
32 #include "id3v2frame.h"
33 
34 namespace TagLib {
35 
36  namespace ID3v2 {
37 
39 
43  {
44  friend class FrameFactory;
45 
46  public:
51  explicit UrlLinkFrame(const ByteVector &data);
52 
56  ~UrlLinkFrame() override;
57 
58  UrlLinkFrame(const UrlLinkFrame &) = delete;
59  UrlLinkFrame &operator=(const UrlLinkFrame &) = delete;
60 
64  virtual String url() const;
65 
69  virtual void setUrl(const String &s);
70 
71  // Reimplementations.
72 
73  void setText(const String &s) override;
74  String toString() const override;
75  PropertyMap asProperties() const override;
76 
77  protected:
78  void parseFields(const ByteVector &data) override;
79  ByteVector renderFields() const override;
80 
84  UrlLinkFrame(const ByteVector &data, Header *h);
85 
86  private:
87  class UrlLinkFramePrivate;
89  std::unique_ptr<UrlLinkFramePrivate> d;
90  };
91 
93 
102  {
103  friend class FrameFactory;
104 
105  public:
110  explicit UserUrlLinkFrame(String::Type encoding = String::Latin1);
111 
116  explicit UserUrlLinkFrame(const ByteVector &data);
117 
121  ~UserUrlLinkFrame() override;
122 
123  UserUrlLinkFrame(const UserUrlLinkFrame &) = delete;
124  UserUrlLinkFrame &operator=(const UserUrlLinkFrame &) = delete;
125 
126  // Reimplementations.
127 
128  String toString() const override;
129 
138  String::Type textEncoding() const;
139 
147  void setTextEncoding(String::Type encoding);
148 
152  String description() const;
153 
157  void setDescription(const String &s);
158 
167  PropertyMap asProperties() const override;
168 
173  static UserUrlLinkFrame *find(const Tag *tag, const String &description);
174 
175  protected:
176  void parseFields(const ByteVector &data) override;
177  ByteVector renderFields() const override;
178 
182  UserUrlLinkFrame(const ByteVector &data, Header *h);
183 
184  private:
185  class UserUrlLinkFramePrivate;
187  std::unique_ptr<UserUrlLinkFramePrivate> d;
188  };
189 
190  } // namespace ID3v2
191 } // namespace TagLib
192 #endif
A map for format-independent <key,values> tag representations.
Definition: tpropertymap.h:122
An implementation of ID3v2 headers.
Definition: id3v2header.h:48
A wide string class suitable for unicode.
Definition: tstring.h:82
A byte vector.
Definition: tbytevector.h:45
A factory for creating ID3v2 frames during parsing.
Definition: id3v2framefactory.h:67
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition: taglib_export.h:55
ID3v2 URL frame.
Definition: urllinkframe.h:42
ID3v2 User defined URL frame.
Definition: urllinkframe.h:101
ID3v2 frame implementation.
Definition: id3v2frame.h:56
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
The main class in the ID3v2 implementation.
Definition: id3v2tag.h:133
Type
Definition: tstring.h:96
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
Definition: tstring.h:100