TagLib 1.4 (TagLib: textidentificationframe.h Source File)

textidentificationframe.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2002, 2003 by Scott Wheeler
00003     email                : wheeler@kde.org
00004  ***************************************************************************/
00005 
00006 /***************************************************************************
00007  *   This library is free software; you can redistribute it and/or modify  *
00008  *   it  under the terms of the GNU Lesser General Public License version  *
00009  *   2.1 as published by the Free Software Foundation.                     *
00010  *                                                                         *
00011  *   This library is distributed in the hope that it will be useful, but   *
00012  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00014  *   Lesser General Public License for more details.                       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with this library; if not, write to the Free Software   *
00018  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
00019  *   USA                                                                   *
00020  ***************************************************************************/
00021 
00022 #ifndef TAGLIB_TEXTIDENTIFICATIONFRAME_H
00023 #define TAGLIB_TEXTIDENTIFICATIONFRAME_H
00024 
00025 #include <tstringlist.h>
00026 
00027 #include <id3v2frame.h>
00028 
00029 namespace TagLib {
00030 
00031   namespace ID3v2 {
00032 
00033     class Tag;
00034 
00036 
00095     class TextIdentificationFrame : public Frame
00096     {
00097       friend class FrameFactory;
00098 
00099     public:
00107       TextIdentificationFrame(const ByteVector &type, String::Type encoding);
00108 
00113       explicit TextIdentificationFrame(const ByteVector &data);
00114 
00118       virtual ~TextIdentificationFrame();
00119 
00130       void setText(const StringList &l);
00131 
00132       // Reimplementations.
00133 
00134       virtual void setText(const String &s);
00135       virtual String toString() const;
00136 
00145       String::Type textEncoding() const;
00146 
00154       void setTextEncoding(String::Type encoding);
00155 
00159       StringList fieldList() const;
00160 
00161     protected:
00162       // Reimplementations.
00163 
00164       virtual void parseFields(const ByteVector &data);
00165       virtual ByteVector renderFields() const;
00166 
00170       TextIdentificationFrame(const ByteVector &data, Header *h);
00171 
00172     private:
00173       TextIdentificationFrame(const TextIdentificationFrame &);
00174       TextIdentificationFrame &operator=(const TextIdentificationFrame &);
00175 
00176       class TextIdentificationFramePrivate;
00177       TextIdentificationFramePrivate *d;
00178     };
00179 
00188 
00189 
00190     class UserTextIdentificationFrame : public TextIdentificationFrame
00191     {
00192       friend class FrameFactory;
00193 
00194     public:
00199       explicit UserTextIdentificationFrame(String::Type encoding = String::Latin1);
00200 
00204       explicit UserTextIdentificationFrame(const ByteVector &data);
00205 
00206       virtual String toString() const;
00207 
00211       String description() const;
00212 
00218       void setDescription(const String &s);
00219 
00220       StringList fieldList() const;
00221       void setText(const String &text);
00222       void setText(const StringList &fields);
00223 
00228       static UserTextIdentificationFrame *find(Tag *tag, const String &description);
00229 
00230     private:
00231       UserTextIdentificationFrame(const ByteVector &data, Header *h);
00232       UserTextIdentificationFrame(const TextIdentificationFrame &);
00233       UserTextIdentificationFrame &operator=(const UserTextIdentificationFrame &);
00234 
00235       class UserTextIdentificationFramePrivate;
00236       UserTextIdentificationFramePrivate *d;
00237     };
00238 
00239   }
00240 }
00241 #endif