1 /* libwpg
2 * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org)
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02111-1301 USA
18 *
19 * For further information visit http://libwpg.sourceforge.net
20 */
22 /* "This product is not manufactured, approved, or supported by
23 * Corel Corporation or Corel Corporation Limited."
24 */
26 #ifndef __WPGBRUSH_H__
27 #define __WPGBRUSH_H__
29 #include "WPGColor.h"
30 #include "WPGGradient.h"
32 namespace libwpg
33 {
35 class WPGBrush
36 {
37 public:
39 typedef enum
40 {
41 NoBrush,
42 Solid,
43 Pattern,
44 Gradient
45 } WPGBrushStyle;
47 WPGBrushStyle style;
48 WPGColor foreColor;
49 WPGColor backColor;
51 WPGGradient gradient;
53 WPGBrush():
54 style(NoBrush),
55 foreColor(0,0,0),
56 backColor(0,0,0)
57 {};
59 WPGBrush(const WPGColor& fore):
60 style(Solid),
61 foreColor(fore),
62 backColor(0,0,0)
63 {};
65 WPGBrush(const WPGColor& fore, const WPGColor& back):
66 style(Solid),
67 foreColor(fore),
68 backColor(back)
69 {};
71 WPGBrush(const WPGBrush& brush)
72 {
73 style = brush.style;
74 foreColor = brush.foreColor;
75 backColor = brush.backColor;
76 gradient = brush.gradient;
77 }
79 WPGBrush& operator=(const WPGBrush& brush)
80 {
81 style = brush.style;
82 foreColor = brush.foreColor;
83 backColor = brush.backColor;
84 gradient = brush.gradient;
85 return *this;
86 }
87 };
89 } // namespace libwpg
91 #endif // __WPGBRUSH_H__