urllinkframe.h
Go to the documentation of this file.
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  ***************************************************************************/
7 
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. *
12  * *
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. *
17  * *
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., 51 Franklin Street, Fifth Floor, Boston, MA *
21  * 02110-1301 USA *
22  * *
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  ***************************************************************************/
27 
28 #ifndef TAGLIB_URLLINKFRAME_H
29 #define TAGLIB_URLLINKFRAME_H
30 
31 #include "id3v2frame.h"
32 
33 namespace TagLib {
34 
35  namespace ID3v2 {
36 
38 
42  {
43  friend class FrameFactory;
44 
45  public:
50  explicit UrlLinkFrame(const ByteVector &data);
51 
55  virtual ~UrlLinkFrame();
56 
60  virtual String url() const;
61 
65  virtual void setUrl(const String &s);
66 
67  // Reimplementations.
68 
69  virtual void setText(const String &s);
70  virtual String toString() const;
71  PropertyMap asProperties() const;
72 
73  protected:
74  virtual void parseFields(const ByteVector &data);
75  virtual ByteVector renderFields() const;
76 
80  UrlLinkFrame(const ByteVector &data, Header *h);
81 
82  private:
83  UrlLinkFrame(const UrlLinkFrame &);
84  UrlLinkFrame &operator=(const UrlLinkFrame &);
85 
86  class UrlLinkFramePrivate;
87  UrlLinkFramePrivate *d;
88  };
89 
91 
100  {
101  friend class FrameFactory;
102 
103  public:
108  explicit UserUrlLinkFrame(String::Type encoding = String::Latin1);
109 
114  explicit UserUrlLinkFrame(const ByteVector &data);
115 
119  virtual ~UserUrlLinkFrame();
120 
121  // Reimplementations.
122 
123  virtual String toString() const;
124 
133  String::Type textEncoding() const;
134 
142  void setTextEncoding(String::Type encoding);
143 
147  String description() const;
148 
152  void setDescription(const String &s);
153 
162  PropertyMap asProperties() const;
163 
168  static UserUrlLinkFrame *find(Tag *tag, const String &description);
169 
170  protected:
171  virtual void parseFields(const ByteVector &data);
172  virtual ByteVector renderFields() const;
173 
177  UserUrlLinkFrame(const ByteVector &data, Header *h);
178 
179  private:
181  UserUrlLinkFrame &operator=(const UserUrlLinkFrame &);
182 
183  class UserUrlLinkFramePrivate;
184  UserUrlLinkFramePrivate *d;
185  };
186 
187  }
188 }
189 #endif