xref: /aoo41x/main/sfx2/source/sidebar/Paint.hxx (revision ff12d537)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 #ifndef SFX_SIDEBAR_PAINT_HXX
23 #define SFX_SIDEBAR_PAINT_HXX
24 
25 #include <tools/color.hxx>
26 #include <vcl/gradient.hxx>
27 #include <vcl/wall.hxx>
28 
29 #include <boost/variant.hpp>
30 
31 namespace sfx2 { namespace sidebar {
32 
33 /** Abstraction of different ways to fill outlines.
34     Can be
35      - none (empty: outline is not filled)
36      - singular color
37      - gradient
38 */
39 class Paint
40 {
41 public:
42     enum Type
43     {
44         NoPaint,
45         ColorPaint,
46         GradientPaint
47     };
48 
49     // Create paint with type NoPaint.
50     explicit Paint (void);
51 
52     // Create a Paint object for the given color.
53     explicit Paint (const Color& rColor);
54 
55     // Create a Paint object for the given gradient.
56     explicit Paint (const Gradient& rGradient);
57 
58     void Set (const ::sfx2::sidebar::Paint& rOther);
59 
60     Type GetType (void) const;
61     const Color& GetColor (void) const;
62     const Gradient& GetGradient (void) const;
63 
64     Wallpaper GetWallpaper (void) const;
65 
66 private:
67     Type meType;
68     ::boost::variant<
69         Color,
70         Gradient
71     > maValue;
72 };
73 
74 
75 } } // end of namespace sfx2::sidebar
76 
77 #endif
78