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 22ed484612SMatthias Seidel 23ed484612SMatthias Seidel 24ff12d537SAndre Fischer #include "precompiled_sfx2.hxx" 25ff12d537SAndre Fischer 26b9e67834SAndre Fischer #include "sfx2/sidebar/Theme.hxx" 27ff12d537SAndre Fischer #include "Paint.hxx" 28ff12d537SAndre Fischer #include "SidebarResource.hxx" 29f35c6d02SAndre Fischer #include "sfx2/sidebar/Tools.hxx" 30ff12d537SAndre Fischer 31b9e67834SAndre Fischer #include <tools/svborder.hxx> 32ff12d537SAndre Fischer #include <tools/rc.hxx> 33ff12d537SAndre Fischer #include <vcl/svapp.hxx> 34ff12d537SAndre Fischer 35b9e67834SAndre Fischer using namespace css; 36b9e67834SAndre Fischer using namespace cssu; 37b9e67834SAndre Fischer 38ff12d537SAndre Fischer 39ff12d537SAndre Fischer namespace sfx2 { namespace sidebar { 40ff12d537SAndre Fischer 41b9e67834SAndre Fischer ::rtl::Reference<Theme> Theme::mpInstance; 42ff12d537SAndre Fischer 43b9e67834SAndre Fischer 44b9e67834SAndre Fischer 45b9e67834SAndre Fischer 46b9e67834SAndre Fischer Theme& Theme::GetCurrentTheme (void) 47ff12d537SAndre Fischer { 48b9e67834SAndre Fischer if ( ! mpInstance.is()) 49ff12d537SAndre Fischer { 50b9e67834SAndre Fischer mpInstance.set(new Theme()); 51b9e67834SAndre Fischer mpInstance->InitializeTheme(); 52ff12d537SAndre Fischer } 53b9e67834SAndre Fischer return *mpInstance; 54ff12d537SAndre Fischer } 55ff12d537SAndre Fischer 56ff12d537SAndre Fischer 57ff12d537SAndre Fischer 58ff12d537SAndre Fischer 59b9e67834SAndre Fischer Theme::Theme (void) 60b9e67834SAndre Fischer : ThemeInterfaceBase(m_aMutex), 61b9e67834SAndre Fischer maImages(), 62b9e67834SAndre Fischer maColors(), 63b9e67834SAndre Fischer maPaints(), 64b9e67834SAndre Fischer maIntegers(), 65b9e67834SAndre Fischer maBooleans(), 66b9e67834SAndre Fischer mbIsHighContrastMode(Application::GetSettings().GetStyleSettings().GetHighContrastMode()), 6795a18594SAndre Fischer mbIsHighContrastModeSetManually(false), 68b9e67834SAndre Fischer maPropertyNameToIdMap(), 69b9e67834SAndre Fischer maPropertyIdToNameMap(), 70b9e67834SAndre Fischer maRawValues(), 71b9e67834SAndre Fischer maChangeListeners(), 72b9e67834SAndre Fischer maVetoableListeners() 73b9e67834SAndre Fischer 74ff12d537SAndre Fischer { 75b9e67834SAndre Fischer SetupPropertyMaps(); 76ff12d537SAndre Fischer } 77ff12d537SAndre Fischer 78ff12d537SAndre Fischer 79ff12d537SAndre Fischer 80ff12d537SAndre Fischer 81b9e67834SAndre Fischer Theme::~Theme (void) 82ff12d537SAndre Fischer { 83ff12d537SAndre Fischer } 84ff12d537SAndre Fischer 85ff12d537SAndre Fischer 86ff12d537SAndre Fischer 87ff12d537SAndre Fischer 88b9e67834SAndre Fischer Image Theme::GetImage (const ThemeItem eItem) 89ff12d537SAndre Fischer { 90b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(eItem)); 91b9e67834SAndre Fischer OSL_ASSERT(eType==PT_Image); 92b9e67834SAndre Fischer const sal_Int32 nIndex (GetIndex(eItem, eType)); 93b9e67834SAndre Fischer const Theme& rTheme (GetCurrentTheme()); 94b9e67834SAndre Fischer return rTheme.maImages[nIndex]; 95ff12d537SAndre Fischer } 96ff12d537SAndre Fischer 97ff12d537SAndre Fischer 98ff12d537SAndre Fischer 99ff12d537SAndre Fischer 100b9e67834SAndre Fischer Color Theme::GetColor (const ThemeItem eItem) 101ff12d537SAndre Fischer { 102b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(eItem)); 1038dcb2a10SAndre Fischer OSL_ASSERT(eType==PT_Color || eType==PT_Paint); 104b9e67834SAndre Fischer const sal_Int32 nIndex (GetIndex(eItem, eType)); 105b9e67834SAndre Fischer const Theme& rTheme (GetCurrentTheme()); 1068dcb2a10SAndre Fischer if (eType == PT_Color) 107b9e67834SAndre Fischer return rTheme.maColors[nIndex]; 1088dcb2a10SAndre Fischer else if (eType == PT_Paint) 1098dcb2a10SAndre Fischer return rTheme.maPaints[nIndex].GetColor(); 110f120fe41SAndre Fischer else 111f120fe41SAndre Fischer return COL_WHITE; 112ff12d537SAndre Fischer } 113ff12d537SAndre Fischer 114ff12d537SAndre Fischer 115ff12d537SAndre Fischer 116ff12d537SAndre Fischer 117b9e67834SAndre Fischer const Paint& Theme::GetPaint (const ThemeItem eItem) 118ff12d537SAndre Fischer { 119b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(eItem)); 120b9e67834SAndre Fischer OSL_ASSERT(eType==PT_Paint); 121b9e67834SAndre Fischer const sal_Int32 nIndex (GetIndex(eItem, eType)); 122b9e67834SAndre Fischer const Theme& rTheme (GetCurrentTheme()); 123b9e67834SAndre Fischer return rTheme.maPaints[nIndex]; 124ff12d537SAndre Fischer } 125ff12d537SAndre Fischer 126ff12d537SAndre Fischer 127ff12d537SAndre Fischer 128ff12d537SAndre Fischer 1297a32b0c8SAndre Fischer const Wallpaper Theme::GetWallpaper (const ThemeItem eItem) 1307a32b0c8SAndre Fischer { 1317a32b0c8SAndre Fischer return GetPaint(eItem).GetWallpaper(); 1327a32b0c8SAndre Fischer } 1337a32b0c8SAndre Fischer 1347a32b0c8SAndre Fischer 1357a32b0c8SAndre Fischer 1367a32b0c8SAndre Fischer 137b9e67834SAndre Fischer sal_Int32 Theme::GetInteger (const ThemeItem eItem) 138ff12d537SAndre Fischer { 139b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(eItem)); 140b9e67834SAndre Fischer OSL_ASSERT(eType==PT_Integer); 141b9e67834SAndre Fischer const sal_Int32 nIndex (GetIndex(eItem, eType)); 142b9e67834SAndre Fischer const Theme& rTheme (GetCurrentTheme()); 143b9e67834SAndre Fischer return rTheme.maIntegers[nIndex]; 144ff12d537SAndre Fischer } 145ff12d537SAndre Fischer 146ff12d537SAndre Fischer 147ff12d537SAndre Fischer 148ff12d537SAndre Fischer 149b9e67834SAndre Fischer bool Theme::GetBoolean (const ThemeItem eItem) 150ff12d537SAndre Fischer { 151b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(eItem)); 152b9e67834SAndre Fischer OSL_ASSERT(eType==PT_Boolean); 153b9e67834SAndre Fischer const sal_Int32 nIndex (GetIndex(eItem, eType)); 154b9e67834SAndre Fischer const Theme& rTheme (GetCurrentTheme()); 155b9e67834SAndre Fischer return rTheme.maBooleans[nIndex]; 156ff12d537SAndre Fischer } 157ff12d537SAndre Fischer 158ff12d537SAndre Fischer 159ff12d537SAndre Fischer 160ff12d537SAndre Fischer 16195a18594SAndre Fischer Rectangle Theme::GetRectangle (const ThemeItem eItem) 16295a18594SAndre Fischer { 16395a18594SAndre Fischer const PropertyType eType (GetPropertyType(eItem)); 16495a18594SAndre Fischer OSL_ASSERT(eType==PT_Rectangle); 16595a18594SAndre Fischer const sal_Int32 nIndex (GetIndex(eItem, eType)); 16695a18594SAndre Fischer const Theme& rTheme (GetCurrentTheme()); 16795a18594SAndre Fischer return rTheme.maRectangles[nIndex]; 16895a18594SAndre Fischer } 16995a18594SAndre Fischer 17095a18594SAndre Fischer 17195a18594SAndre Fischer 17295a18594SAndre Fischer 173ff12d537SAndre Fischer bool Theme::IsHighContrastMode (void) 174ff12d537SAndre Fischer { 175b9e67834SAndre Fischer const Theme& rTheme (GetCurrentTheme()); 176b9e67834SAndre Fischer return rTheme.mbIsHighContrastMode; 177ff12d537SAndre Fischer } 178ff12d537SAndre Fischer 179ff12d537SAndre Fischer 180ff12d537SAndre Fischer 181ff12d537SAndre Fischer 182ff12d537SAndre Fischer void Theme::HandleDataChange (void) 183ff12d537SAndre Fischer { 18495a18594SAndre Fischer Theme& rTheme (GetCurrentTheme()); 18595a18594SAndre Fischer 18695a18594SAndre Fischer if ( ! rTheme.mbIsHighContrastModeSetManually) 18795a18594SAndre Fischer { 18895a18594SAndre Fischer // Do not modify mbIsHighContrastMode when it was manually set. 189b9e67834SAndre Fischer GetCurrentTheme().mbIsHighContrastMode = Application::GetSettings().GetStyleSettings().GetHighContrastMode(); 19095a18594SAndre Fischer rTheme.maRawValues[Bool_IsHighContrastModeActive] = Any(GetCurrentTheme().mbIsHighContrastMode); 19195a18594SAndre Fischer } 19295a18594SAndre Fischer 19395a18594SAndre Fischer GetCurrentTheme().UpdateTheme(); 194ff12d537SAndre Fischer } 195ff12d537SAndre Fischer 196ff12d537SAndre Fischer 197ff12d537SAndre Fischer 198ff12d537SAndre Fischer 199b9e67834SAndre Fischer void Theme::InitializeTheme (void) 200ff12d537SAndre Fischer { 20195a18594SAndre Fischer setPropertyValue( 20295a18594SAndre Fischer maPropertyIdToNameMap[Bool_UseSymphonyIcons], 2030d805bddSAndre Fischer Any(false)); 20495a18594SAndre Fischer setPropertyValue( 20595a18594SAndre Fischer maPropertyIdToNameMap[Bool_UseSystemColors], 20695a18594SAndre Fischer Any(false)); 20795a18594SAndre Fischer } 20895a18594SAndre Fischer 20995a18594SAndre Fischer 21095a18594SAndre Fischer 21195a18594SAndre Fischer 21295a18594SAndre Fischer void Theme::UpdateTheme (void) 21395a18594SAndre Fischer { 214ff12d537SAndre Fischer SidebarResource aLocalResource; 215ff12d537SAndre Fischer 216b9e67834SAndre Fischer try 217b9e67834SAndre Fischer { 21895a18594SAndre Fischer const StyleSettings& rStyle (Application::GetSettings().GetStyleSettings()); 21995a18594SAndre Fischer const bool bUseSystemColors (GetBoolean(Bool_UseSystemColors)); 22095a18594SAndre Fischer 22195a18594SAndre Fischer #define Alternatives(n,hc,sys) (mbIsHighContrastMode ? hc : (bUseSystemColors ? sys : n)) 22295a18594SAndre Fischer 223df0345d7SAndre Fischer Color aBaseBackgroundColor (rStyle.GetDialogColor()); 224df0345d7SAndre Fischer // UX says this should be a little brighter, but that looks off when compared to the other windows. 225df0345d7SAndre Fischer //aBaseBackgroundColor.IncreaseLuminance(7); 2268dcb2a10SAndre Fischer Color aBorderColor (aBaseBackgroundColor); 2278dcb2a10SAndre Fischer aBorderColor.DecreaseLuminance(15); 2288dcb2a10SAndre Fischer Color aSecondColor (aBaseBackgroundColor); 2298dcb2a10SAndre Fischer aSecondColor.DecreaseLuminance(15); 2308dcb2a10SAndre Fischer 231b9e67834SAndre Fischer setPropertyValue( 232b9e67834SAndre Fischer maPropertyIdToNameMap[Paint_DeckBackground], 233df0345d7SAndre Fischer Any(sal_Int32(aBaseBackgroundColor.GetRGBColor()))); 23495a18594SAndre Fischer 235b9e67834SAndre Fischer setPropertyValue( 236b9e67834SAndre Fischer maPropertyIdToNameMap[Paint_DeckTitleBarBackground], 2378dcb2a10SAndre Fischer Any(sal_Int32(aBaseBackgroundColor.GetRGBColor()))); 238b9e67834SAndre Fischer setPropertyValue( 239b9e67834SAndre Fischer maPropertyIdToNameMap[Int_DeckLeftPadding], 240b9e67834SAndre Fischer Any(sal_Int32(2))); 241b9e67834SAndre Fischer setPropertyValue( 242b9e67834SAndre Fischer maPropertyIdToNameMap[Int_DeckTopPadding], 243b9e67834SAndre Fischer Any(sal_Int32(2))); 244b9e67834SAndre Fischer setPropertyValue( 245b9e67834SAndre Fischer maPropertyIdToNameMap[Int_DeckRightPadding], 246b9e67834SAndre Fischer Any(sal_Int32(2))); 247b9e67834SAndre Fischer setPropertyValue( 248b9e67834SAndre Fischer maPropertyIdToNameMap[Int_DeckBottomPadding], 249b9e67834SAndre Fischer Any(sal_Int32(2))); 250b9e67834SAndre Fischer setPropertyValue( 251b9e67834SAndre Fischer maPropertyIdToNameMap[Int_DeckBorderSize], 252b9e67834SAndre Fischer Any(sal_Int32(1))); 253b9e67834SAndre Fischer setPropertyValue( 254b9e67834SAndre Fischer maPropertyIdToNameMap[Int_DeckSeparatorHeight], 255b9e67834SAndre Fischer Any(sal_Int32(1))); 256b9e67834SAndre Fischer setPropertyValue( 25737fee4fdSAndre Fischer maPropertyIdToNameMap[Int_ButtonCornerRadius], 25837fee4fdSAndre Fischer Any(sal_Int32(3))); 25937fee4fdSAndre Fischer setPropertyValue( 260b9e67834SAndre Fischer maPropertyIdToNameMap[Color_DeckTitleFont], 2618dcb2a10SAndre Fischer Any(sal_Int32(rStyle.GetFontColor().GetRGBColor()))); 262b9e67834SAndre Fischer setPropertyValue( 263b9e67834SAndre Fischer maPropertyIdToNameMap[Int_DeckTitleBarHeight], 26495a18594SAndre Fischer Any(sal_Int32(Alternatives( 26595a18594SAndre Fischer 26, 26695a18594SAndre Fischer 26, 26795a18594SAndre Fischer rStyle.GetFloatTitleHeight())))); 268b9e67834SAndre Fischer setPropertyValue( 269b9e67834SAndre Fischer maPropertyIdToNameMap[Paint_PanelBackground], 270df0345d7SAndre Fischer Any(sal_Int32(aBaseBackgroundColor.GetRGBColor()))); 2718dcb2a10SAndre Fischer 272b9e67834SAndre Fischer setPropertyValue( 273b9e67834SAndre Fischer maPropertyIdToNameMap[Paint_PanelTitleBarBackground], 2748dcb2a10SAndre Fischer Any(Tools::VclToAwtGradient(Gradient( 2758dcb2a10SAndre Fischer GRADIENT_LINEAR, 2768dcb2a10SAndre Fischer aSecondColor.GetRGBColor(), 2778dcb2a10SAndre Fischer aBaseBackgroundColor.GetRGBColor() 2788dcb2a10SAndre Fischer )))); 279b9e67834SAndre Fischer setPropertyValue( 280b9e67834SAndre Fischer maPropertyIdToNameMap[Color_PanelTitleFont], 281b9e67834SAndre Fischer Any(sal_Int32(mbIsHighContrastMode ? 0x00ff00 : 0x262626))); 282b9e67834SAndre Fischer setPropertyValue( 283b9e67834SAndre Fischer maPropertyIdToNameMap[Int_PanelTitleBarHeight], 28495a18594SAndre Fischer Any(sal_Int32(Alternatives( 28595a18594SAndre Fischer 26, 28695a18594SAndre Fischer 26, 28795a18594SAndre Fischer rStyle.GetTitleHeight())))); 288b9e67834SAndre Fischer setPropertyValue( 289b9e67834SAndre Fischer maPropertyIdToNameMap[Paint_TabBarBackground], 2908dcb2a10SAndre Fischer Any(sal_Int32(aBaseBackgroundColor.GetRGBColor()))); 291b9e67834SAndre Fischer setPropertyValue( 292b9e67834SAndre Fischer maPropertyIdToNameMap[Int_TabBarLeftPadding], 293b9e67834SAndre Fischer Any(sal_Int32(2))); 294b9e67834SAndre Fischer setPropertyValue( 295b9e67834SAndre Fischer maPropertyIdToNameMap[Int_TabBarTopPadding], 296b9e67834SAndre Fischer Any(sal_Int32(2))); 297b9e67834SAndre Fischer setPropertyValue( 298b9e67834SAndre Fischer maPropertyIdToNameMap[Int_TabBarRightPadding], 299b9e67834SAndre Fischer Any(sal_Int32(2))); 300b9e67834SAndre Fischer setPropertyValue( 301b9e67834SAndre Fischer maPropertyIdToNameMap[Int_TabBarBottomPadding], 302b9e67834SAndre Fischer Any(sal_Int32(2))); 303ff12d537SAndre Fischer 304b9e67834SAndre Fischer setPropertyValue( 305b9e67834SAndre Fischer maPropertyIdToNameMap[Int_TabMenuPadding], 306b9e67834SAndre Fischer Any(sal_Int32(6))); 307b9e67834SAndre Fischer setPropertyValue( 308b9e67834SAndre Fischer maPropertyIdToNameMap[Color_TabMenuSeparator], 3098dcb2a10SAndre Fischer Any(sal_Int32(aBorderColor.GetRGBColor()))); 310b9e67834SAndre Fischer setPropertyValue( 311b9e67834SAndre Fischer maPropertyIdToNameMap[Int_TabMenuSeparatorPadding], 312b9e67834SAndre Fischer Any(sal_Int32(7))); 313ff12d537SAndre Fischer 314b9e67834SAndre Fischer setPropertyValue( 315b9e67834SAndre Fischer maPropertyIdToNameMap[Int_TabItemWidth], 316b9e67834SAndre Fischer Any(sal_Int32(32))); 317b9e67834SAndre Fischer setPropertyValue( 318b9e67834SAndre Fischer maPropertyIdToNameMap[Int_TabItemHeight], 319b9e67834SAndre Fischer Any(sal_Int32(32))); 320b9e67834SAndre Fischer setPropertyValue( 321b9e67834SAndre Fischer maPropertyIdToNameMap[Color_TabItemBorder], 3228dcb2a10SAndre Fischer Any(sal_Int32(rStyle.GetActiveBorderColor().GetRGBColor()))); 3238dcb2a10SAndre Fischer // mbIsHighContrastMode ? 0x00ff00 : 0xbfbfbf))); 3248dcb2a10SAndre Fischer 3258dcb2a10SAndre Fischer setPropertyValue( 3268dcb2a10SAndre Fischer maPropertyIdToNameMap[Paint_DropDownBackground], 3278dcb2a10SAndre Fischer Any(sal_Int32(aBaseBackgroundColor.GetRGBColor()))); 3288dcb2a10SAndre Fischer setPropertyValue( 3298dcb2a10SAndre Fischer maPropertyIdToNameMap[Color_DropDownBorder], 3308dcb2a10SAndre Fischer Any(sal_Int32(rStyle.GetActiveBorderColor().GetRGBColor()))); 3318dcb2a10SAndre Fischer 332b9e67834SAndre Fischer setPropertyValue( 3335f1c83ffSOliver-Rainer Wittmann maPropertyIdToNameMap[Color_Highlight], 3345f1c83ffSOliver-Rainer Wittmann Any(sal_Int32(rStyle.GetHighlightColor().GetRGBColor()))); 3355f1c83ffSOliver-Rainer Wittmann setPropertyValue( 3365f1c83ffSOliver-Rainer Wittmann maPropertyIdToNameMap[Color_HighlightText], 3375f1c83ffSOliver-Rainer Wittmann Any(sal_Int32(rStyle.GetHighlightTextColor().GetRGBColor()))); 3385f1c83ffSOliver-Rainer Wittmann 3395f1c83ffSOliver-Rainer Wittmann setPropertyValue( 34095a18594SAndre Fischer maPropertyIdToNameMap[Paint_TabItemBackgroundNormal], 34195a18594SAndre Fischer Any()); 34295a18594SAndre Fischer setPropertyValue( 34395a18594SAndre Fischer maPropertyIdToNameMap[Paint_TabItemBackgroundHighlight], 3448dcb2a10SAndre Fischer Any(sal_Int32(rStyle.GetActiveTabColor().GetRGBColor()))); 3458dcb2a10SAndre Fischer // mbIsHighContrastMode ? 0x000000 : 0x00ffffff))); 346ff12d537SAndre Fischer 347b9e67834SAndre Fischer setPropertyValue( 348b9e67834SAndre Fischer maPropertyIdToNameMap[Paint_HorizontalBorder], 3498dcb2a10SAndre Fischer Any(sal_Int32(aBorderColor.GetRGBColor()))); 3508dcb2a10SAndre Fischer // mbIsHighContrastMode ? 0x00ff00 : 0xe4e4e4))); 351b9e67834SAndre Fischer setPropertyValue( 352b9e67834SAndre Fischer maPropertyIdToNameMap[Paint_VerticalBorder], 3538dcb2a10SAndre Fischer Any(sal_Int32(aBorderColor.GetRGBColor()))); 3548dcb2a10SAndre Fischer // mbIsHighContrastMode ? 0x00ff00 : 0xe4e4e4))); 355ff12d537SAndre Fischer 356b9e67834SAndre Fischer setPropertyValue( 357b9e67834SAndre Fischer maPropertyIdToNameMap[Image_Grip], 358b9e67834SAndre Fischer Any( 359b9e67834SAndre Fischer mbIsHighContrastMode 360b9e67834SAndre Fischer ? A2S("private:graphicrepository/sfx2/res/grip_hc.png") 361b9e67834SAndre Fischer : A2S("private:graphicrepository/sfx2/res/grip.png"))); 362b9e67834SAndre Fischer setPropertyValue( 363b9e67834SAndre Fischer maPropertyIdToNameMap[Image_Expand], 364b9e67834SAndre Fischer Any( 365b9e67834SAndre Fischer mbIsHighContrastMode 3666e6252f3SAndre Fischer ? A2S("private:graphicrepository/res/plus_sch.png") 3676e6252f3SAndre Fischer : A2S("private:graphicrepository/res/plus.png"))); 368b9e67834SAndre Fischer setPropertyValue( 369b9e67834SAndre Fischer maPropertyIdToNameMap[Image_Collapse], 370b9e67834SAndre Fischer Any( 371b9e67834SAndre Fischer mbIsHighContrastMode 3726e6252f3SAndre Fischer ? A2S("private:graphicrepository/res/minus_sch.png") 3736e6252f3SAndre Fischer : A2S("private:graphicrepository/res/minus.png"))); 374b9e67834SAndre Fischer setPropertyValue( 3757a32b0c8SAndre Fischer maPropertyIdToNameMap[Image_TabBarMenu], 376b9e67834SAndre Fischer Any( 377b9e67834SAndre Fischer mbIsHighContrastMode 378ed484612SMatthias Seidel ? A2S("private:graphicrepository/sfx2/res/symphony/open_more_hc.png") 3796e6252f3SAndre Fischer : A2S("private:graphicrepository/sfx2/res/symphony/open_more.png"))); 380b9e67834SAndre Fischer setPropertyValue( 3817a32b0c8SAndre Fischer maPropertyIdToNameMap[Image_PanelMenu], 3827a32b0c8SAndre Fischer Any( 3837a32b0c8SAndre Fischer mbIsHighContrastMode 384*4e5e52c9SMatthias Seidel ? A2S("private:graphicrepository/sfx2/res/symphony/morebutton_h.png") 385*4e5e52c9SMatthias Seidel : A2S("private:graphicrepository/sfx2/res/symphony/morebutton.png"))); 3867a32b0c8SAndre Fischer setPropertyValue( 3877a32b0c8SAndre Fischer maPropertyIdToNameMap[Image_Closer], 3887a32b0c8SAndre Fischer Any(A2S("private:graphicrepository/sfx2/res/closedoc.png"))); 3897a32b0c8SAndre Fischer setPropertyValue( 39013e1c3b4SAndre Fischer maPropertyIdToNameMap[Image_CloseIndicator], 39113e1c3b4SAndre Fischer Any( 39213e1c3b4SAndre Fischer mbIsHighContrastMode 39313e1c3b4SAndre Fischer ? A2S("private:graphicrepository/res/commandimagelist/lch_decrementlevel.png") 39413e1c3b4SAndre Fischer : A2S("private:graphicrepository/res/commandimagelist/lc_decrementlevel.png"))); 39513e1c3b4SAndre Fischer setPropertyValue( 39695a18594SAndre Fischer maPropertyIdToNameMap[Image_ToolBoxItemSeparator], 39795a18594SAndre Fischer Any( 39895a18594SAndre Fischer A2S("private:graphicrepository/sfx2/res/separator.png"))); 39995a18594SAndre Fischer 40095a18594SAndre Fischer // ToolBox 4018dcb2a10SAndre Fischer 4028dcb2a10SAndre Fischer /* 4038dcb2a10SAndre Fischer // Separator style 4048dcb2a10SAndre Fischer setPropertyValue( 4058dcb2a10SAndre Fischer maPropertyIdToNameMap[Paint_ToolBoxBackground], 4068dcb2a10SAndre Fischer Any(sal_Int32(rStyle.GetMenuColor().GetRGBColor()))); 4078dcb2a10SAndre Fischer setPropertyValue( 4088dcb2a10SAndre Fischer maPropertyIdToNameMap[Paint_ToolBoxBorderTopLeft], 4098dcb2a10SAndre Fischer Any()); 4108dcb2a10SAndre Fischer setPropertyValue( 4118dcb2a10SAndre Fischer maPropertyIdToNameMap[Paint_ToolBoxBorderCenterCorners], 4128dcb2a10SAndre Fischer Any()); 4138dcb2a10SAndre Fischer setPropertyValue( 4148dcb2a10SAndre Fischer maPropertyIdToNameMap[Paint_ToolBoxBorderBottomRight], 4158dcb2a10SAndre Fischer Any()); 4168dcb2a10SAndre Fischer setPropertyValue( 4178dcb2a10SAndre Fischer maPropertyIdToNameMap[Rect_ToolBoxPadding], 4188dcb2a10SAndre Fischer Any(awt::Rectangle(2,2,2,2))); 4198dcb2a10SAndre Fischer setPropertyValue( 4208dcb2a10SAndre Fischer maPropertyIdToNameMap[Rect_ToolBoxBorder], 4218dcb2a10SAndre Fischer Any(awt::Rectangle(0,0,0,0))); 4228dcb2a10SAndre Fischer setPropertyValue( 4238dcb2a10SAndre Fischer maPropertyIdToNameMap[Bool_UseToolBoxItemSeparator], 4248dcb2a10SAndre Fischer Any(true)); 4258dcb2a10SAndre Fischer 4268dcb2a10SAndre Fischer */ 4278dcb2a10SAndre Fischer 4288dcb2a10SAndre Fischer // Gradient style 4292b6825c7SAndre Fischer Color aGradientStop2 (aBaseBackgroundColor); 4302b6825c7SAndre Fischer aGradientStop2.IncreaseLuminance(17); 4312b6825c7SAndre Fischer Color aToolBoxBorderColor (aBaseBackgroundColor); 4322b6825c7SAndre Fischer aToolBoxBorderColor.DecreaseLuminance(12); 43395a18594SAndre Fischer setPropertyValue( 43495a18594SAndre Fischer maPropertyIdToNameMap[Paint_ToolBoxBackground], 43595a18594SAndre Fischer Any(Tools::VclToAwtGradient(Gradient( 43695a18594SAndre Fischer GRADIENT_LINEAR, 4372b6825c7SAndre Fischer aBaseBackgroundColor.GetRGBColor(), 4382b6825c7SAndre Fischer aGradientStop2.GetRGBColor() 43995a18594SAndre Fischer )))); 44095a18594SAndre Fischer setPropertyValue( 44195a18594SAndre Fischer maPropertyIdToNameMap[Paint_ToolBoxBorderTopLeft], 44295a18594SAndre Fischer mbIsHighContrastMode 44395a18594SAndre Fischer ? Any(util::Color(sal_uInt32(0x00ff00))) 4442b6825c7SAndre Fischer : Any(util::Color(aToolBoxBorderColor.GetRGBColor()))); 44595a18594SAndre Fischer setPropertyValue( 44695a18594SAndre Fischer maPropertyIdToNameMap[Paint_ToolBoxBorderCenterCorners], 44795a18594SAndre Fischer mbIsHighContrastMode 44895a18594SAndre Fischer ? Any(util::Color(sal_uInt32(0x00ff00))) 4492b6825c7SAndre Fischer : Any(util::Color(aToolBoxBorderColor.GetRGBColor()))); 45095a18594SAndre Fischer setPropertyValue( 45195a18594SAndre Fischer maPropertyIdToNameMap[Paint_ToolBoxBorderBottomRight], 45295a18594SAndre Fischer mbIsHighContrastMode 45395a18594SAndre Fischer ? Any(util::Color(sal_uInt32(0x00ff00))) 4542b6825c7SAndre Fischer : Any(util::Color(aToolBoxBorderColor.GetRGBColor()))); 45595a18594SAndre Fischer setPropertyValue( 45695a18594SAndre Fischer maPropertyIdToNameMap[Rect_ToolBoxPadding], 45795a18594SAndre Fischer Any(awt::Rectangle(2,2,2,2))); 45895a18594SAndre Fischer setPropertyValue( 45995a18594SAndre Fischer maPropertyIdToNameMap[Rect_ToolBoxBorder], 46095a18594SAndre Fischer Any(awt::Rectangle(1,1,1,1))); 46195a18594SAndre Fischer setPropertyValue( 46295a18594SAndre Fischer maPropertyIdToNameMap[Bool_UseToolBoxItemSeparator], 46395a18594SAndre Fischer Any(false)); 464ff12d537SAndre Fischer } 46595a18594SAndre Fischer catch(beans::UnknownPropertyException& rException) 466b9e67834SAndre Fischer { 46795a18594SAndre Fischer OSL_TRACE("unknown property: %s", 46895a18594SAndre Fischer OUStringToOString( 46995a18594SAndre Fischer rException.Message, 47095a18594SAndre Fischer RTL_TEXTENCODING_ASCII_US).getStr()); 471b9e67834SAndre Fischer OSL_ASSERT(false); 472b9e67834SAndre Fischer } 473b9e67834SAndre Fischer } 474b9e67834SAndre Fischer 475b9e67834SAndre Fischer 476b9e67834SAndre Fischer 477b9e67834SAndre Fischer 478b9e67834SAndre Fischer void SAL_CALL Theme::disposing (void) 479b9e67834SAndre Fischer { 480b9e67834SAndre Fischer ChangeListeners aListeners; 481b9e67834SAndre Fischer maChangeListeners.swap(aListeners); 482b9e67834SAndre Fischer 483b9e67834SAndre Fischer const lang::EventObject aEvent (static_cast<XWeak*>(this)); 484b9e67834SAndre Fischer 485b9e67834SAndre Fischer for (ChangeListeners::const_iterator 486b9e67834SAndre Fischer iContainer(maChangeListeners.begin()), 487b9e67834SAndre Fischer iContainerEnd(maChangeListeners.end()); 488b9e67834SAndre Fischer iContainerEnd!=iContainerEnd; 489b9e67834SAndre Fischer ++iContainerEnd) 490b9e67834SAndre Fischer { 491b9e67834SAndre Fischer for (ChangeListenerContainer::const_iterator 492b9e67834SAndre Fischer iListener(iContainer->second.begin()), 493b9e67834SAndre Fischer iEnd(iContainer->second.end()); 494b9e67834SAndre Fischer iListener!=iEnd; 495b9e67834SAndre Fischer ++iListener) 496b9e67834SAndre Fischer { 497b9e67834SAndre Fischer try 498b9e67834SAndre Fischer { 499b9e67834SAndre Fischer (*iListener)->disposing(aEvent); 500b9e67834SAndre Fischer } 501b9e67834SAndre Fischer catch(const Exception&) 502b9e67834SAndre Fischer { 503b9e67834SAndre Fischer } 504b9e67834SAndre Fischer } 505b9e67834SAndre Fischer } 506b9e67834SAndre Fischer } 507b9e67834SAndre Fischer 508b9e67834SAndre Fischer 509b9e67834SAndre Fischer 510b9e67834SAndre Fischer 511b9e67834SAndre Fischer Reference<beans::XPropertySet> Theme::GetPropertySet (void) 512b9e67834SAndre Fischer { 513b9e67834SAndre Fischer return Reference<beans::XPropertySet>(static_cast<XWeak*>(&GetCurrentTheme()), UNO_QUERY); 514b9e67834SAndre Fischer } 515b9e67834SAndre Fischer 516b9e67834SAndre Fischer 517b9e67834SAndre Fischer 518b9e67834SAndre Fischer 519b9e67834SAndre Fischer Reference<beans::XPropertySetInfo> SAL_CALL Theme::getPropertySetInfo (void) 520b9e67834SAndre Fischer throw(cssu::RuntimeException) 521b9e67834SAndre Fischer { 52295a18594SAndre Fischer return Reference<beans::XPropertySetInfo>(this); 523b9e67834SAndre Fischer } 524b9e67834SAndre Fischer 525b9e67834SAndre Fischer 526b9e67834SAndre Fischer 527b9e67834SAndre Fischer 528b9e67834SAndre Fischer void SAL_CALL Theme::setPropertyValue ( 529b9e67834SAndre Fischer const ::rtl::OUString& rsPropertyName, 530b9e67834SAndre Fischer const cssu::Any& rValue) 531b9e67834SAndre Fischer throw(cssu::RuntimeException) 532b9e67834SAndre Fischer { 533b9e67834SAndre Fischer PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); 534b9e67834SAndre Fischer if (iId == maPropertyNameToIdMap.end()) 53595a18594SAndre Fischer throw beans::UnknownPropertyException(rsPropertyName, NULL); 536b9e67834SAndre Fischer 537b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(iId->second)); 538b9e67834SAndre Fischer if (eType == PT_Invalid) 53995a18594SAndre Fischer throw beans::UnknownPropertyException(rsPropertyName, NULL); 540b9e67834SAndre Fischer 541b9e67834SAndre Fischer const ThemeItem eItem (iId->second); 542b9e67834SAndre Fischer 543b9e67834SAndre Fischer if (rValue == maRawValues[eItem]) 544b9e67834SAndre Fischer { 545b9e67834SAndre Fischer // Value is not different from the one in the property 546b9e67834SAndre Fischer // set => nothing to do. 547b9e67834SAndre Fischer return; 548b9e67834SAndre Fischer } 549b9e67834SAndre Fischer 550b9e67834SAndre Fischer const Any aOldValue (maRawValues[eItem]); 551b9e67834SAndre Fischer 552b9e67834SAndre Fischer const beans::PropertyChangeEvent aEvent( 553b9e67834SAndre Fischer static_cast<XWeak*>(this), 554b9e67834SAndre Fischer rsPropertyName, 555b9e67834SAndre Fischer sal_False, 556b9e67834SAndre Fischer eItem, 557b9e67834SAndre Fischer aOldValue, 558b9e67834SAndre Fischer rValue); 559b9e67834SAndre Fischer 560b9e67834SAndre Fischer if (DoVetoableListenersVeto(GetVetoableListeners(__AnyItem, false), aEvent)) 561b9e67834SAndre Fischer return; 562b9e67834SAndre Fischer if (DoVetoableListenersVeto(GetVetoableListeners(eItem, false), aEvent)) 563b9e67834SAndre Fischer return; 564b9e67834SAndre Fischer 565b9e67834SAndre Fischer maRawValues[eItem] = rValue; 566b9e67834SAndre Fischer ProcessNewValue(rValue, eItem, eType); 567b9e67834SAndre Fischer 568b9e67834SAndre Fischer BroadcastPropertyChange(GetChangeListeners(__AnyItem, false), aEvent); 569b9e67834SAndre Fischer BroadcastPropertyChange(GetChangeListeners(eItem, false), aEvent); 570b9e67834SAndre Fischer } 571b9e67834SAndre Fischer 572b9e67834SAndre Fischer 573b9e67834SAndre Fischer 574b9e67834SAndre Fischer 575b9e67834SAndre Fischer Any SAL_CALL Theme::getPropertyValue ( 576b9e67834SAndre Fischer const ::rtl::OUString& rsPropertyName) 577b9e67834SAndre Fischer throw(css::beans::UnknownPropertyException, 578b9e67834SAndre Fischer css::lang::WrappedTargetException, 579b9e67834SAndre Fischer cssu::RuntimeException) 580b9e67834SAndre Fischer { 581b9e67834SAndre Fischer PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); 582b9e67834SAndre Fischer if (iId == maPropertyNameToIdMap.end()) 583b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 584b9e67834SAndre Fischer 585b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(iId->second)); 586b9e67834SAndre Fischer if (eType == PT_Invalid) 587b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 588b9e67834SAndre Fischer 589b9e67834SAndre Fischer const ThemeItem eItem (iId->second); 590b9e67834SAndre Fischer 591b9e67834SAndre Fischer return maRawValues[eItem]; 592b9e67834SAndre Fischer } 593b9e67834SAndre Fischer 594b9e67834SAndre Fischer 595b9e67834SAndre Fischer 596b9e67834SAndre Fischer 597b9e67834SAndre Fischer void SAL_CALL Theme::addPropertyChangeListener( 598b9e67834SAndre Fischer const ::rtl::OUString& rsPropertyName, 599b9e67834SAndre Fischer const cssu::Reference<css::beans::XPropertyChangeListener>& rxListener) 600b9e67834SAndre Fischer throw(css::beans::UnknownPropertyException, 601b9e67834SAndre Fischer css::lang::WrappedTargetException, 602b9e67834SAndre Fischer cssu::RuntimeException) 603b9e67834SAndre Fischer { 604b9e67834SAndre Fischer ThemeItem eItem (__AnyItem); 605b9e67834SAndre Fischer if (rsPropertyName.getLength() > 0) 606b9e67834SAndre Fischer { 607b9e67834SAndre Fischer PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); 608b9e67834SAndre Fischer if (iId == maPropertyNameToIdMap.end()) 609b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 610b9e67834SAndre Fischer 611b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(iId->second)); 612b9e67834SAndre Fischer if (eType == PT_Invalid) 613b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 614b9e67834SAndre Fischer 615b9e67834SAndre Fischer eItem = iId->second; 616b9e67834SAndre Fischer } 617b9e67834SAndre Fischer ChangeListenerContainer* pListeners = GetChangeListeners(eItem, true); 618b9e67834SAndre Fischer if (pListeners != NULL) 619b9e67834SAndre Fischer pListeners->push_back(rxListener); 620b9e67834SAndre Fischer } 621b9e67834SAndre Fischer 622b9e67834SAndre Fischer 623b9e67834SAndre Fischer 624b9e67834SAndre Fischer 625b9e67834SAndre Fischer void SAL_CALL Theme::removePropertyChangeListener( 626b9e67834SAndre Fischer const ::rtl::OUString& rsPropertyName, 627b9e67834SAndre Fischer const cssu::Reference<css::beans::XPropertyChangeListener>& rxListener) 628b9e67834SAndre Fischer throw(css::beans::UnknownPropertyException, 629b9e67834SAndre Fischer css::lang::WrappedTargetException, 630b9e67834SAndre Fischer cssu::RuntimeException) 631b9e67834SAndre Fischer { 632b9e67834SAndre Fischer ThemeItem eItem (__AnyItem); 633b9e67834SAndre Fischer if (rsPropertyName.getLength() > 0) 634b9e67834SAndre Fischer { 635b9e67834SAndre Fischer PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); 636b9e67834SAndre Fischer if (iId == maPropertyNameToIdMap.end()) 637b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 638b9e67834SAndre Fischer 639b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(iId->second)); 640b9e67834SAndre Fischer if (eType == PT_Invalid) 641b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 642b9e67834SAndre Fischer 643b9e67834SAndre Fischer eItem = iId->second; 644b9e67834SAndre Fischer } 645b9e67834SAndre Fischer ChangeListenerContainer* pContainer = GetChangeListeners(eItem, false); 646b9e67834SAndre Fischer if (pContainer != NULL) 647b9e67834SAndre Fischer { 648b9e67834SAndre Fischer ChangeListenerContainer::iterator iListener (::std::find(pContainer->begin(), pContainer->end(), rxListener)); 649b9e67834SAndre Fischer if (iListener != pContainer->end()) 650b9e67834SAndre Fischer { 651b9e67834SAndre Fischer pContainer->erase(iListener); 652b9e67834SAndre Fischer 653b9e67834SAndre Fischer // Remove the listener container when empty. 654b9e67834SAndre Fischer if (pContainer->empty()) 655b9e67834SAndre Fischer maChangeListeners.erase(eItem); 656b9e67834SAndre Fischer } 657b9e67834SAndre Fischer } 658b9e67834SAndre Fischer } 659b9e67834SAndre Fischer 660b9e67834SAndre Fischer 661b9e67834SAndre Fischer 662b9e67834SAndre Fischer 663b9e67834SAndre Fischer void SAL_CALL Theme::addVetoableChangeListener( 664b9e67834SAndre Fischer const ::rtl::OUString& rsPropertyName, 665b9e67834SAndre Fischer const cssu::Reference<css::beans::XVetoableChangeListener>& rxListener) 666b9e67834SAndre Fischer throw(css::beans::UnknownPropertyException, 667b9e67834SAndre Fischer css::lang::WrappedTargetException, 668b9e67834SAndre Fischer cssu::RuntimeException) 669b9e67834SAndre Fischer { 670b9e67834SAndre Fischer ThemeItem eItem (__AnyItem); 671b9e67834SAndre Fischer if (rsPropertyName.getLength() > 0) 672b9e67834SAndre Fischer { 673b9e67834SAndre Fischer PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); 674b9e67834SAndre Fischer if (iId == maPropertyNameToIdMap.end()) 675b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 676b9e67834SAndre Fischer 677b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(iId->second)); 678b9e67834SAndre Fischer if (eType == PT_Invalid) 679b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 680b9e67834SAndre Fischer 681b9e67834SAndre Fischer eItem = iId->second; 682b9e67834SAndre Fischer } 683b9e67834SAndre Fischer VetoableListenerContainer* pListeners = GetVetoableListeners(eItem, true); 684b9e67834SAndre Fischer if (pListeners != NULL) 685b9e67834SAndre Fischer pListeners->push_back(rxListener); 686b9e67834SAndre Fischer } 687b9e67834SAndre Fischer 688b9e67834SAndre Fischer 689b9e67834SAndre Fischer 690b9e67834SAndre Fischer 691b9e67834SAndre Fischer void SAL_CALL Theme::removeVetoableChangeListener( 692b9e67834SAndre Fischer const ::rtl::OUString& rsPropertyName, 693b9e67834SAndre Fischer const cssu::Reference<css::beans::XVetoableChangeListener>& rxListener) 694b9e67834SAndre Fischer throw(css::beans::UnknownPropertyException, 695b9e67834SAndre Fischer css::lang::WrappedTargetException, 696b9e67834SAndre Fischer cssu::RuntimeException) 697b9e67834SAndre Fischer { 698b9e67834SAndre Fischer ThemeItem eItem (__AnyItem); 699b9e67834SAndre Fischer if (rsPropertyName.getLength() > 0) 700b9e67834SAndre Fischer { 701b9e67834SAndre Fischer PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); 702b9e67834SAndre Fischer if (iId == maPropertyNameToIdMap.end()) 703b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 704b9e67834SAndre Fischer 705b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(iId->second)); 706b9e67834SAndre Fischer if (eType == PT_Invalid) 707b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 708b9e67834SAndre Fischer 709b9e67834SAndre Fischer eItem = iId->second; 710b9e67834SAndre Fischer } 711b9e67834SAndre Fischer VetoableListenerContainer* pContainer = GetVetoableListeners(eItem, false); 712b9e67834SAndre Fischer if (pContainer != NULL) 713b9e67834SAndre Fischer { 714b9e67834SAndre Fischer VetoableListenerContainer::iterator iListener (::std::find(pContainer->begin(), pContainer->end(), rxListener)); 715b9e67834SAndre Fischer if (iListener != pContainer->end()) 716b9e67834SAndre Fischer { 717b9e67834SAndre Fischer pContainer->erase(iListener); 718b9e67834SAndre Fischer // Remove container when empty. 719b9e67834SAndre Fischer if (pContainer->empty()) 720b9e67834SAndre Fischer maVetoableListeners.erase(eItem); 721b9e67834SAndre Fischer } 722b9e67834SAndre Fischer } 723b9e67834SAndre Fischer } 724b9e67834SAndre Fischer 725b9e67834SAndre Fischer 726b9e67834SAndre Fischer 727b9e67834SAndre Fischer 72895a18594SAndre Fischer cssu::Sequence<css::beans::Property> SAL_CALL Theme::getProperties (void) 72995a18594SAndre Fischer throw(cssu::RuntimeException) 73095a18594SAndre Fischer { 73195a18594SAndre Fischer ::std::vector<beans::Property> aProperties; 73295a18594SAndre Fischer 73395a18594SAndre Fischer for (sal_Int32 nItem(__Begin),nEnd(__End); nItem!=nEnd; ++nItem) 73495a18594SAndre Fischer { 73595a18594SAndre Fischer const ThemeItem eItem (static_cast<ThemeItem>(nItem)); 73695a18594SAndre Fischer const PropertyType eType (GetPropertyType(eItem)); 73795a18594SAndre Fischer if (eType == PT_Invalid) 73895a18594SAndre Fischer continue; 73995a18594SAndre Fischer 74095a18594SAndre Fischer const beans::Property aProperty( 74195a18594SAndre Fischer maPropertyIdToNameMap[eItem], 74295a18594SAndre Fischer eItem, 74395a18594SAndre Fischer GetCppuType(eType), 74495a18594SAndre Fischer 0); 74595a18594SAndre Fischer aProperties.push_back(aProperty); 74695a18594SAndre Fischer } 74795a18594SAndre Fischer 74895a18594SAndre Fischer return cssu::Sequence<css::beans::Property>( 74995a18594SAndre Fischer &aProperties.front(), 75095a18594SAndre Fischer aProperties.size()); 75195a18594SAndre Fischer } 75295a18594SAndre Fischer 75395a18594SAndre Fischer 75495a18594SAndre Fischer 75595a18594SAndre Fischer 75695a18594SAndre Fischer beans::Property SAL_CALL Theme::getPropertyByName (const ::rtl::OUString& rsPropertyName) 75795a18594SAndre Fischer throw(css::beans::UnknownPropertyException, 75895a18594SAndre Fischer cssu::RuntimeException) 75995a18594SAndre Fischer { 76095a18594SAndre Fischer PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); 76195a18594SAndre Fischer if (iId == maPropertyNameToIdMap.end()) 76295a18594SAndre Fischer throw beans::UnknownPropertyException(); 76395a18594SAndre Fischer 76495a18594SAndre Fischer const PropertyType eType (GetPropertyType(iId->second)); 76595a18594SAndre Fischer if (eType == PT_Invalid) 76695a18594SAndre Fischer throw beans::UnknownPropertyException(); 76795a18594SAndre Fischer 76895a18594SAndre Fischer const ThemeItem eItem (iId->second); 76995a18594SAndre Fischer 77095a18594SAndre Fischer return beans::Property( 77195a18594SAndre Fischer rsPropertyName, 77295a18594SAndre Fischer eItem, 77395a18594SAndre Fischer GetCppuType(eType), 77495a18594SAndre Fischer 0); 77595a18594SAndre Fischer } 77695a18594SAndre Fischer 77795a18594SAndre Fischer 77895a18594SAndre Fischer 77995a18594SAndre Fischer 78095a18594SAndre Fischer sal_Bool SAL_CALL Theme::hasPropertyByName (const ::rtl::OUString& rsPropertyName) 78195a18594SAndre Fischer throw(cssu::RuntimeException) 78295a18594SAndre Fischer { 78395a18594SAndre Fischer PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); 78495a18594SAndre Fischer if (iId == maPropertyNameToIdMap.end()) 78595a18594SAndre Fischer return sal_False; 78695a18594SAndre Fischer 78795a18594SAndre Fischer const PropertyType eType (GetPropertyType(iId->second)); 78895a18594SAndre Fischer if (eType == PT_Invalid) 78995a18594SAndre Fischer return sal_False; 79095a18594SAndre Fischer 79195a18594SAndre Fischer return sal_True; 79295a18594SAndre Fischer } 79395a18594SAndre Fischer 79495a18594SAndre Fischer 79595a18594SAndre Fischer 79695a18594SAndre Fischer 797b9e67834SAndre Fischer void Theme::SetupPropertyMaps (void) 798b9e67834SAndre Fischer { 79995a18594SAndre Fischer maPropertyIdToNameMap.resize(__Post_Rect); 800b9e67834SAndre Fischer maImages.resize(__Image_Color - __Pre_Image - 1); 801b9e67834SAndre Fischer maColors.resize(__Color_Paint - __Image_Color - 1); 802b9e67834SAndre Fischer maPaints.resize(__Paint_Int - __Color_Paint - 1); 803b9e67834SAndre Fischer maIntegers.resize(__Int_Bool - __Paint_Int - 1); 80495a18594SAndre Fischer maBooleans.resize(__Bool_Rect - __Int_Bool - 1); 80595a18594SAndre Fischer maRectangles.resize(__Post_Rect - __Bool_Rect - 1); 806b9e67834SAndre Fischer 807b9e67834SAndre Fischer #define AddEntry(e) maPropertyNameToIdMap[A2S(#e)]=e; maPropertyIdToNameMap[e]=A2S(#e) 80895a18594SAndre Fischer 809b9e67834SAndre Fischer AddEntry(Image_Grip); 810b9e67834SAndre Fischer AddEntry(Image_Expand); 811b9e67834SAndre Fischer AddEntry(Image_Collapse); 8127a32b0c8SAndre Fischer AddEntry(Image_TabBarMenu); 8137a32b0c8SAndre Fischer AddEntry(Image_PanelMenu); 81495a18594SAndre Fischer AddEntry(Image_ToolBoxItemSeparator); 8157a32b0c8SAndre Fischer AddEntry(Image_Closer); 81613e1c3b4SAndre Fischer AddEntry(Image_CloseIndicator); 817b9e67834SAndre Fischer 818b9e67834SAndre Fischer AddEntry(Color_DeckTitleFont); 819b9e67834SAndre Fischer AddEntry(Color_PanelTitleFont); 820b9e67834SAndre Fischer AddEntry(Color_TabMenuSeparator); 821b9e67834SAndre Fischer AddEntry(Color_TabItemBorder); 8228dcb2a10SAndre Fischer AddEntry(Color_DropDownBorder); 8235f1c83ffSOliver-Rainer Wittmann AddEntry(Color_Highlight); 8245f1c83ffSOliver-Rainer Wittmann AddEntry(Color_HighlightText); 825b9e67834SAndre Fischer 826b9e67834SAndre Fischer AddEntry(Paint_DeckBackground); 827b9e67834SAndre Fischer AddEntry(Paint_DeckTitleBarBackground); 828b9e67834SAndre Fischer AddEntry(Paint_PanelBackground); 829b9e67834SAndre Fischer AddEntry(Paint_PanelTitleBarBackground); 830b9e67834SAndre Fischer AddEntry(Paint_TabBarBackground); 83195a18594SAndre Fischer AddEntry(Paint_TabItemBackgroundNormal); 83295a18594SAndre Fischer AddEntry(Paint_TabItemBackgroundHighlight); 833b9e67834SAndre Fischer AddEntry(Paint_HorizontalBorder); 834b9e67834SAndre Fischer AddEntry(Paint_VerticalBorder); 83595a18594SAndre Fischer AddEntry(Paint_ToolBoxBackground); 83695a18594SAndre Fischer AddEntry(Paint_ToolBoxBorderTopLeft); 83795a18594SAndre Fischer AddEntry(Paint_ToolBoxBorderCenterCorners); 83895a18594SAndre Fischer AddEntry(Paint_ToolBoxBorderBottomRight); 8398dcb2a10SAndre Fischer AddEntry(Paint_DropDownBackground); 840b9e67834SAndre Fischer 841b9e67834SAndre Fischer AddEntry(Int_DeckTitleBarHeight); 842b9e67834SAndre Fischer AddEntry(Int_DeckBorderSize); 843b9e67834SAndre Fischer AddEntry(Int_DeckSeparatorHeight); 844b9e67834SAndre Fischer AddEntry(Int_PanelTitleBarHeight); 845b9e67834SAndre Fischer AddEntry(Int_TabMenuPadding); 846b9e67834SAndre Fischer AddEntry(Int_TabMenuSeparatorPadding); 847b9e67834SAndre Fischer AddEntry(Int_TabItemWidth); 848b9e67834SAndre Fischer AddEntry(Int_TabItemHeight); 849b9e67834SAndre Fischer AddEntry(Int_DeckLeftPadding); 850b9e67834SAndre Fischer AddEntry(Int_DeckTopPadding); 851b9e67834SAndre Fischer AddEntry(Int_DeckRightPadding); 852b9e67834SAndre Fischer AddEntry(Int_DeckBottomPadding); 853b9e67834SAndre Fischer AddEntry(Int_TabBarLeftPadding); 854b9e67834SAndre Fischer AddEntry(Int_TabBarTopPadding); 855b9e67834SAndre Fischer AddEntry(Int_TabBarRightPadding); 856b9e67834SAndre Fischer AddEntry(Int_TabBarBottomPadding); 85737fee4fdSAndre Fischer AddEntry(Int_ButtonCornerRadius); 858b9e67834SAndre Fischer 859b9e67834SAndre Fischer AddEntry(Bool_UseSymphonyIcons); 86095a18594SAndre Fischer AddEntry(Bool_UseSystemColors); 86195a18594SAndre Fischer AddEntry(Bool_UseToolBoxItemSeparator); 86295a18594SAndre Fischer AddEntry(Bool_IsHighContrastModeActive); 86395a18594SAndre Fischer 86495a18594SAndre Fischer AddEntry(Rect_ToolBoxPadding); 86595a18594SAndre Fischer AddEntry(Rect_ToolBoxBorder); 86695a18594SAndre Fischer 867b9e67834SAndre Fischer #undef AddEntry 868b9e67834SAndre Fischer 869b9e67834SAndre Fischer maRawValues.resize(maPropertyIdToNameMap.size()); 870b9e67834SAndre Fischer } 871b9e67834SAndre Fischer 872b9e67834SAndre Fischer 873b9e67834SAndre Fischer 874b9e67834SAndre Fischer 875b9e67834SAndre Fischer Theme::PropertyType Theme::GetPropertyType (const ThemeItem eItem) 876b9e67834SAndre Fischer { 877b9e67834SAndre Fischer switch(eItem) 878b9e67834SAndre Fischer { 879b9e67834SAndre Fischer case Image_Grip: 880b9e67834SAndre Fischer case Image_Expand: 881b9e67834SAndre Fischer case Image_Collapse: 8827a32b0c8SAndre Fischer case Image_TabBarMenu: 8837a32b0c8SAndre Fischer case Image_PanelMenu: 88495a18594SAndre Fischer case Image_ToolBoxItemSeparator: 8857a32b0c8SAndre Fischer case Image_Closer: 88613e1c3b4SAndre Fischer case Image_CloseIndicator: 887b9e67834SAndre Fischer return PT_Image; 888b9e67834SAndre Fischer 889b9e67834SAndre Fischer case Color_DeckTitleFont: 890b9e67834SAndre Fischer case Color_PanelTitleFont: 891b9e67834SAndre Fischer case Color_TabMenuSeparator: 892b9e67834SAndre Fischer case Color_TabItemBorder: 8938dcb2a10SAndre Fischer case Color_DropDownBorder: 8945f1c83ffSOliver-Rainer Wittmann case Color_Highlight: 8955f1c83ffSOliver-Rainer Wittmann case Color_HighlightText: 896b9e67834SAndre Fischer return PT_Color; 897b9e67834SAndre Fischer 898b9e67834SAndre Fischer case Paint_DeckBackground: 899b9e67834SAndre Fischer case Paint_DeckTitleBarBackground: 900b9e67834SAndre Fischer case Paint_PanelBackground: 901b9e67834SAndre Fischer case Paint_PanelTitleBarBackground: 902b9e67834SAndre Fischer case Paint_TabBarBackground: 90395a18594SAndre Fischer case Paint_TabItemBackgroundNormal: 90495a18594SAndre Fischer case Paint_TabItemBackgroundHighlight: 905b9e67834SAndre Fischer case Paint_HorizontalBorder: 906b9e67834SAndre Fischer case Paint_VerticalBorder: 90795a18594SAndre Fischer case Paint_ToolBoxBackground: 90895a18594SAndre Fischer case Paint_ToolBoxBorderTopLeft: 90995a18594SAndre Fischer case Paint_ToolBoxBorderCenterCorners: 91095a18594SAndre Fischer case Paint_ToolBoxBorderBottomRight: 9118dcb2a10SAndre Fischer case Paint_DropDownBackground: 912b9e67834SAndre Fischer return PT_Paint; 913b9e67834SAndre Fischer 914b9e67834SAndre Fischer case Int_DeckTitleBarHeight: 915b9e67834SAndre Fischer case Int_DeckBorderSize: 916b9e67834SAndre Fischer case Int_DeckSeparatorHeight: 917b9e67834SAndre Fischer case Int_PanelTitleBarHeight: 918b9e67834SAndre Fischer case Int_TabMenuPadding: 919b9e67834SAndre Fischer case Int_TabMenuSeparatorPadding: 920b9e67834SAndre Fischer case Int_TabItemWidth: 921b9e67834SAndre Fischer case Int_TabItemHeight: 922b9e67834SAndre Fischer case Int_DeckLeftPadding: 923b9e67834SAndre Fischer case Int_DeckTopPadding: 924b9e67834SAndre Fischer case Int_DeckRightPadding: 925b9e67834SAndre Fischer case Int_DeckBottomPadding: 926b9e67834SAndre Fischer case Int_TabBarLeftPadding: 927b9e67834SAndre Fischer case Int_TabBarTopPadding: 928b9e67834SAndre Fischer case Int_TabBarRightPadding: 929b9e67834SAndre Fischer case Int_TabBarBottomPadding: 93037fee4fdSAndre Fischer case Int_ButtonCornerRadius: 931b9e67834SAndre Fischer return PT_Integer; 932b9e67834SAndre Fischer 933b9e67834SAndre Fischer case Bool_UseSymphonyIcons: 93495a18594SAndre Fischer case Bool_UseSystemColors: 93595a18594SAndre Fischer case Bool_UseToolBoxItemSeparator: 93695a18594SAndre Fischer case Bool_IsHighContrastModeActive: 937b9e67834SAndre Fischer return PT_Boolean; 938b9e67834SAndre Fischer 93995a18594SAndre Fischer case Rect_ToolBoxBorder: 94095a18594SAndre Fischer case Rect_ToolBoxPadding: 94195a18594SAndre Fischer return PT_Rectangle; 94295a18594SAndre Fischer 943b9e67834SAndre Fischer default: 944b9e67834SAndre Fischer return PT_Invalid; 945b9e67834SAndre Fischer } 946b9e67834SAndre Fischer } 947b9e67834SAndre Fischer 948b9e67834SAndre Fischer 949b9e67834SAndre Fischer 950b9e67834SAndre Fischer 95195a18594SAndre Fischer cssu::Type Theme::GetCppuType (const PropertyType eType) 95295a18594SAndre Fischer { 95395a18594SAndre Fischer switch(eType) 95495a18594SAndre Fischer { 95595a18594SAndre Fischer case PT_Image: 95695a18594SAndre Fischer return getCppuType((rtl::OUString*)NULL); 95795a18594SAndre Fischer 95895a18594SAndre Fischer case PT_Color: 95995a18594SAndre Fischer return getCppuType((sal_uInt32*)NULL); 96095a18594SAndre Fischer 96195a18594SAndre Fischer case PT_Paint: 96295a18594SAndre Fischer return getCppuVoidType(); 96395a18594SAndre Fischer 96495a18594SAndre Fischer case PT_Integer: 96595a18594SAndre Fischer return getCppuType((sal_Int32*)NULL); 96695a18594SAndre Fischer 96795a18594SAndre Fischer case PT_Boolean: 96895a18594SAndre Fischer return getCppuType((sal_Bool*)NULL); 96995a18594SAndre Fischer 97095a18594SAndre Fischer case PT_Rectangle: 97195a18594SAndre Fischer return getCppuType((awt::Rectangle*)NULL); 97295a18594SAndre Fischer 97395a18594SAndre Fischer case PT_Invalid: 97495a18594SAndre Fischer default: 97595a18594SAndre Fischer return getCppuVoidType(); 97695a18594SAndre Fischer } 97795a18594SAndre Fischer } 97895a18594SAndre Fischer 97995a18594SAndre Fischer 98095a18594SAndre Fischer 98195a18594SAndre Fischer 982b9e67834SAndre Fischer sal_Int32 Theme::GetIndex (const ThemeItem eItem, const PropertyType eType) 983b9e67834SAndre Fischer { 984b9e67834SAndre Fischer switch(eType) 985b9e67834SAndre Fischer { 986b9e67834SAndre Fischer case PT_Image: 987b9e67834SAndre Fischer return eItem - __Pre_Image-1; 988b9e67834SAndre Fischer case PT_Color: 989b9e67834SAndre Fischer return eItem - __Image_Color-1; 990b9e67834SAndre Fischer case PT_Paint: 991b9e67834SAndre Fischer return eItem - __Color_Paint-1; 992b9e67834SAndre Fischer case PT_Integer: 993b9e67834SAndre Fischer return eItem - __Paint_Int-1; 994b9e67834SAndre Fischer case PT_Boolean: 995b9e67834SAndre Fischer return eItem - __Int_Bool-1; 99695a18594SAndre Fischer case PT_Rectangle: 99795a18594SAndre Fischer return eItem - __Bool_Rect-1; 998b9e67834SAndre Fischer 999b9e67834SAndre Fischer default: 1000b9e67834SAndre Fischer OSL_ASSERT(false); 1001b9e67834SAndre Fischer return 0; 1002b9e67834SAndre Fischer } 1003b9e67834SAndre Fischer } 1004b9e67834SAndre Fischer 1005b9e67834SAndre Fischer 1006b9e67834SAndre Fischer 1007b9e67834SAndre Fischer 1008b9e67834SAndre Fischer Theme::VetoableListenerContainer* Theme::GetVetoableListeners ( 1009b9e67834SAndre Fischer const ThemeItem eItem, 1010b9e67834SAndre Fischer const bool bCreate) 1011b9e67834SAndre Fischer { 1012b9e67834SAndre Fischer VetoableListeners::iterator iContainer (maVetoableListeners.find(eItem)); 1013b9e67834SAndre Fischer if (iContainer != maVetoableListeners.end()) 1014b9e67834SAndre Fischer return &iContainer->second; 1015b9e67834SAndre Fischer else if (bCreate) 1016b9e67834SAndre Fischer { 1017b9e67834SAndre Fischer maVetoableListeners[eItem] = VetoableListenerContainer(); 1018b9e67834SAndre Fischer return &maVetoableListeners[eItem]; 1019b9e67834SAndre Fischer } 1020b9e67834SAndre Fischer else 1021b9e67834SAndre Fischer return NULL; 1022b9e67834SAndre Fischer } 1023b9e67834SAndre Fischer 1024b9e67834SAndre Fischer 1025b9e67834SAndre Fischer 1026b9e67834SAndre Fischer 1027b9e67834SAndre Fischer Theme::ChangeListenerContainer* Theme::GetChangeListeners ( 1028b9e67834SAndre Fischer const ThemeItem eItem, 1029b9e67834SAndre Fischer const bool bCreate) 1030b9e67834SAndre Fischer { 1031b9e67834SAndre Fischer ChangeListeners::iterator iContainer (maChangeListeners.find(eItem)); 1032b9e67834SAndre Fischer if (iContainer != maChangeListeners.end()) 1033b9e67834SAndre Fischer return &iContainer->second; 1034b9e67834SAndre Fischer else if (bCreate) 1035b9e67834SAndre Fischer { 1036b9e67834SAndre Fischer maChangeListeners[eItem] = ChangeListenerContainer(); 1037b9e67834SAndre Fischer return &maChangeListeners[eItem]; 1038b9e67834SAndre Fischer } 1039b9e67834SAndre Fischer else 1040b9e67834SAndre Fischer return NULL; 1041b9e67834SAndre Fischer } 1042b9e67834SAndre Fischer 1043b9e67834SAndre Fischer 1044b9e67834SAndre Fischer 1045b9e67834SAndre Fischer 1046b9e67834SAndre Fischer bool Theme::DoVetoableListenersVeto ( 1047b9e67834SAndre Fischer const VetoableListenerContainer* pListeners, 1048b9e67834SAndre Fischer const beans::PropertyChangeEvent& rEvent) const 1049b9e67834SAndre Fischer { 1050b9e67834SAndre Fischer if (pListeners == NULL) 1051b9e67834SAndre Fischer return false; 1052b9e67834SAndre Fischer 1053b9e67834SAndre Fischer VetoableListenerContainer aListeners (*pListeners); 1054b9e67834SAndre Fischer try 1055b9e67834SAndre Fischer { 1056b9e67834SAndre Fischer for (VetoableListenerContainer::const_iterator 1057b9e67834SAndre Fischer iListener(aListeners.begin()), 1058b9e67834SAndre Fischer iEnd(aListeners.end()); 1059b9e67834SAndre Fischer iListener!=iEnd; 1060b9e67834SAndre Fischer ++iListener) 1061b9e67834SAndre Fischer { 1062b9e67834SAndre Fischer (*iListener)->vetoableChange(rEvent); 1063b9e67834SAndre Fischer } 1064b9e67834SAndre Fischer } 1065b9e67834SAndre Fischer catch(const beans::PropertyVetoException&) 1066b9e67834SAndre Fischer { 1067b9e67834SAndre Fischer return true; 1068b9e67834SAndre Fischer } 1069b9e67834SAndre Fischer catch(const Exception&) 1070b9e67834SAndre Fischer { 1071b9e67834SAndre Fischer // Ignore any other errors (such as disposed listeners). 1072b9e67834SAndre Fischer } 1073b9e67834SAndre Fischer return false; 1074b9e67834SAndre Fischer } 1075b9e67834SAndre Fischer 1076b9e67834SAndre Fischer 1077b9e67834SAndre Fischer 1078b9e67834SAndre Fischer 1079b9e67834SAndre Fischer void Theme::BroadcastPropertyChange ( 1080b9e67834SAndre Fischer const ChangeListenerContainer* pListeners, 1081b9e67834SAndre Fischer const beans::PropertyChangeEvent& rEvent) const 1082b9e67834SAndre Fischer { 1083b9e67834SAndre Fischer if (pListeners == NULL) 1084b9e67834SAndre Fischer return; 1085b9e67834SAndre Fischer 1086b9e67834SAndre Fischer const ChangeListenerContainer aListeners (*pListeners); 1087b9e67834SAndre Fischer try 1088b9e67834SAndre Fischer { 1089b9e67834SAndre Fischer for (ChangeListenerContainer::const_iterator 1090b9e67834SAndre Fischer iListener(aListeners.begin()), 1091b9e67834SAndre Fischer iEnd(aListeners.end()); 1092b9e67834SAndre Fischer iListener!=iEnd; 1093b9e67834SAndre Fischer ++iListener) 1094b9e67834SAndre Fischer { 1095b9e67834SAndre Fischer (*iListener)->propertyChange(rEvent); 1096b9e67834SAndre Fischer } 1097b9e67834SAndre Fischer } 1098b9e67834SAndre Fischer catch(const Exception&) 1099b9e67834SAndre Fischer { 1100b9e67834SAndre Fischer // Ignore any errors (such as disposed listeners). 1101b9e67834SAndre Fischer } 1102b9e67834SAndre Fischer } 1103b9e67834SAndre Fischer 1104b9e67834SAndre Fischer 1105b9e67834SAndre Fischer 1106b9e67834SAndre Fischer 1107b9e67834SAndre Fischer void Theme::ProcessNewValue ( 1108b9e67834SAndre Fischer const Any& rValue, 1109b9e67834SAndre Fischer const ThemeItem eItem, 1110b9e67834SAndre Fischer const PropertyType eType) 1111b9e67834SAndre Fischer { 1112b9e67834SAndre Fischer const sal_Int32 nIndex (GetIndex (eItem, eType)); 1113b9e67834SAndre Fischer switch (eType) 1114b9e67834SAndre Fischer { 1115b9e67834SAndre Fischer case PT_Image: 1116b9e67834SAndre Fischer { 1117b9e67834SAndre Fischer ::rtl::OUString sURL; 1118b9e67834SAndre Fischer if (rValue >>= sURL) 1119b9e67834SAndre Fischer { 1120b9e67834SAndre Fischer maImages[nIndex] = Tools::GetImage(sURL, NULL); 1121b9e67834SAndre Fischer } 1122b9e67834SAndre Fischer break; 1123b9e67834SAndre Fischer } 1124b9e67834SAndre Fischer case PT_Color: 1125b9e67834SAndre Fischer { 112695a18594SAndre Fischer sal_Int32 nColorValue (0); 1127b9e67834SAndre Fischer if (rValue >>= nColorValue) 1128b9e67834SAndre Fischer { 1129b9e67834SAndre Fischer maColors[nIndex] = Color(nColorValue); 1130b9e67834SAndre Fischer } 1131b9e67834SAndre Fischer break; 1132b9e67834SAndre Fischer } 1133b9e67834SAndre Fischer case PT_Paint: 1134b9e67834SAndre Fischer { 113595a18594SAndre Fischer maPaints[nIndex] = Paint::Create(rValue); 1136b9e67834SAndre Fischer break; 1137b9e67834SAndre Fischer } 1138b9e67834SAndre Fischer case PT_Integer: 1139b9e67834SAndre Fischer { 114095a18594SAndre Fischer sal_Int32 nValue (0); 1141b9e67834SAndre Fischer if (rValue >>= nValue) 1142b9e67834SAndre Fischer { 1143b9e67834SAndre Fischer maIntegers[nIndex] = nValue; 1144b9e67834SAndre Fischer } 1145b9e67834SAndre Fischer break; 1146b9e67834SAndre Fischer } 1147b9e67834SAndre Fischer case PT_Boolean: 1148b9e67834SAndre Fischer { 114995a18594SAndre Fischer sal_Bool nValue (0); 1150b9e67834SAndre Fischer if (rValue >>= nValue) 1151b9e67834SAndre Fischer { 1152b9e67834SAndre Fischer maBooleans[nIndex] = (nValue==sal_True); 115395a18594SAndre Fischer if (eItem == Bool_IsHighContrastModeActive) 115495a18594SAndre Fischer { 115595a18594SAndre Fischer mbIsHighContrastModeSetManually = true; 115695a18594SAndre Fischer mbIsHighContrastMode = maBooleans[nIndex]; 115795a18594SAndre Fischer HandleDataChange(); 115895a18594SAndre Fischer } 115995a18594SAndre Fischer else if (eItem == Bool_UseSystemColors) 116095a18594SAndre Fischer { 116195a18594SAndre Fischer HandleDataChange(); 116295a18594SAndre Fischer } 116395a18594SAndre Fischer } 116495a18594SAndre Fischer break; 116595a18594SAndre Fischer } 116695a18594SAndre Fischer case PT_Rectangle: 116795a18594SAndre Fischer { 116895a18594SAndre Fischer awt::Rectangle aBox; 116995a18594SAndre Fischer if (rValue >>= aBox) 117095a18594SAndre Fischer { 117195a18594SAndre Fischer maRectangles[nIndex] = Rectangle( 117295a18594SAndre Fischer aBox.X, 117395a18594SAndre Fischer aBox.Y, 117495a18594SAndre Fischer aBox.Width, 117595a18594SAndre Fischer aBox.Height); 1176b9e67834SAndre Fischer } 1177b9e67834SAndre Fischer break; 1178b9e67834SAndre Fischer } 1179b9e67834SAndre Fischer case PT_Invalid: 1180b9e67834SAndre Fischer OSL_ASSERT(eType != PT_Invalid); 1181b9e67834SAndre Fischer throw RuntimeException(); 1182b9e67834SAndre Fischer } 1183b9e67834SAndre Fischer } 1184b9e67834SAndre Fischer 1185b9e67834SAndre Fischer 1186b9e67834SAndre Fischer 1187ff12d537SAndre Fischer 1188ff12d537SAndre Fischer } } // end of namespace sfx2::sidebar 1189