~njh-aelius/maxosx/musicbrainz-tags

« back to all changes in this revision

Viewing changes to Frameworks/taglib/taglib/taglib/mpeg/id3v2/frames/urllinkframe.h

  • Committer: stephen_booth
  • Date: 2008-04-30 01:48:01 UTC
  • Revision ID: svn-v4:6b6cea13-1402-0410-9567-a7afb52bf336:trunk:1371
Fixing the taglib source tree

Show diffs side-by-side

added added

removed removed

Lines of Context:
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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
21
 
 *   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
 
 
37
 
    /*!
38
 
     * An implementation of ID3v2 URL link frames.
39
 
     */
40
 
    class TAGLIB_EXPORT UrlLinkFrame : public Frame
41
 
    {
42
 
      friend class FrameFactory;
43
 
 
44
 
    public:
45
 
      /*!
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.
48
 
       */
49
 
      explicit UrlLinkFrame(const ByteVector &data);
50
 
 
51
 
      /*!
52
 
       * Destroys this UrlLinkFrame instance.
53
 
       */
54
 
      virtual ~UrlLinkFrame();
55
 
 
56
 
      /*!
57
 
       * Returns the URL.
58
 
       */
59
 
      virtual String url() const;
60
 
 
61
 
      /*!
62
 
       * Sets the URL to \a s.
63
 
       */
64
 
      virtual void setUrl(const String &s);
65
 
 
66
 
      // Reimplementations.
67
 
 
68
 
      virtual void setText(const String &s);
69
 
      virtual String toString() const;
70
 
 
71
 
    protected:
72
 
      virtual void parseFields(const ByteVector &data);
73
 
      virtual ByteVector renderFields() const;
74
 
 
75
 
      /*!
76
 
       * The constructor used by the FrameFactory.
77
 
       */
78
 
      UrlLinkFrame(const ByteVector &data, Header *h);
79
 
 
80
 
    private:
81
 
      UrlLinkFrame(const UrlLinkFrame &);
82
 
      UrlLinkFrame &operator=(const UrlLinkFrame &);
83
 
 
84
 
      class UrlLinkFramePrivate;
85
 
      UrlLinkFramePrivate *d;
86
 
    };
87
 
 
88
 
    /*!
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.
92
 
     *
93
 
     * This description identifies the frame and must be unique.
94
 
     */
95
 
    class TAGLIB_EXPORT UserUrlLinkFrame : public UrlLinkFrame
96
 
    {
97
 
      friend class FrameFactory;
98
 
 
99
 
    public:
100
 
      /*!
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.
103
 
       */
104
 
      explicit UserUrlLinkFrame(String::Type encoding = String::Latin1);
105
 
 
106
 
      /*!
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.
109
 
       */
110
 
      explicit UserUrlLinkFrame(const ByteVector &data);
111
 
 
112
 
      /*!
113
 
       * Destroys this UserUrlLinkFrame instance.
114
 
       */
115
 
      virtual ~UserUrlLinkFrame();
116
 
 
117
 
      // Reimplementations.
118
 
 
119
 
      virtual String toString() const;
120
 
 
121
 
      /*!
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.
125
 
       *
126
 
       * \see setTextEncoding()
127
 
       * \see render()
128
 
       */
129
 
      String::Type textEncoding() const;
130
 
 
131
 
      /*!
132
 
       * Sets the text encoding to be used when rendering this frame to
133
 
       * \a encoding.
134
 
       *
135
 
       * \see textEncoding()
136
 
       * \see render()
137
 
       */
138
 
      void setTextEncoding(String::Type encoding);
139
 
 
140
 
      /*!
141
 
       * Returns the description for this frame.
142
 
       */
143
 
      String description() const;
144
 
 
145
 
      /*!
146
 
       * Sets the description of the frame to \a s.  \a s must be unique.
147
 
       */
148
 
      void setDescription(const String &s);
149
 
 
150
 
    protected:
151
 
      virtual void parseFields(const ByteVector &data);
152
 
      virtual ByteVector renderFields() const;
153
 
 
154
 
      /*!
155
 
       * The constructor used by the FrameFactory.
156
 
       */
157
 
      UserUrlLinkFrame(const ByteVector &data, Header *h);
158
 
 
159
 
    private:
160
 
      UserUrlLinkFrame(const UserUrlLinkFrame &);
161
 
      UserUrlLinkFrame &operator=(const UserUrlLinkFrame &);
162
 
 
163
 
      class UserUrlLinkFramePrivate;
164
 
      UserUrlLinkFramePrivate *d;
165
 
    };
166
 
 
167
 
  }
168
 
}
169
 
#endif