koPictureShared.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __koPictureShared_h__
00021 #define __koPictureShared_h__
00022
00023 #include <qshared.h>
00024 #include <qstring.h>
00025 #include <qiodevice.h>
00026 #include <qpixmap.h>
00027
00028 #include "koPictureKey.h"
00029
00030 class KoXmlWriter;
00031 class QPainter;
00032 class QSize;
00033
00034 class KURL;
00035
00036 class KoPictureBase;
00037
00044 class KoPictureShared : public QShared
00045 {
00046 public:
00050 KoPictureShared(void);
00051
00055 ~KoPictureShared(void);
00056
00062 KoPictureShared(const KoPictureShared &other);
00063
00069 KoPictureShared& operator=(const KoPictureShared& other);
00070
00071 KoPictureType::Type getType(void) const;
00072
00076 bool isNull(void) const;
00077
00091 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);
00092
00098 QDragObject* dragObject( QWidget *dragSource = 0L, const char *name = 0L );
00099
00100 bool load(QIODevice* io, const QString& extension);
00101 bool loadFromBase64( const QCString& str );
00102
00107 bool save(QIODevice* io) const;
00108
00112 bool saveAsKOffice1Dot1(QIODevice* io) const;
00113
00118 bool saveAsBase64( KoXmlWriter& writer ) const;
00119
00120 void setExtension(const QString& extension);
00121
00122 QString getExtension(void) const;
00123
00124 QString getExtensionAsKOffice1Dot1(void) const;
00125
00126 QSize getOriginalSize(void) const;
00127
00133 void clearAndSetMode(const QString& newMode);
00134
00138 void clear(void);
00139
00145 bool loadFromFile(const QString& fileName);
00146
00150 bool loadXpm(QIODevice* io);
00151
00158 QPixmap generatePixmap(const QSize& size, bool smoothScale = false);
00159
00164 bool isClipartAsKOffice1Dot1(void) const;
00165
00166 QString getMimeType(void) const;
00167
00175 QImage generateImage(const QSize& size);
00176
00177 bool hasAlphaBuffer() const;
00178 void setAlphaBuffer(bool enable);
00179 QImage createAlphaMask(int conversion_flags = 0) const;
00180
00187 void clearCache(void);
00188
00189 QString uniquePictureId() const;
00190 void assignPictureId( uint _id);
00191
00192 protected:
00198 bool loadWmf(QIODevice* io);
00199
00204 bool loadTmp(QIODevice* io);
00205
00207 bool identifyAndLoad( QByteArray data );
00208
00219 bool loadCompressed( QIODevice* io, const QString& mimeType, const QString& extension );
00220
00221 protected:
00222 KoPictureBase* m_base;
00223 QString m_extension;
00224 uint m_pictureId;
00225 };
00226
00227 #endif
This file is part of the documentation for lib Library Version 1.4.2.