asfpicture.h
Go to the documentation of this file.
00001 /**************************************************************************
00002     copyright            : (C) 2010 by Anton Sergunov
00003     email                : setosha@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 ASFPICTURE_H
00027 #define ASFPICTURE_H
00028 
00029 #include "tstring.h"
00030 #include "tbytevector.h"
00031 #include "taglib_export.h"
00032 #include "attachedpictureframe.h"
00033 
00034 namespace TagLib
00035 {
00036   namespace ASF
00037   {
00038 
00040 
00049     class TAGLIB_EXPORT Picture {
00050     public:
00051 
00055       enum Type {
00057         Other              = 0x00,
00059         FileIcon           = 0x01,
00061         OtherFileIcon      = 0x02,
00063         FrontCover         = 0x03,
00065         BackCover          = 0x04,
00067         LeafletPage        = 0x05,
00069         Media              = 0x06,
00071         LeadArtist         = 0x07,
00073         Artist             = 0x08,
00075         Conductor          = 0x09,
00077         Band               = 0x0A,
00079         Composer           = 0x0B,
00081         Lyricist           = 0x0C,
00083         RecordingLocation  = 0x0D,
00085         DuringRecording    = 0x0E,
00087         DuringPerformance  = 0x0F,
00089         MovieScreenCapture = 0x10,
00091         ColouredFish       = 0x11,
00093         Illustration       = 0x12,
00095         BandLogo           = 0x13,
00097         PublisherLogo      = 0x14
00098       };
00099 
00103       Picture();
00104 
00108       Picture(const Picture& other);
00109 
00113       virtual ~Picture();
00114 
00118       Picture& operator=(const Picture& other);
00119 
00123       void swap(Picture &other);
00124 
00128       bool isValid() const;
00129 
00137       String mimeType() const;
00138 
00146       void setMimeType(const String &value);
00147 
00154       Type type() const;
00155 
00162       void setType(const ASF::Picture::Type& t);
00163 
00169       String description() const;
00170 
00176       void setDescription(const String &desc);
00177 
00187       ByteVector picture() const;
00188 
00197       void setPicture(const ByteVector &p);
00198 
00202       ByteVector render() const;
00203 
00207       int dataSize() const;
00208 
00209 #ifndef DO_NOT_DOCUMENT
00210       /* THIS IS PRIVATE, DON'T TOUCH IT! */
00211       void parse(const ByteVector& );
00212       static Picture fromInvalid();
00213 #endif
00214 
00215       private:
00216         class PicturePrivate;
00217         PicturePrivate *d;
00218       };
00219   }
00220 }
00221 
00222 #endif // ASFPICTURE_H