kivio_fill_style.h
1/*
2 * Kivio - Visual Modelling and Flowcharting
3 * Copyright (C) 2000-2001 theKompany.com & Dave Marotti
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19#ifndef KIVIO_FILL_STYLE_H
20#define KIVIO_FILL_STYLE_H
21
22#include <tqbrush.h>
23#include <tqcolor.h>
24#include <tqdom.h>
25
26#include <kimageeffect.h>
27
28class KivioFillStyle
29{
30public:
31 /*
32 * kcsNone - No fill
33 * kcsSolid - Solid fill
34 * kcsGradient - Gradient fill
35 * kcsPixmap - Pixmap fill
36 */
37 typedef enum {
38 kcsNone = 0,
39 kcsSolid,
40 kcsGradient,
41 kcsPixmap
42 } KivioColorStyle;
43
44protected:
45 KivioColorStyle m_colorStyle; // The color style to use when filling
46 TQColor m_color; // The color to use when solid filling
47 TQColor m_color2; // The second color to use when using a gradient
48 TQt::BrushStyle m_brushStyle; // The brush pattern to use when solid filling (maybe gradient too?)
49 KImageEffect::GradientType m_gradientType; //Which type of gradient to use
50
51public:
52 KivioFillStyle();
53 KivioFillStyle( const KivioFillStyle & );
54
55
56 void copyInto( KivioFillStyle *pTarget ) const;
57
58 bool loadXML( const TQDomElement & );
59 TQDomElement saveXML( TQDomDocument & );
60
61
62 inline KivioColorStyle colorStyle() const { return m_colorStyle; }
63 inline void setKivioColorStyle( KivioColorStyle k ) { m_colorStyle = k; }
64
65
66 inline TQColor color() const { return m_color; }
67 inline void setColor( const TQColor& c ) { m_color = c; }
68 inline TQColor color2() const { return m_color2; }
69 inline void setColor2( const TQColor& c ) { m_color2 = c; }
70
71 inline TQt::BrushStyle brushStyle() const { return m_brushStyle; }
72 inline void setBrushStyle( TQt::BrushStyle b ) { m_brushStyle = b; }
73
74 inline KImageEffect::GradientType gradientType() const { return m_gradientType; }
75 inline void setGradientType(KImageEffect::GradientType t) { m_gradientType = t; }
76
77 TQBrush brush();
78};
79
80#endif
81
82