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 :
34 : namespace sd { namespace slidesorter { namespace controller {
35 : class Properties;
36 : } } }
37 :
38 : namespace sd { namespace slidesorter { namespace view {
39 :
40 : const int Theme_FocusIndicatorWidth = 3;
41 :
42 : /** Collection of colors and styles that are used to paint the slide sorter
43 : view.
44 : */
45 0 : class Theme
46 : {
47 : public:
48 : Theme (const ::boost::shared_ptr<controller::Properties>& rpProperties);
49 :
50 : /** Call this method to update some colors as response to a change of
51 : a system color change.
52 : */
53 : void Update (
54 : const ::boost::shared_ptr<controller::Properties>& rpProperties);
55 :
56 : // BitmapEx GetInsertIndicatorIcon (void) const;
57 :
58 : enum FontType {
59 : Font_PageNumber,
60 : Font_PageCount
61 : };
62 : static ::boost::shared_ptr<Font> GetFont (
63 : const FontType eType,
64 : const OutputDevice& rDevice);
65 :
66 : enum ColorType {
67 : Color_Background,
68 : Color_PageNumberDefault,
69 : Color_PageNumberHover,
70 : Color_PageNumberHighContrast,
71 : Color_PageNumberBrightBackground,
72 : Color_PageNumberDarkBackground,
73 : Color_Selection,
74 : Color_PreviewBorder,
75 : Color_PageCountFontColor,
76 : _ColorType_Size_
77 : };
78 : ColorData GetColor (const ColorType eType);
79 :
80 : enum GradientColorType {
81 : Gradient_NormalPage,
82 : Gradient_SelectedPage,
83 : Gradient_SelectedAndFocusedPage,
84 : Gradient_MouseOverPage,
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 :
152 : } } } // end of namespace ::sd::slidesorter::view
153 :
154 : #endif
155 :
156 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|