kivio
kivio_fill_style.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_FILL_STYLE_H 00020 #define KIVIO_FILL_STYLE_H 00021 00022 #include <qbrush.h> 00023 #include <qcolor.h> 00024 #include <qdom.h> 00025 00026 #include <kimageeffect.h> 00027 00028 class KivioFillStyle 00029 { 00030 public: 00031 /* 00032 * kcsNone - No fill 00033 * kcsSolid - Solid fill 00034 * kcsGradient - Gradient fill 00035 * kcsPixmap - Pixmap fill 00036 */ 00037 typedef enum { 00038 kcsNone = 0, 00039 kcsSolid, 00040 kcsGradient, 00041 kcsPixmap 00042 } KivioColorStyle; 00043 00044 protected: 00045 KivioColorStyle m_colorStyle; // The color style to use when filling 00046 QColor m_color; // The color to use when solid filling 00047 QColor m_color2; // The second color to use when using a gradient 00048 QBrush::BrushStyle m_brushStyle; // The brush pattern to use when solid filling (maybe gradient too?) 00049 KImageEffect::GradientType m_gradientType; //Which type of gradient to use 00050 00051 public: 00052 KivioFillStyle(); 00053 KivioFillStyle( const KivioFillStyle & ); 00054 00055 00056 void copyInto( KivioFillStyle *pTarget ) const; 00057 00058 bool loadXML( const QDomElement & ); 00059 QDomElement saveXML( QDomDocument & ); 00060 00061 00062 inline KivioColorStyle colorStyle() const { return m_colorStyle; } 00063 inline void setKivioColorStyle( KivioColorStyle k ) { m_colorStyle = k; } 00064 00065 00066 inline QColor color() const { return m_color; } 00067 inline void setColor( const QColor& c ) { m_color = c; } 00068 inline QColor color2() const { return m_color2; } 00069 inline void setColor2( const QColor& c ) { m_color2 = c; } 00070 00071 inline QBrush::BrushStyle brushStyle() const { return m_brushStyle; } 00072 inline void setBrushStyle( QBrush::BrushStyle b ) { m_brushStyle = b; } 00073 00074 inline KImageEffect::GradientType gradientType() const { return m_gradientType; } 00075 inline void setGradientType(KImageEffect::GradientType t) { m_gradientType = t; } 00076 00077 QBrush brush(); 00078 }; 00079 00080 #endif 00081 00082