karbon

vfill.h
1/* This file is part of the KDE project
2 Copyright (C) 2001, The Karbon Developers
3 Copyright (C) 2002, The Karbon Developers
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef __VFILL_H__
22#define __VFILL_H__
23
24#include "vcolor.h"
25#include "vgradient.h"
26#include "vpattern.h"
27#include <koffice_export.h>
28
29class TQDomElement;
30class KoGenStyle;
31class KoGenStyles;
32class KoOasisLoadingContext;
33
34
44class KARBONBASE_EXPORT VFill
45{
46public:
48 {
49 none = 0,
50 solid = 1,
51 grad = 2,
52 patt = 3,
54 };
55
56 VFill();
57 VFill( const VColor & );
58 VFill( const VFill & );
59
60 const VColor& color() const { return m_color; }
61 void setColor( const VColor& color, bool bsolid = true ) { m_color = color; if( bsolid ) m_type = solid; }
62
63 VGradient& gradient() { return m_gradient; }
64 const VGradient& gradient() const { return m_gradient; }
65
66 VPattern& pattern() { return m_pattern; }
67 const VPattern& pattern() const { return m_pattern; }
68
69 VFillType type() const { return m_type; }
70 void setType( VFillType type ) { m_type = type; }
71
72 void save( TQDomElement& element ) const;
73 void saveOasis( KoGenStyles &mainStyles, KoGenStyle &style ) const;
74 void load( const TQDomElement& element );
75 void loadOasis( const TQDomElement &object, KoOasisLoadingContext &context, VObject* parent = 0L );
76
77 VFill& operator=( const VFill& fill );
78
79 void transform( const TQWMatrix& m );
80
81private:
82 VColor m_color;
83 VGradient m_gradient;
84 VPattern m_pattern;
85
86 VFillType m_type : 3;
87};
88
89#endif
90
This class keeps track of color properties.
Definition vcolor.h:41
Manages the fill of shapes.
Definition vfill.h:45
VFillType
Definition vfill.h:48
@ solid
no fill at all
Definition vfill.h:50
@ grad
solid fill
Definition vfill.h:51
@ patt
gradient fill
Definition vfill.h:52
@ unknown
pattern fill
Definition vfill.h:53