urllinkframe.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2002 - 2008 by Scott Wheeler
00003     email                : wheeler@kde.org
00004 
00005     copyright            : (C) 2006 by Urs Fleisch
00006     email                : ufleisch@users.sourceforge.net
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *   This library is free software; you can redistribute it and/or modify  *
00011  *   it under the terms of the GNU Lesser General Public License version   *
00012  *   2.1 as published by the Free Software Foundation.                     *
00013  *                                                                         *
00014  *   This library is distributed in the hope that it will be useful, but   *
00015  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
00016  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00017  *   Lesser General Public License for more details.                       *
00018  *                                                                         *
00019  *   You should have received a copy of the GNU Lesser General Public      *
00020  *   License along with this library; if not, write to the Free Software   *
00021  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA         *
00022  *   02110-1301  USA                                                       *
00023  *                                                                         *
00024  *   Alternatively, this file is available under the Mozilla Public        *
00025  *   License Version 1.1.  You may obtain a copy of the License at         *
00026  *   http://www.mozilla.org/MPL/                                           *
00027  ***************************************************************************/
00028 
00029 #ifndef TAGLIB_URLLINKFRAME_H
00030 #define TAGLIB_URLLINKFRAME_H
00031 
00032 #include "id3v2frame.h"
00033 
00034 namespace TagLib {
00035 
00036   namespace ID3v2 {
00037 
00039 
00042     class TAGLIB_EXPORT UrlLinkFrame : public Frame
00043     {
00044       friend class FrameFactory;
00045 
00046     public:
00051       explicit UrlLinkFrame(const ByteVector &data);
00052 
00056       virtual ~UrlLinkFrame();
00057 
00061       virtual String url() const;
00062 
00066       virtual void setUrl(const String &s);
00067 
00068       // Reimplementations.
00069 
00070       virtual void setText(const String &s);
00071       virtual String toString() const;
00072       PropertyMap asProperties() const;
00073 
00074     protected:
00075       virtual void parseFields(const ByteVector &data);
00076       virtual ByteVector renderFields() const;
00077 
00081       UrlLinkFrame(const ByteVector &data, Header *h);
00082 
00083     private:
00084       UrlLinkFrame(const UrlLinkFrame &);
00085       UrlLinkFrame &operator=(const UrlLinkFrame &);
00086 
00087       class UrlLinkFramePrivate;
00088       UrlLinkFramePrivate *d;
00089     };
00090 
00092 
00100     class TAGLIB_EXPORT UserUrlLinkFrame : public UrlLinkFrame
00101     {
00102       friend class FrameFactory;
00103 
00104     public:
00109       explicit UserUrlLinkFrame(String::Type encoding = String::Latin1);
00110 
00115       explicit UserUrlLinkFrame(const ByteVector &data);
00116 
00120       virtual ~UserUrlLinkFrame();
00121 
00122       // Reimplementations.
00123 
00124       virtual String toString() const;
00125 
00134       String::Type textEncoding() const;
00135 
00143       void setTextEncoding(String::Type encoding);
00144 
00148       String description() const;
00149 
00153       void setDescription(const String &s);
00154 
00163       PropertyMap asProperties() const;
00164 
00169       static UserUrlLinkFrame *find(Tag *tag, const String &description);
00170 
00171     protected:
00172       virtual void parseFields(const ByteVector &data);
00173       virtual ByteVector renderFields() const;
00174 
00178       UserUrlLinkFrame(const ByteVector &data, Header *h);
00179 
00180     private:
00181       UserUrlLinkFrame(const UserUrlLinkFrame &);
00182       UserUrlLinkFrame &operator=(const UserUrlLinkFrame &);
00183 
00184       class UserUrlLinkFramePrivate;
00185       UserUrlLinkFramePrivate *d;
00186     };
00187 
00188   }
00189 }
00190 #endif