lib

KoBrush.h

00001 // -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
00002 /* This file is part of the KDE project
00003    Copyright (C) 2005-2006 Thorsten Zachmann <zachmann@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library 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 GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KOBRUSH_H
00022 #define KOBRUSH_H
00023 
00024 #include <qbrush.h>
00025 
00026 class KoGenStyle;
00027 class KoGenStyles;
00028 class KoOasisContext;
00029 class QDomElement;
00030 
00031 
00032 enum BCType {
00033     BCT_PLAIN = 0,
00034     BCT_GHORZ = 1,
00035     BCT_GVERT = 2,
00036     BCT_GDIAGONAL1 = 3,
00037     BCT_GDIAGONAL2 = 4,
00038     BCT_GCIRCLE = 5,
00039     BCT_GRECT = 6,
00040     BCT_GPIPECROSS = 7,
00041     BCT_GPYRAMID = 8
00042 };
00043 
00044 enum FillType
00045 {
00046     FT_BRUSH = 0,
00047     FT_GRADIENT = 1
00048 };
00049 
00050 class KoBrush
00051 {
00052 public:
00053     KoBrush();
00054     KoBrush(  const QBrush &brush, const QColor &gColor1, const QColor &gColor2,
00055               BCType gType, FillType fillType, bool unbalanced,
00056               int xfactor, int yfactor );
00057 
00058     KoBrush &operator=( const KoBrush &brush );
00059 
00060     void setBrush( const QBrush &brush )
00061         {  m_brush = brush; }
00062     void setGColor1( const QColor &gColor1 )
00063         {  m_gColor1 = gColor1; }
00064     void setGColor2( const QColor &gColor2 )
00065         {  m_gColor2 = gColor2; }
00066     void setGType( BCType gType )
00067         {  m_gType = gType; }
00068     void setFillType( FillType fillType )
00069         {  m_fillType = fillType; }
00070     void setGUnbalanced( bool unbalanced )
00071         {  m_unbalanced = unbalanced; }
00072     void setGXFactor( int xfactor )
00073         {  m_xfactor = xfactor; }
00074     void setGYFactor( int yfactor )
00075         {  m_yfactor = yfactor; }
00076 
00077     QBrush getBrush() const
00078         { return m_brush; }
00079     QColor getGColor1() const
00080         { return m_gColor1; }
00081     QColor getGColor2() const
00082         { return m_gColor2; }
00083     BCType getGType() const
00084         { return m_gType; }
00085     FillType getFillType() const
00086         { return m_fillType; }
00087     bool getGUnbalanced() const
00088         { return m_unbalanced; }
00089     int getGXFactor() const
00090         { return m_xfactor; }
00091     int getGYFactor() const
00092         { return m_yfactor; }
00093 
00094 private:
00095     QBrush m_brush;
00096     QColor m_gColor1;
00097     QColor m_gColor2;
00098     BCType m_gType;
00099     FillType m_fillType;
00100     bool m_unbalanced;
00101     int m_xfactor;
00102     int m_yfactor;
00103 };
00104 
00105 #endif /* KOBRUSH_H */
00106 
KDE Home | KDE Accessibility Home | Description of Access Keys