Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_SD_SOURCE_UI_SLIDESORTER_INC_VIEW_SLSTHEME_HXX
21 : #define INCLUDED_SD_SOURCE_UI_SLIDESORTER_INC_VIEW_SLSTHEME_HXX
22 :
23 : #include "model/SlsVisualState.hxx"
24 :
25 : #include <vcl/bitmapex.hxx>
26 : #include <vcl/font.hxx>
27 : #include <vcl/gradient.hxx>
28 : #include <tools/color.hxx>
29 :
30 : #include <boost/shared_ptr.hpp>
31 : #include <boost/weak_ptr.hpp>
32 :
33 : namespace sd { namespace slidesorter { namespace controller {
34 : class Properties;
35 : } } }
36 :
37 : namespace sd { namespace slidesorter { namespace view {
38 :
39 : const int Theme_FocusIndicatorWidth = 3;
40 :
41 : /** Collection of colors and styles that are used to paint the slide sorter
42 : view.
43 : */
44 64 : class Theme
45 : {
46 : public:
47 : Theme (const ::boost::shared_ptr<controller::Properties>& rpProperties);
48 :
49 : /** Call this method to update some colors as response to a change of
50 : a system color change.
51 : */
52 : void Update (
53 : const ::boost::shared_ptr<controller::Properties>& rpProperties);
54 :
55 : // BitmapEx GetInsertIndicatorIcon() const;
56 :
57 : enum FontType {
58 : Font_PageNumber,
59 : Font_PageCount
60 : };
61 : static boost::shared_ptr<vcl::Font> GetFont (
62 : const FontType eType,
63 : const OutputDevice& rDevice);
64 :
65 : enum ColorType {
66 : Color_Background,
67 : Color_PageNumberDefault,
68 : Color_PageNumberHover,
69 : Color_PageNumberHighContrast,
70 : Color_PageNumberBrightBackground,
71 : Color_PageNumberDarkBackground,
72 : Color_Selection,
73 : Color_PreviewBorder,
74 : Color_PageCountFontColor,
75 : _ColorType_Size_
76 : };
77 : ColorData GetColor (const ColorType eType);
78 :
79 : enum GradientColorType {
80 : Gradient_NormalPage,
81 : Gradient_SelectedPage,
82 : Gradient_SelectedAndFocusedPage,
83 : Gradient_MouseOverPage,
84 : Gradient_MouseOverSelected,
85 : Gradient_MouseOverSelectedAndFocusedPage,
86 : Gradient_FocusedPage,
87 : _GradientColorType_Size_
88 : };
89 : enum GradientColorClass {
90 : Border1,
91 : Border2,
92 : Fill1,
93 : Fill2,
94 : Base
95 : };
96 : ColorData GetGradientColor (
97 : const GradientColorType eType,
98 : const GradientColorClass eClass);
99 : void SetGradient (
100 : const GradientColorType eType,
101 : const ColorData aBaseColor,
102 : const sal_Int32 nSaturationOverride,
103 : const sal_Int32 nBrightnessOverride,
104 : const sal_Int32 nFillStartOffset,
105 : const sal_Int32 nFillEndOffset,
106 : const sal_Int32 nBorderStartOffset,
107 : const sal_Int32 nBorderEndOffset);
108 :
109 : enum IconType
110 : {
111 : Icon_RawShadow,
112 : Icon_RawInsertShadow,
113 : Icon_HideSlideOverlay,
114 : Icon_FocusBorder,
115 : _IconType_Size_
116 : };
117 : const BitmapEx& GetIcon (const IconType eType);
118 :
119 : private:
120 : class GradientDescriptor
121 : {
122 : public:
123 : ColorData maBaseColor;
124 :
125 : sal_Int32 mnSaturationOverride;
126 : sal_Int32 mnBrightnessOverride;
127 :
128 : ColorData maFillColor1;
129 : ColorData maFillColor2;
130 : ColorData maBorderColor1;
131 : ColorData maBorderColor2;
132 :
133 : sal_Int32 mnFillOffset1;
134 : sal_Int32 mnFillOffset2;
135 : sal_Int32 mnBorderOffset1;
136 : sal_Int32 mnBorderOffset2;
137 : };
138 : ColorData maBackgroundColor;
139 : ColorData maPageBackgroundColor;
140 : ::std::vector<GradientDescriptor> maGradients;
141 : ::std::vector<BitmapEx> maIcons;
142 : ::std::vector<ColorData> maColor;
143 :
144 : GradientDescriptor& GetGradient (const GradientColorType eType);
145 : /** Guarded initialization of the specified icon in the maIcons
146 : container. Call only while a LocalResource object is active.
147 : */
148 : void InitializeIcon (const IconType eType, sal_uInt16 nResourceId);
149 : };
150 :
151 : } } } // end of namespace ::sd::slidesorter::view
152 :
153 : #endif
154 :
155 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|