koPictureImage.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __koPictureImage_h__
00021 #define __koPictureImage_h__
00022
00023 #include "koPictureBase.h"
00024 #include <qstring.h>
00025
00026 class KoPictureImagePrivate;
00027
00028
00034 class KoPictureImage : public KoPictureBase
00035 {
00036 public:
00040 KoPictureImage();
00041
00045 virtual ~KoPictureImage();
00046
00047 KoPictureType::Type getType(void) const;
00048
00049 KoPictureBase* newCopy(void) const;
00050
00054 virtual bool isNull(void) const;
00055
00074 virtual void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0, int sw = -1, int sh = -1, bool fastMode = false);
00075
00076 virtual QDragObject* dragObject( QWidget *dragSource = 0L, const char *name = 0L );
00077
00078 virtual bool loadData(const QByteArray& array, const QString& extension);
00079
00080 virtual bool save(QIODevice* io) const;
00081
00082 virtual QSize getOriginalSize(void) const;
00083
00084 virtual QPixmap generatePixmap(const QSize& size, bool smoothScale = false);
00085
00086 virtual QString getMimeType(const QString& extension) const;
00087
00092 virtual QImage generateImage(const QSize& size);
00093
00094 virtual bool hasAlphaBuffer() const
00095 { return m_originalImage.hasAlphaBuffer(); }
00096
00097 virtual void setAlphaBuffer(bool enable)
00098 { m_originalImage.setAlphaBuffer(enable); }
00099
00100 virtual QImage createAlphaMask(int conversion_flags = 0) const
00101 { return m_originalImage.createAlphaMask(conversion_flags); }
00102
00103 virtual void clearCache(void);
00104
00105 protected:
00106 QPixmap getPixmap(QImage& image);
00107 void scaleAndCreatePixmap(const QSize& size, bool fastMode=false);
00108
00109 private:
00110 QImage m_originalImage;
00111 QByteArray m_rawData;
00112 QPixmap m_cachedPixmap;
00113 QSize m_cachedSize;
00114
00118 bool m_cacheIsInFastMode;
00119 class Private;
00120 Private* d;
00121 };
00122
00123 #endif
This file is part of the documentation for lib Library Version 1.4.2.