karbon

vpattern.h
1/* This file is part of the KDE project
2 Copyright (C) 2002, The Karbon Developers
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef __VPATTERN_H__
21#define __VPATTERN_H__
22
23#include <KoPoint.h>
24#include <koIconChooser.h>
25#include <tqimage.h>
26#include <tqpixmap.h>
27#include <koffice_export.h>
28class TQDomElement;
29
30
31class KARBONBASE_EXPORT VPattern : public KoIconItem
32{
33public:
34 VPattern();
35 VPattern( const TQString &tilename );
36
37 unsigned char *pixels();
38 unsigned int tileWidth() const;
39 unsigned int tileHeight() const;
40
41 KoPoint origin() const { return m_origin; }
42 void setOrigin( const KoPoint &origin ) { m_origin = origin; }
43
44 KoPoint vector() const { return m_vector; }
45 void setVector( const KoPoint &vector ) { m_vector = vector; }
46
47 void load( const TQString &tilename );
48
49 void save( TQDomElement& element ) const;
50 void load( const TQDomElement& element );
51
52 void transform( const TQWMatrix& m );
53
54 // for KoIconItem
55 TQPixmap& pixmap() const ;
56 TQPixmap& thumbPixmap() const;
57
58 bool isValid() const { return m_valid; }
59
60 TQString tilename() const { return m_tilename; }
61
62private:
63 // coordinates:
64 KoPoint m_origin;
65 KoPoint m_vector;
66 TQImage m_image;
67 TQPixmap m_pixmap;
68 TQPixmap m_pixmapThumb;
69 TQString m_tilename;
70 bool m_valid;
71};
72
73#endif