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 #include <koffice_export.h>
00027
00028 #include "koPictureKey.h"
00029
00030 class KoXmlWriter;
00031 class QPainter;
00032 class QSize;
00033 class QDragObject;
00034 class KURL;
00035
00036 class KoPictureShared;
00037
00043 class KOFFICECORE_EXPORT KoPicture
00044 {
00045 public:
00049 KoPicture(void);
00050
00054 ~KoPicture(void);
00055
00059 KoPicture(const KoPicture &other);
00060
00064 KoPicture& operator=(const KoPicture& other);
00065
00066 KoPictureType::Type getType(void) const;
00067
00071 KoPictureKey getKey(void) const;
00072
00076 void setKey(const KoPictureKey& key);
00077
00081 bool isNull(void) const;
00082
00097 void draw(QPainter& painter, int x, int y, int width, int height, int sx = 0, int sy = 0,
00098 int sw = -1, int sh = -1, bool fastMode = false);
00099
00105 QDragObject* dragObject( QWidget *dragSource = 0L, const char *name = 0L );
00106
00107 bool load(QIODevice* io, const QString& extension);
00108
00113 bool save(QIODevice* io) const;
00114
00118 bool saveAsKOffice1Dot1(QIODevice* io) const;
00119
00130 bool saveAsBase64( KoXmlWriter& writer ) const;
00131
00135 QString getExtension(void) const;
00136
00140 QString getMimeType(void) const;
00141
00142 QString getExtensionAsKOffice1Dot1(void) const;
00143
00147 QSize getOriginalSize(void) const;
00148
00154 void clearAndSetMode(const QString& newMode);
00155
00159 void clear(void);
00160
00164 bool loadFromFile(const QString& fileName);
00165
00169 bool loadFromBase64(const QCString& str);
00170
00174 bool loadXpm(QIODevice* io);
00175
00182 QPixmap generatePixmap(const QSize& size, bool smoothScale = false);
00183
00189 bool isClipartAsKOffice1Dot1(void) const;
00190
00199 bool setKeyAndDownloadPicture(const KURL& url, QWidget *window);
00200
00207 QImage generateImage(const QSize& size);
00208
00212 bool hasAlphaBuffer() const;
00213
00217 void setAlphaBuffer(bool enable);
00218
00225 QImage createAlphaMask(int conversion_flags = 0) const;
00226
00233 void clearCache(void);
00234
00235 QString uniquePictureId() const;
00236 void assignPictureId( uint _id);
00237
00238 protected:
00243 void unlinkSharedData(void);
00248 void linkSharedData(void) const;
00253 void createSharedData(void);
00254 QString uniqueName() const;
00255
00256 protected:
00261 KoPictureKey m_key;
00266 KoPictureShared* m_sharedData;
00267 static uint uniqueValue;
00268
00269 QString m_uniqueName;
00270 };
00271
00272 #endif
This file is part of the documentation for lib Library Version 1.4.2.