karbon
vfill.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
|