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 QPainter;
00031
class QSize;
00032
00033
class KURL;
00034
00035
class KoPictureBase;
00036
00043
class KoPictureShared :
public QShared
00044 {
00045
public:
00049 KoPictureShared(
void);
00050
00054 ~KoPictureShared(
void);
00055
00061 KoPictureShared(
const KoPictureShared &other);
00062
00068 KoPictureShared& operator=(
const KoPictureShared& other);
00069
00070 KoPictureType::Type getType(
void) const;
00071
00075
bool isNull(
void) const;
00076
00090
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);
00091
00097
QDragObject* dragObject(
QWidget *dragSource = 0L, const
char *name = 0L );
00098
00099
bool load(
QIODevice* io, const
QString& extension);
00100
00105
bool save(
QIODevice* io);
00106
00110
bool saveAsKOffice1Dot1(
QIODevice* io);
00111
00112
void setExtension(const
QString& extension);
00113
00114
QString getExtension(
void) const;
00115
00116
QString getExtensionAsKOffice1Dot1(
void) const;
00117
00118
QSize getOriginalSize(
void) const;
00119
00125
void clearAndSetMode(const
QString& newMode);
00126
00130
void clear(
void);
00131
00132
00133
00134
00135
00136
00137
bool loadFromFile(const
QString& fileName);
00138
00142
bool loadXpm(
QIODevice* io);
00143
00150
QPixmap generatePixmap(const
QSize& size,
bool smoothScale = false);
00151
00156
bool isClipartAsKOffice1Dot1(
void) const;
00157
00158
QString getMimeType(
void) const;
00159
00166
QImage generateImage(const
QSize& size);
00167
00168
bool hasAlphaBuffer() const;
00169
void setAlphaBuffer(
bool enable);
00170
QImage createAlphaMask(
int conversion_flags = 0) const;
00171
00176
void clearCache(
void);
00177
00178 protected:
00183
bool loadWmf(
QIODevice* io);
00184
00189
bool loadTmp(
QIODevice* io);
00190
00191 protected:
00192 KoPictureBase* m_base;
00193
QString m_extension;
00194 };
00195
00196 #endif