1*c45d927aSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*c45d927aSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*c45d927aSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*c45d927aSAndrew Rist * distributed with this work for additional information 6*c45d927aSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*c45d927aSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*c45d927aSAndrew Rist * "License"); you may not use this file except in compliance 9*c45d927aSAndrew Rist * with the License. You may obtain a copy of the License at 10*c45d927aSAndrew Rist * 11*c45d927aSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*c45d927aSAndrew Rist * 13*c45d927aSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*c45d927aSAndrew Rist * software distributed under the License is distributed on an 15*c45d927aSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*c45d927aSAndrew Rist * KIND, either express or implied. See the License for the 17*c45d927aSAndrew Rist * specific language governing permissions and limitations 18*c45d927aSAndrew Rist * under the License. 19*c45d927aSAndrew Rist * 20*c45d927aSAndrew Rist *************************************************************/ 21*c45d927aSAndrew Rist 22*c45d927aSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef SD_SLIDESORTER_VIEW_THEME_HXX 25cdf0e10cSrcweir #define SD_SLIDESORTER_VIEW_THEME_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "model/SlsVisualState.hxx" 28cdf0e10cSrcweir 29cdf0e10cSrcweir #include <vcl/bitmapex.hxx> 30cdf0e10cSrcweir #include <vcl/font.hxx> 31cdf0e10cSrcweir #include <vcl/gradient.hxx> 32cdf0e10cSrcweir #include <tools/color.hxx> 33cdf0e10cSrcweir 34cdf0e10cSrcweir #include <boost/shared_ptr.hpp> 35cdf0e10cSrcweir #include <boost/weak_ptr.hpp> 36cdf0e10cSrcweir 37cdf0e10cSrcweir 38cdf0e10cSrcweir namespace sd { namespace slidesorter { namespace controller { 39cdf0e10cSrcweir class Properties; 40cdf0e10cSrcweir } } } 41cdf0e10cSrcweir 42cdf0e10cSrcweir namespace sd { namespace slidesorter { namespace view { 43cdf0e10cSrcweir 44cdf0e10cSrcweir 45cdf0e10cSrcweir /** Collection of colors and styles that are used to paint the slide sorter 46cdf0e10cSrcweir view. 47cdf0e10cSrcweir */ 48cdf0e10cSrcweir class Theme 49cdf0e10cSrcweir { 50cdf0e10cSrcweir public: 51cdf0e10cSrcweir Theme (const ::boost::shared_ptr<controller::Properties>& rpProperties); 52cdf0e10cSrcweir 53cdf0e10cSrcweir /** Call this method to update some colors as response to a change of 54cdf0e10cSrcweir a system color change. 55cdf0e10cSrcweir */ 56cdf0e10cSrcweir void Update ( 57cdf0e10cSrcweir const ::boost::shared_ptr<controller::Properties>& rpProperties); 58cdf0e10cSrcweir 59cdf0e10cSrcweir // BitmapEx GetInsertIndicatorIcon (void) const; 60cdf0e10cSrcweir 61cdf0e10cSrcweir enum FontType { 62cdf0e10cSrcweir Font_PageNumber, 63cdf0e10cSrcweir Font_PageCount, 64cdf0e10cSrcweir Font_Button 65cdf0e10cSrcweir }; 66cdf0e10cSrcweir static ::boost::shared_ptr<Font> GetFont ( 67cdf0e10cSrcweir const FontType eType, 68cdf0e10cSrcweir const OutputDevice& rDevice); 69cdf0e10cSrcweir 70cdf0e10cSrcweir enum ColorType { 71cdf0e10cSrcweir Color_Background, 72cdf0e10cSrcweir Color_ButtonBackground, 73cdf0e10cSrcweir Color_ButtonText, 74cdf0e10cSrcweir Color_ButtonTextHover, 75cdf0e10cSrcweir Color_PageNumberDefault, 76cdf0e10cSrcweir Color_PageNumberHover, 77cdf0e10cSrcweir Color_PageNumberHighContrast, 78cdf0e10cSrcweir Color_PageNumberBrightBackground, 79cdf0e10cSrcweir Color_PageNumberDarkBackground, 80cdf0e10cSrcweir Color_Selection, 81cdf0e10cSrcweir Color_PreviewBorder, 82cdf0e10cSrcweir Color_PageCountFontColor, 83cdf0e10cSrcweir _ColorType_Size_ 84cdf0e10cSrcweir }; 85cdf0e10cSrcweir ColorData GetColor (const ColorType eType); 86cdf0e10cSrcweir void SetColor (const ColorType eType, const ColorData aColorData); 87cdf0e10cSrcweir 88cdf0e10cSrcweir enum GradientColorType { 89cdf0e10cSrcweir Gradient_NormalPage, 90cdf0e10cSrcweir Gradient_SelectedPage, 91cdf0e10cSrcweir Gradient_SelectedAndFocusedPage, 92cdf0e10cSrcweir Gradient_MouseOverPage, 93cdf0e10cSrcweir Gradient_MouseOverSelectedAndFocusedPage, 94cdf0e10cSrcweir Gradient_FocusedPage, 95cdf0e10cSrcweir Gradient_ButtonBackground, 96cdf0e10cSrcweir _GradientColorType_Size_ 97cdf0e10cSrcweir }; 98cdf0e10cSrcweir enum GradientColorClass { 99cdf0e10cSrcweir Border1, 100cdf0e10cSrcweir Border2, 101cdf0e10cSrcweir Fill1, 102cdf0e10cSrcweir Fill2, 103cdf0e10cSrcweir Base 104cdf0e10cSrcweir }; 105cdf0e10cSrcweir ColorData GetGradientColor ( 106cdf0e10cSrcweir const GradientColorType eType, 107cdf0e10cSrcweir const GradientColorClass eClass); 108cdf0e10cSrcweir sal_Int32 GetGradientOffset ( 109cdf0e10cSrcweir const GradientColorType eType, 110cdf0e10cSrcweir const GradientColorClass eClass); 111cdf0e10cSrcweir void SetGradient ( 112cdf0e10cSrcweir const GradientColorType eType, 113cdf0e10cSrcweir const ColorData aBaseColor, 114cdf0e10cSrcweir const sal_Int32 nSaturationOverride, 115cdf0e10cSrcweir const sal_Int32 nBrightnessOverride, 116cdf0e10cSrcweir const sal_Int32 nFillStartOffset, 117cdf0e10cSrcweir const sal_Int32 nFillEndOffset, 118cdf0e10cSrcweir const sal_Int32 nBorderStartOffset, 119cdf0e10cSrcweir const sal_Int32 nBorderEndOffset); 120cdf0e10cSrcweir sal_Int32 GetGradientSaturationOverride (const GradientColorType eType); 121cdf0e10cSrcweir sal_Int32 GetGradientBrightnessOverride (const GradientColorType eType); 122cdf0e10cSrcweir void SetGradientSaturationOverride (const GradientColorType eType, const sal_Int32 nValue); 123cdf0e10cSrcweir void SetGradientBrightnessOverride (const GradientColorType eType, const sal_Int32 nValue); 124cdf0e10cSrcweir 125cdf0e10cSrcweir enum IconType 126cdf0e10cSrcweir { 127cdf0e10cSrcweir Icon_RawShadow, 128cdf0e10cSrcweir Icon_RawInsertShadow, 129cdf0e10cSrcweir Icon_HideSlideOverlay, 130cdf0e10cSrcweir Icon_FocusBorder, 131cdf0e10cSrcweir Icon_ButtonBarLarge, 132cdf0e10cSrcweir Icon_ButtonBarMedium, 133cdf0e10cSrcweir Icon_ButtonBarSmall, 134cdf0e10cSrcweir Icon_Command1Large, 135cdf0e10cSrcweir Icon_Command1LargeHover, 136cdf0e10cSrcweir Icon_Command1Medium, 137cdf0e10cSrcweir Icon_Command1MediumHover, 138cdf0e10cSrcweir Icon_Command1Small, 139cdf0e10cSrcweir Icon_Command1SmallHover, 140cdf0e10cSrcweir Icon_Command2Large, 141cdf0e10cSrcweir Icon_Command2LargeHover, 142cdf0e10cSrcweir Icon_Command2Medium, 143cdf0e10cSrcweir Icon_Command2MediumHover, 144cdf0e10cSrcweir Icon_Command2Small, 145cdf0e10cSrcweir Icon_Command2SmallHover, 146cdf0e10cSrcweir Icon_Command2BLarge, 147cdf0e10cSrcweir Icon_Command2BLargeHover, 148cdf0e10cSrcweir Icon_Command2BMedium, 149cdf0e10cSrcweir Icon_Command2BMediumHover, 150cdf0e10cSrcweir Icon_Command2BSmall, 151cdf0e10cSrcweir Icon_Command2BSmallHover, 152cdf0e10cSrcweir Icon_Command3Large, 153cdf0e10cSrcweir Icon_Command3LargeHover, 154cdf0e10cSrcweir Icon_Command3Medium, 155cdf0e10cSrcweir Icon_Command3MediumHover, 156cdf0e10cSrcweir Icon_Command3Small, 157cdf0e10cSrcweir Icon_Command3SmallHover, 158cdf0e10cSrcweir _IconType_Size_ 159cdf0e10cSrcweir }; 160cdf0e10cSrcweir const BitmapEx& GetIcon (const IconType eType); 161cdf0e10cSrcweir 162cdf0e10cSrcweir enum IntegerValueType 163cdf0e10cSrcweir { 164cdf0e10cSrcweir Integer_ButtonCornerRadius, 165cdf0e10cSrcweir Integer_ButtonMaxAlpha, 166cdf0e10cSrcweir Integer_ButtonBarMaxAlpha, 167cdf0e10cSrcweir Integer_ButtonPaintType, 168cdf0e10cSrcweir Integer_ButtonBorder, 169cdf0e10cSrcweir Integer_ButtonGap, 170cdf0e10cSrcweir Integer_ButtonFadeInDelay, 171cdf0e10cSrcweir Integer_ButtonFadeInDuration, 172cdf0e10cSrcweir Integer_ButtonFadeOutDelay, 173cdf0e10cSrcweir Integer_ButtonFadeOutDuration, 174cdf0e10cSrcweir Integer_ToolTipDelay, 175cdf0e10cSrcweir Integer_FocusIndicatorWidth, 176cdf0e10cSrcweir _IntegerValueType_Size_ 177cdf0e10cSrcweir }; 178cdf0e10cSrcweir sal_Int32 GetIntegerValue (const IntegerValueType eType) const; 179cdf0e10cSrcweir void SetIntegerValue (const IntegerValueType eType, const sal_Int32 nValue); 180cdf0e10cSrcweir 181cdf0e10cSrcweir enum StringType 182cdf0e10cSrcweir { 183cdf0e10cSrcweir String_Unhide, 184cdf0e10cSrcweir String_DragAndDropPages, 185cdf0e10cSrcweir String_DragAndDropSlides, 186cdf0e10cSrcweir String_Command1, 187cdf0e10cSrcweir String_Command2, 188cdf0e10cSrcweir String_Command2B, 189cdf0e10cSrcweir String_Command3, 190cdf0e10cSrcweir _StringType_Size_ 191cdf0e10cSrcweir }; 192cdf0e10cSrcweir ::rtl::OUString GetString (const StringType eType) const; 193cdf0e10cSrcweir 194cdf0e10cSrcweir private: 195cdf0e10cSrcweir bool mbIsHighContrastMode; 196cdf0e10cSrcweir class GradientDescriptor 197cdf0e10cSrcweir { 198cdf0e10cSrcweir public: 199cdf0e10cSrcweir ColorData maBaseColor; 200cdf0e10cSrcweir 201cdf0e10cSrcweir sal_Int32 mnSaturationOverride; 202cdf0e10cSrcweir sal_Int32 mnBrightnessOverride; 203cdf0e10cSrcweir 204cdf0e10cSrcweir ColorData maFillColor1; 205cdf0e10cSrcweir ColorData maFillColor2; 206cdf0e10cSrcweir ColorData maBorderColor1; 207cdf0e10cSrcweir ColorData maBorderColor2; 208cdf0e10cSrcweir 209cdf0e10cSrcweir sal_Int32 mnFillOffset1; 210cdf0e10cSrcweir sal_Int32 mnFillOffset2; 211cdf0e10cSrcweir sal_Int32 mnBorderOffset1; 212cdf0e10cSrcweir sal_Int32 mnBorderOffset2; 213cdf0e10cSrcweir }; 214cdf0e10cSrcweir ColorData maBackgroundColor; 215cdf0e10cSrcweir ColorData maPageBackgroundColor; 216cdf0e10cSrcweir ::std::vector<GradientDescriptor> maGradients; 217cdf0e10cSrcweir ::std::vector<BitmapEx> maIcons; 218cdf0e10cSrcweir ::std::vector<ColorData> maColor; 219cdf0e10cSrcweir ::std::vector<sal_Int32> maIntegerValues; 220cdf0e10cSrcweir ::std::vector<rtl::OUString> maStrings; 221cdf0e10cSrcweir 222cdf0e10cSrcweir GradientDescriptor& GetGradient (const GradientColorType eType); 223cdf0e10cSrcweir /** Guarded initialization of the specified icon in the maIcons 224cdf0e10cSrcweir container. Call only while a LocalResource object is active. 225cdf0e10cSrcweir */ 226cdf0e10cSrcweir void InitializeIcon (const IconType eType, sal_uInt16 nResourceId); 227cdf0e10cSrcweir }; 228cdf0e10cSrcweir 229cdf0e10cSrcweir 230cdf0e10cSrcweir } } } // end of namespace ::sd::slidesorter::view 231cdf0e10cSrcweir 232cdf0e10cSrcweir #endif 233