kivio
kivio_gradient.h
00001 /* 00002 * Kivio - Visual Modelling and Flowcharting 00003 * Copyright (C) 2000-2001 theKompany.com & Dave Marotti 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * as published by the Free Software Foundation; either version 2 00008 * of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 #ifndef KIVIO_GRADIENT_H 00020 #define KIVIO_GRADIENT_H 00021 00022 #include <qptrlist.h> 00023 #include <qcolor.h> 00024 #include <qdom.h> 00025 class KivioPoint; 00026 00027 class KivioGradient 00028 { 00029 public: 00030 // Gradient type enumerations 00031 typedef enum { 00032 kgtNone=0, 00033 kgtLinear, 00034 kgtBiLinear, 00035 kgtRadial, 00036 kgtSquare, 00037 kgtConicalSymmetric, 00038 kgtConicalAsymmetric, 00039 kgtLast 00040 } KivioGradientType; 00041 00042 protected: 00043 QPtrList <QColor> *m_pColors; // A list of the colors in the gradient 00044 QPtrList <KivioPoint> *m_pPoints; // A list of the points for each color 00045 KivioGradientType m_gradientType; // The type of gradient 00046 00047 00048 public: 00049 KivioGradient(); 00050 KivioGradient( const KivioGradient & ); 00051 virtual ~KivioGradient(); 00052 00053 void copyInto( KivioGradient *pTarget ) const; 00054 00055 bool loadXML( const QDomElement & ); 00056 QDomElement saveXML( QDomDocument & ); 00057 00058 00059 QPtrList<QColor> *colors() const { return m_pColors; } 00060 00061 QPtrList<KivioPoint> *points() const { return m_pPoints; } 00062 00063 KivioGradientType gradientType() const { return m_gradientType; } 00064 void setGradientType( KivioGradientType t ) { m_gradientType=t; } 00065 }; 00066 00067 #endif 00068 00069