karbon
vpattern.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __VPATTERN_H__
00021 #define __VPATTERN_H__
00022
00023 #include <KoPoint.h>
00024 #include <koIconChooser.h>
00025 #include <qimage.h>
00026 #include <qpixmap.h>
00027 #include <koffice_export.h>
00028 class QDomElement;
00029
00030
00031 class KARBONBASE_EXPORT VPattern : public KoIconItem
00032 {
00033 public:
00034 VPattern();
00035 VPattern( const QString &tilename );
00036
00037 unsigned char *pixels();
00038 unsigned int tileWidth() const;
00039 unsigned int tileHeight() const;
00040
00041 KoPoint origin() const { return m_origin; }
00042 void setOrigin( const KoPoint &origin ) { m_origin = origin; }
00043
00044 KoPoint vector() const { return m_vector; }
00045 void setVector( const KoPoint &vector ) { m_vector = vector; }
00046
00047 void load( const QString &tilename );
00048
00049 void save( QDomElement& element ) const;
00050 void load( const QDomElement& element );
00051
00052 void transform( const QWMatrix& m );
00053
00054
00055 QPixmap& pixmap() const ;
00056 QPixmap& thumbPixmap() const;
00057
00058 bool isValid() const { return m_valid; }
00059
00060 QString tilename() const { return m_tilename; }
00061
00062 private:
00063
00064 KoPoint m_origin;
00065 KoPoint m_vector;
00066 QImage m_image;
00067 QPixmap m_pixmap;
00068 QPixmap m_pixmapThumb;
00069 QString m_tilename;
00070 bool m_valid;
00071 };
00072
00073 #endif
|