kivio

kivio_gradient.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_GRADIENT_H
20#define KIVIO_GRADIENT_H
21
22#include <tqptrlist.h>
23#include <tqcolor.h>
24#include <tqdom.h>
25class KivioPoint;
26
27class KivioGradient
28{
29public:
30 // Gradient type enumerations
31 typedef enum {
32 kgtNone=0,
33 kgtLinear,
34 kgtBiLinear,
35 kgtRadial,
36 kgtSquare,
37 kgtConicalSymmetric,
38 kgtConicalAsymmetric,
39 kgtLast
40 } KivioGradientType;
41
42protected:
43 TQPtrList <TQColor> *m_pColors; // A list of the colors in the gradient
44 TQPtrList <KivioPoint> *m_pPoints; // A list of the points for each color
45 KivioGradientType m_gradientType; // The type of gradient
46
47
48public:
49 KivioGradient();
50 KivioGradient( const KivioGradient & );
51 virtual ~KivioGradient();
52
53 void copyInto( KivioGradient *pTarget ) const;
54
55 bool loadXML( const TQDomElement & );
56 TQDomElement saveXML( TQDomDocument & );
57
58
59 TQPtrList<TQColor> *colors() const { return m_pColors; }
60
61 TQPtrList<KivioPoint> *points() const { return m_pPoints; }
62
63 KivioGradientType gradientType() const { return m_gradientType; }
64 void setGradientType( KivioGradientType t ) { m_gradientType=t; }
65};
66
67#endif
68
69