koPicture.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __koPicture_h__
00021 #define __koPicture_h__
00022
00023 #include <qstring.h>
00024 #include <qiodevice.h>
00025 #include <qpixmap.h>
00026
00027 #include "koPictureKey.h"
00028
00029 class QPainter;
00030 class QSize;
00031 class QDragObject;
00032 class KURL;
00033
00034 class KoPictureShared;
00035
00041 class KoPicture
00042 {
00043 public:
00047 KoPicture(void);
00048
00052 ~KoPicture(void);
00053
00057 KoPicture(const KoPicture &other);
00058
00062 KoPicture& operator=(const KoPicture& other);
00063
00064 KoPictureType::Type getType(void) const;
00065
00069 KoPictureKey getKey(void) const;
00070
00074 void setKey(const KoPictureKey& key);
00075
00079 bool isNull(void) const;
00080
00095 void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0,
00096 int sw = -1, int sh = -1, bool fastMode = false);
00097
00103 QDragObject* dragObject( QWidget *dragSource = 0L, const char *name = 0L );
00104
00105 bool load(QIODevice* io, const QString& extension);
00106
00111 bool save(QIODevice* io);
00112
00116 bool saveAsKOffice1Dot1(QIODevice* io);
00117
00121 QString getExtension(void) const;
00122
00126 QString getMimeType(void) const;
00127
00128 QString getExtensionAsKOffice1Dot1(void) const;
00129
00133 QSize getOriginalSize(void) const;
00134
00140 void clearAndSetMode(const QString& newMode);
00141
00145 void clear(void);
00146
00150 bool loadFromFile(const QString& fileName);
00151
00155 bool loadXpm(QIODevice* io);
00156
00164 QPixmap generatePixmap(const QSize& size, bool smoothScale = false);
00165
00170 bool isClipartAsKOffice1Dot1(void) const;
00171
00175 bool setKeyAndDownloadPicture(const KURL& url);
00176
00183 QImage generateImage(const QSize& size);
00184
00188 bool hasAlphaBuffer() const;
00189
00193 void setAlphaBuffer(bool enable);
00194
00201 QImage createAlphaMask(int conversion_flags = 0) const;
00202
00207 void clearCache(void);
00208
00209 protected:
00214 void unlinkSharedData(void);
00219 void linkSharedData(void) const;
00224 void createSharedData(void);
00225
00226 protected:
00231 KoPictureKey m_key;
00236 KoPictureShared* m_sharedData;
00237 };
00238
00239 #endif
This file is part of the documentation for lib Library Version 1.3.5.