karbon

vfill.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2001, The Karbon Developers
00003    Copyright (C) 2002, The Karbon Developers
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 __VFILL_H__
00022 #define __VFILL_H__
00023 
00024 #include "vcolor.h"
00025 #include "vgradient.h"
00026 #include "vpattern.h"
00027 #include <koffice_export.h>
00028 
00029 class QDomElement;
00030 class KoGenStyle;
00031 class KoGenStyles;
00032 class KoOasisLoadingContext;
00033 
00034 
00044 class KARBONBASE_EXPORT VFill
00045 {
00046 public:
00047     enum VFillType
00048     {
00049         none     = 0,   
00050         solid    = 1,   
00051         grad     = 2,   
00052         patt     = 3,   
00053         unknown  = 4
00054     };
00055 
00056     VFill();
00057     VFill( const VColor & );
00058     VFill( const VFill & );
00059 
00060     const VColor& color() const { return m_color; }
00061     void setColor( const VColor& color, bool bsolid = true ) { m_color = color; if( bsolid ) m_type = solid; }
00062 
00063     VGradient& gradient() { return m_gradient; }
00064     const VGradient& gradient() const { return m_gradient; }
00065 
00066     VPattern& pattern() { return m_pattern; }
00067     const VPattern& pattern() const { return m_pattern; }
00068 
00069     VFillType type() const { return m_type; }
00070     void setType( VFillType type ) { m_type = type; }
00071 
00072     void save( QDomElement& element ) const;
00073     void saveOasis( KoGenStyles &mainStyles, KoGenStyle &style ) const;
00074     void load( const QDomElement& element );
00075     void loadOasis( const QDomElement &object, KoOasisLoadingContext &context, VObject* parent = 0L );
00076 
00077     VFill& operator=( const VFill& fill );
00078 
00079     void transform( const QWMatrix& m );
00080 
00081 private:
00082     VColor      m_color;
00083     VGradient   m_gradient;
00084     VPattern    m_pattern;
00085 
00086     VFillType   m_type      : 3;
00087 };
00088 
00089 #endif
00090 
KDE Home | KDE Accessibility Home | Description of Access Keys