urllinkframe.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2002 - 2008 by Scott Wheeler
00003     email                : wheeler@kde.org
00004     copyright            : (C) 2006 by Urs Fleisch
00005     email                : ufleisch@users.sourceforge.net
00006  ***************************************************************************/
00007 
00008 /***************************************************************************
00009  *   This library is free software; you can redistribute it and/or modify  *
00010  *   it under the terms of the GNU Lesser General Public License version   *
00011  *   2.1 as published by the Free Software Foundation.                     *
00012  *                                                                         *
00013  *   This library is distributed in the hope that it will be useful, but   *
00014  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
00015  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00016  *   Lesser General Public License for more details.                       *
00017  *                                                                         *
00018  *   You should have received a copy of the GNU Lesser General Public      *
00019  *   License along with this library; if not, write to the Free Software   *
00020  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
00021  *   USA                                                                   *
00022  *                                                                         *
00023  *   Alternatively, this file is available under the Mozilla Public        *
00024  *   License Version 1.1.  You may obtain a copy of the License at         *
00025  *   http://www.mozilla.org/MPL/                                           *
00026  ***************************************************************************/
00027 
00028 #ifndef TAGLIB_URLLINKFRAME_H
00029 #define TAGLIB_URLLINKFRAME_H
00030 
00031 #include "id3v2frame.h"
00032 
00033 namespace TagLib {
00034 
00035   namespace ID3v2 {
00036 
00038 
00041     class TAGLIB_EXPORT UrlLinkFrame : public Frame
00042     {
00043       friend class FrameFactory;
00044 
00045     public:
00050       explicit UrlLinkFrame(const ByteVector &data);
00051 
00055       virtual ~UrlLinkFrame();
00056 
00060       virtual String url() const;
00061 
00065       virtual void setUrl(const String &s);
00066 
00067       // Reimplementations.
00068 
00069       virtual void setText(const String &s);
00070       virtual String toString() const;
00071 
00072     protected:
00073       virtual void parseFields(const ByteVector &data);
00074       virtual ByteVector renderFields() const;
00075 
00079       UrlLinkFrame(const ByteVector &data, Header *h);
00080 
00081     private:
00082       UrlLinkFrame(const UrlLinkFrame &);
00083       UrlLinkFrame &operator=(const UrlLinkFrame &);
00084 
00085       class UrlLinkFramePrivate;
00086       UrlLinkFramePrivate *d;
00087     };
00088 
00090 
00098     class TAGLIB_EXPORT UserUrlLinkFrame : public UrlLinkFrame
00099     {
00100       friend class FrameFactory;
00101 
00102     public:
00107       explicit UserUrlLinkFrame(String::Type encoding = String::Latin1);
00108 
00113       explicit UserUrlLinkFrame(const ByteVector &data);
00114 
00118       virtual ~UserUrlLinkFrame();
00119 
00120       // Reimplementations.
00121 
00122       virtual String toString() const;
00123 
00132       String::Type textEncoding() const;
00133 
00141       void setTextEncoding(String::Type encoding);
00142 
00146       String description() const;
00147 
00151       void setDescription(const String &s);
00152 
00153     protected:
00154       virtual void parseFields(const ByteVector &data);
00155       virtual ByteVector renderFields() const;
00156 
00160       UserUrlLinkFrame(const ByteVector &data, Header *h);
00161 
00162     private:
00163       UserUrlLinkFrame(const UserUrlLinkFrame &);
00164       UserUrlLinkFrame &operator=(const UserUrlLinkFrame &);
00165 
00166       class UserUrlLinkFramePrivate;
00167       UserUrlLinkFramePrivate *d;
00168     };
00169 
00170   }
00171 }
00172 #endif