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       bool isValid() const;
00124 
00132       String mimeType() const;
00133 
00141       void setMimeType(const String &value);
00142 
00149       Type type() const;
00150 
00157       void setType(const ASF::Picture::Type& t);
00158 
00164       String description() const;
00165 
00171       void setDescription(const String &desc);
00172 
00182       ByteVector picture() const;
00183 
00192       void setPicture(const ByteVector &p);
00193 
00197       ByteVector render() const;
00198 
00202       int dataSize() const;
00203 
00204 #ifndef DO_NOT_DOCUMENT
00205       /* THIS IS PRIVATE, DON'T TOUCH IT! */
00206       void parse(const ByteVector& );
00207       static Picture fromInvalid();
00208       friend class Attribute;
00209 #endif
00210       private:
00211         class PicturePrivate;
00212         PicturePrivate *d;
00213       };
00214   }
00215 }
00216 
00217 #endif // ASFPICTURE_H