flacpicture.h

Go to the documentation of this file.
00001 /**************************************************************************
00002     copyright            : (C) 2010 by Lukáš Lalinský
00003     email                : lalinsky@gmail.com
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., 51 Franklin Street, Fifth Floor, Boston, MA         *
00019  *   02110-1301  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_FLACPICTURE_H
00027 #define TAGLIB_FLACPICTURE_H
00028 
00029 #include "tlist.h"
00030 #include "tstring.h"
00031 #include "tbytevector.h"
00032 #include "taglib_export.h"
00033 #include "flacmetadatablock.h"
00034 
00035 namespace TagLib {
00036 
00037   namespace FLAC {
00038 
00039     class TAGLIB_EXPORT Picture : public MetadataBlock
00040     {
00041     public:
00042 
00046       enum Type {
00048         Other              = 0x00,
00050         FileIcon           = 0x01,
00052         OtherFileIcon      = 0x02,
00054         FrontCover         = 0x03,
00056         BackCover          = 0x04,
00058         LeafletPage        = 0x05,
00060         Media              = 0x06,
00062         LeadArtist         = 0x07,
00064         Artist             = 0x08,
00066         Conductor          = 0x09,
00068         Band               = 0x0A,
00070         Composer           = 0x0B,
00072         Lyricist           = 0x0C,
00074         RecordingLocation  = 0x0D,
00076         DuringRecording    = 0x0E,
00078         DuringPerformance  = 0x0F,
00080         MovieScreenCapture = 0x10,
00082         ColouredFish       = 0x11,
00084         Illustration       = 0x12,
00086         BandLogo           = 0x13,
00088         PublisherLogo      = 0x14
00089       };
00090 
00091       Picture();
00092       Picture(const ByteVector &data);
00093       ~Picture();
00094 
00098       Type type() const;
00099 
00103       void setType(Type type);
00104 
00109       String mimeType() const;
00110 
00115       void setMimeType(const String &m);
00116 
00121       String description() const;
00122 
00127       void setDescription(const String &desc);
00128 
00132       int width() const;
00133 
00137       void setWidth(int w);
00138 
00142       int height() const;
00143 
00147       void setHeight(int h);
00148 
00152       int colorDepth() const;
00153 
00157       void setColorDepth(int depth);
00158 
00162       int numColors() const;
00163 
00167       void setNumColors(int numColors);
00168 
00172       ByteVector data() const;
00173 
00177       void setData(const ByteVector &data);
00178 
00182       int code() const;
00183 
00187       ByteVector render() const;
00188 
00192       bool parse(const ByteVector &rawData);
00193 
00194     private:
00195       Picture(const Picture &item);
00196       Picture &operator=(const Picture &item);
00197 
00198       class PicturePrivate;
00199       PicturePrivate *d;
00200     };
00201 
00202     typedef List<Picture> PictureList;
00203 
00204   }
00205 
00206 }
00207 
00208 #endif