TagLib 1.6.1 (TagLib: textidentificationframe.h Source File)

textidentificationframe.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2002 - 2008 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  *   Alternatively, this file is available under the Mozilla Public        *
00022  *   License Version 1.1.  You may obtain a copy of the License at         *
00023  *   http://www.mozilla.org/MPL/                                           *
00024  ***************************************************************************/
00025 
00026 #ifndef TAGLIB_TEXTIDENTIFICATIONFRAME_H
00027 #define TAGLIB_TEXTIDENTIFICATIONFRAME_H
00028 
00029 #include "tstringlist.h"
00030 #include "taglib_export.h"
00031 
00032 #include "id3v2frame.h"
00033 
00034 namespace TagLib {
00035 
00036   namespace ID3v2 {
00037 
00038     class Tag;
00039 
00041 
00104     class TAGLIB_EXPORT TextIdentificationFrame : public Frame
00105     {
00106       friend class FrameFactory;
00107 
00108     public:
00118       TextIdentificationFrame(const ByteVector &type, String::Type encoding);
00119 
00124       explicit TextIdentificationFrame(const ByteVector &data);
00125 
00129       virtual ~TextIdentificationFrame();
00130 
00141       void setText(const StringList &l);
00142 
00143       // Reimplementations.
00144 
00145       virtual void setText(const String &s);
00146       virtual String toString() const;
00147 
00158       String::Type textEncoding() const;
00159 
00169       void setTextEncoding(String::Type encoding);
00170 
00174       StringList fieldList() const;
00175 
00176     protected:
00177       // Reimplementations.
00178 
00179       virtual void parseFields(const ByteVector &data);
00180       virtual ByteVector renderFields() const;
00181 
00185       TextIdentificationFrame(const ByteVector &data, Header *h);
00186 
00187     private:
00188       TextIdentificationFrame(const TextIdentificationFrame &);
00189       TextIdentificationFrame &operator=(const TextIdentificationFrame &);
00190 
00191       class TextIdentificationFramePrivate;
00192       TextIdentificationFramePrivate *d;
00193     };
00194 
00203 
00204 
00205     class TAGLIB_EXPORT UserTextIdentificationFrame : public TextIdentificationFrame
00206     {
00207       friend class FrameFactory;
00208 
00209     public:
00214       explicit UserTextIdentificationFrame(String::Type encoding = String::Latin1);
00215 
00219       explicit UserTextIdentificationFrame(const ByteVector &data);
00220 
00221       virtual String toString() const;
00222 
00226       String description() const;
00227 
00233       void setDescription(const String &s);
00234 
00235       StringList fieldList() const;
00236       void setText(const String &text);
00237       void setText(const StringList &fields);
00238 
00243       static UserTextIdentificationFrame *find(Tag *tag, const String &description);
00244 
00245     private:
00246       UserTextIdentificationFrame(const ByteVector &data, Header *h);
00247       UserTextIdentificationFrame(const TextIdentificationFrame &);
00248       UserTextIdentificationFrame &operator=(const UserTextIdentificationFrame &);
00249 
00250       void checkFields();
00251 
00252       class UserTextIdentificationFramePrivate;
00253       UserTextIdentificationFramePrivate *d;
00254     };
00255 
00256   }
00257 }
00258 #endif