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