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., 51 Franklin Street, Fifth Floor, Boston, MA         *
00021  *   02110-1301  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       PropertyMap asProperties() const;
00072 
00073     protected:
00074       virtual void parseFields(const ByteVector &data);
00075       virtual ByteVector renderFields() const;
00076 
00080       UrlLinkFrame(const ByteVector &data, Header *h);
00081 
00082     private:
00083       UrlLinkFrame(const UrlLinkFrame &);
00084       UrlLinkFrame &operator=(const UrlLinkFrame &);
00085 
00086       class UrlLinkFramePrivate;
00087       UrlLinkFramePrivate *d;
00088     };
00089 
00091 
00099     class TAGLIB_EXPORT UserUrlLinkFrame : public UrlLinkFrame
00100     {
00101       friend class FrameFactory;
00102 
00103     public:
00108       explicit UserUrlLinkFrame(String::Type encoding = String::Latin1);
00109 
00114       explicit UserUrlLinkFrame(const ByteVector &data);
00115 
00119       virtual ~UserUrlLinkFrame();
00120 
00121       // Reimplementations.
00122 
00123       virtual String toString() const;
00124 
00133       String::Type textEncoding() const;
00134 
00142       void setTextEncoding(String::Type encoding);
00143 
00147       String description() const;
00148 
00152       void setDescription(const String &s);
00153 
00162       PropertyMap asProperties() const;
00163 
00168       static UserUrlLinkFrame *find(Tag *tag, const String &description);
00169 
00170     protected:
00171       virtual void parseFields(const ByteVector &data);
00172       virtual ByteVector renderFields() const;
00173 
00177       UserUrlLinkFrame(const ByteVector &data, Header *h);
00178 
00179     private:
00180       UserUrlLinkFrame(const UserUrlLinkFrame &);
00181       UserUrlLinkFrame &operator=(const UserUrlLinkFrame &);
00182 
00183       class UserUrlLinkFramePrivate;
00184       UserUrlLinkFramePrivate *d;
00185     };
00186 
00187   }
00188 }
00189 #endif