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 #include "precompiled_sfx2.hxx" 23ff12d537SAndre Fischer 24b9e67834SAndre Fischer #include "sfx2/sidebar/Theme.hxx" 25ff12d537SAndre Fischer #include "Paint.hxx" 26ff12d537SAndre Fischer #include "SidebarResource.hxx" 27b9e67834SAndre Fischer #include "Tools.hxx" 28ff12d537SAndre Fischer 29b9e67834SAndre Fischer #include <tools/svborder.hxx> 30ff12d537SAndre Fischer #include <tools/rc.hxx> 31ff12d537SAndre Fischer #include <vcl/svapp.hxx> 32ff12d537SAndre Fischer 33b9e67834SAndre Fischer using namespace css; 34b9e67834SAndre Fischer using namespace cssu; 35ff12d537SAndre Fischer 36ff12d537SAndre Fischer 37b9e67834SAndre Fischer namespace sfx2 { namespace sidebar { 38ff12d537SAndre Fischer 39b9e67834SAndre Fischer ::rtl::Reference<Theme> Theme::mpInstance; 40ff12d537SAndre Fischer 41ff12d537SAndre Fischer 42ff12d537SAndre Fischer 43ff12d537SAndre Fischer 44b9e67834SAndre Fischer Theme& Theme::GetCurrentTheme (void) 45b9e67834SAndre Fischer { 46b9e67834SAndre Fischer if ( ! mpInstance.is()) 47b9e67834SAndre Fischer { 48b9e67834SAndre Fischer mpInstance.set(new Theme()); 49b9e67834SAndre Fischer mpInstance->InitializeTheme(); 50b9e67834SAndre Fischer } 51b9e67834SAndre Fischer return *mpInstance; 52b9e67834SAndre Fischer } 53ff12d537SAndre Fischer 54ff12d537SAndre Fischer 55ff12d537SAndre Fischer 56ff12d537SAndre Fischer 57b9e67834SAndre Fischer Theme::Theme (void) 58b9e67834SAndre Fischer : ThemeInterfaceBase(m_aMutex), 59b9e67834SAndre Fischer maImages(), 60b9e67834SAndre Fischer maColors(), 61b9e67834SAndre Fischer maPaints(), 62b9e67834SAndre Fischer maIntegers(), 63b9e67834SAndre Fischer maBooleans(), 64b9e67834SAndre Fischer mbIsHighContrastMode(Application::GetSettings().GetStyleSettings().GetHighContrastMode()), 6595a18594SAndre Fischer mbIsHighContrastModeSetManually(false), 66b9e67834SAndre Fischer maPropertyNameToIdMap(), 67b9e67834SAndre Fischer maPropertyIdToNameMap(), 68b9e67834SAndre Fischer maRawValues(), 69b9e67834SAndre Fischer maChangeListeners(), 70b9e67834SAndre Fischer maVetoableListeners() 71ff12d537SAndre Fischer 72ff12d537SAndre Fischer { 73b9e67834SAndre Fischer SetupPropertyMaps(); 74ff12d537SAndre Fischer } 75ff12d537SAndre Fischer 76ff12d537SAndre Fischer 77ff12d537SAndre Fischer 78ff12d537SAndre Fischer 79b9e67834SAndre Fischer Theme::~Theme (void) 80ff12d537SAndre Fischer { 81ff12d537SAndre Fischer } 82ff12d537SAndre Fischer 83ff12d537SAndre Fischer 84ff12d537SAndre Fischer 85ff12d537SAndre Fischer 86b9e67834SAndre Fischer Image Theme::GetImage (const ThemeItem eItem) 87ff12d537SAndre Fischer { 88b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(eItem)); 89b9e67834SAndre Fischer OSL_ASSERT(eType==PT_Image); 90b9e67834SAndre Fischer const sal_Int32 nIndex (GetIndex(eItem, eType)); 91b9e67834SAndre Fischer const Theme& rTheme (GetCurrentTheme()); 92b9e67834SAndre Fischer return rTheme.maImages[nIndex]; 93ff12d537SAndre Fischer } 94ff12d537SAndre Fischer 95ff12d537SAndre Fischer 96ff12d537SAndre Fischer 97ff12d537SAndre Fischer 98b9e67834SAndre Fischer Color Theme::GetColor (const ThemeItem eItem) 99ff12d537SAndre Fischer { 100b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(eItem)); 1018dcb2a10SAndre Fischer OSL_ASSERT(eType==PT_Color || eType==PT_Paint); 102b9e67834SAndre Fischer const sal_Int32 nIndex (GetIndex(eItem, eType)); 103b9e67834SAndre Fischer const Theme& rTheme (GetCurrentTheme()); 1048dcb2a10SAndre Fischer if (eType == PT_Color) 1058dcb2a10SAndre Fischer return rTheme.maColors[nIndex]; 1068dcb2a10SAndre Fischer else if (eType == PT_Paint) 1078dcb2a10SAndre Fischer return rTheme.maPaints[nIndex].GetColor(); 108*f120fe41SAndre Fischer else 109*f120fe41SAndre Fischer return COL_WHITE; 110ff12d537SAndre Fischer } 111ff12d537SAndre Fischer 112ff12d537SAndre Fischer 113ff12d537SAndre Fischer 114ff12d537SAndre Fischer 115b9e67834SAndre Fischer const Paint& Theme::GetPaint (const ThemeItem eItem) 116ff12d537SAndre Fischer { 117b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(eItem)); 118b9e67834SAndre Fischer OSL_ASSERT(eType==PT_Paint); 119b9e67834SAndre Fischer const sal_Int32 nIndex (GetIndex(eItem, eType)); 120b9e67834SAndre Fischer const Theme& rTheme (GetCurrentTheme()); 121b9e67834SAndre Fischer return rTheme.maPaints[nIndex]; 122ff12d537SAndre Fischer } 123ff12d537SAndre Fischer 124ff12d537SAndre Fischer 125ff12d537SAndre Fischer 126ff12d537SAndre Fischer 1277a32b0c8SAndre Fischer const Wallpaper Theme::GetWallpaper (const ThemeItem eItem) 1287a32b0c8SAndre Fischer { 1297a32b0c8SAndre Fischer return GetPaint(eItem).GetWallpaper(); 1307a32b0c8SAndre Fischer } 1317a32b0c8SAndre Fischer 1327a32b0c8SAndre Fischer 1337a32b0c8SAndre Fischer 1347a32b0c8SAndre Fischer 135b9e67834SAndre Fischer sal_Int32 Theme::GetInteger (const ThemeItem eItem) 136ff12d537SAndre Fischer { 137b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(eItem)); 138b9e67834SAndre Fischer OSL_ASSERT(eType==PT_Integer); 139b9e67834SAndre Fischer const sal_Int32 nIndex (GetIndex(eItem, eType)); 140b9e67834SAndre Fischer const Theme& rTheme (GetCurrentTheme()); 141b9e67834SAndre Fischer return rTheme.maIntegers[nIndex]; 142ff12d537SAndre Fischer } 143ff12d537SAndre Fischer 144ff12d537SAndre Fischer 145ff12d537SAndre Fischer 146ff12d537SAndre Fischer 147b9e67834SAndre Fischer bool Theme::GetBoolean (const ThemeItem eItem) 148ff12d537SAndre Fischer { 149b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(eItem)); 150b9e67834SAndre Fischer OSL_ASSERT(eType==PT_Boolean); 151b9e67834SAndre Fischer const sal_Int32 nIndex (GetIndex(eItem, eType)); 152b9e67834SAndre Fischer const Theme& rTheme (GetCurrentTheme()); 153b9e67834SAndre Fischer return rTheme.maBooleans[nIndex]; 154ff12d537SAndre Fischer } 155ff12d537SAndre Fischer 156ff12d537SAndre Fischer 157ff12d537SAndre Fischer 158ff12d537SAndre Fischer 15995a18594SAndre Fischer Rectangle Theme::GetRectangle (const ThemeItem eItem) 16095a18594SAndre Fischer { 16195a18594SAndre Fischer const PropertyType eType (GetPropertyType(eItem)); 16295a18594SAndre Fischer OSL_ASSERT(eType==PT_Rectangle); 16395a18594SAndre Fischer const sal_Int32 nIndex (GetIndex(eItem, eType)); 16495a18594SAndre Fischer const Theme& rTheme (GetCurrentTheme()); 16595a18594SAndre Fischer return rTheme.maRectangles[nIndex]; 16695a18594SAndre Fischer } 16795a18594SAndre Fischer 16895a18594SAndre Fischer 16995a18594SAndre Fischer 17095a18594SAndre Fischer 171b9e67834SAndre Fischer bool Theme::IsHighContrastMode (void) 172ff12d537SAndre Fischer { 173b9e67834SAndre Fischer const Theme& rTheme (GetCurrentTheme()); 174b9e67834SAndre Fischer return rTheme.mbIsHighContrastMode; 175ff12d537SAndre Fischer } 176ff12d537SAndre Fischer 177ff12d537SAndre Fischer 178ff12d537SAndre Fischer 179ff12d537SAndre Fischer 180b9e67834SAndre Fischer void Theme::HandleDataChange (void) 181ff12d537SAndre Fischer { 18295a18594SAndre Fischer Theme& rTheme (GetCurrentTheme()); 18395a18594SAndre Fischer 18495a18594SAndre Fischer if ( ! rTheme.mbIsHighContrastModeSetManually) 18595a18594SAndre Fischer { 18695a18594SAndre Fischer // Do not modify mbIsHighContrastMode when it was manually set. 18795a18594SAndre Fischer GetCurrentTheme().mbIsHighContrastMode = Application::GetSettings().GetStyleSettings().GetHighContrastMode(); 18895a18594SAndre Fischer rTheme.maRawValues[Bool_IsHighContrastModeActive] = Any(GetCurrentTheme().mbIsHighContrastMode); 18995a18594SAndre Fischer } 19095a18594SAndre Fischer 19195a18594SAndre Fischer GetCurrentTheme().UpdateTheme(); 192ff12d537SAndre Fischer } 193ff12d537SAndre Fischer 194ff12d537SAndre Fischer 195ff12d537SAndre Fischer 196ff12d537SAndre Fischer 197b9e67834SAndre Fischer void Theme::InitializeTheme (void) 19895a18594SAndre Fischer { 19995a18594SAndre Fischer setPropertyValue( 20095a18594SAndre Fischer maPropertyIdToNameMap[Bool_UseSymphonyIcons], 20195a18594SAndre Fischer Any(true)); 20295a18594SAndre Fischer setPropertyValue( 20395a18594SAndre Fischer maPropertyIdToNameMap[Bool_UseSystemColors], 20495a18594SAndre Fischer Any(false)); 20595a18594SAndre Fischer } 20695a18594SAndre Fischer 20795a18594SAndre Fischer 20895a18594SAndre Fischer 20995a18594SAndre Fischer 21095a18594SAndre Fischer void Theme::UpdateTheme (void) 211ff12d537SAndre Fischer { 212b9e67834SAndre Fischer SidebarResource aLocalResource; 213b9e67834SAndre Fischer 214b9e67834SAndre Fischer try 215b9e67834SAndre Fischer { 21695a18594SAndre Fischer const StyleSettings& rStyle (Application::GetSettings().GetStyleSettings()); 21795a18594SAndre Fischer const bool bUseSystemColors (GetBoolean(Bool_UseSystemColors)); 21895a18594SAndre Fischer 21995a18594SAndre Fischer #define Alternatives(n,hc,sys) (mbIsHighContrastMode ? hc : (bUseSystemColors ? sys : n)) 22095a18594SAndre Fischer 2218dcb2a10SAndre Fischer const Color aBaseBackgroundColor (rStyle.GetDialogColor()); 2228dcb2a10SAndre Fischer Color aBorderColor (aBaseBackgroundColor); 2238dcb2a10SAndre Fischer aBorderColor.DecreaseLuminance(15); 2248dcb2a10SAndre Fischer Color aSecondColor (aBaseBackgroundColor); 2258dcb2a10SAndre Fischer aSecondColor.DecreaseLuminance(15); 2268dcb2a10SAndre Fischer 227b9e67834SAndre Fischer setPropertyValue( 228b9e67834SAndre Fischer maPropertyIdToNameMap[Paint_DeckBackground], 2298dcb2a10SAndre Fischer Any(sal_Int32(rStyle.GetMenuColor().GetRGBColor()))); 23095a18594SAndre Fischer 231b9e67834SAndre Fischer setPropertyValue( 232b9e67834SAndre Fischer maPropertyIdToNameMap[Paint_DeckTitleBarBackground], 2338dcb2a10SAndre Fischer Any(sal_Int32(aBaseBackgroundColor.GetRGBColor()))); 234b9e67834SAndre Fischer setPropertyValue( 235b9e67834SAndre Fischer maPropertyIdToNameMap[Int_DeckLeftPadding], 236b9e67834SAndre Fischer Any(sal_Int32(2))); 237b9e67834SAndre Fischer setPropertyValue( 238b9e67834SAndre Fischer maPropertyIdToNameMap[Int_DeckTopPadding], 239b9e67834SAndre Fischer Any(sal_Int32(2))); 240b9e67834SAndre Fischer setPropertyValue( 241b9e67834SAndre Fischer maPropertyIdToNameMap[Int_DeckRightPadding], 242b9e67834SAndre Fischer Any(sal_Int32(2))); 243b9e67834SAndre Fischer setPropertyValue( 244b9e67834SAndre Fischer maPropertyIdToNameMap[Int_DeckBottomPadding], 245b9e67834SAndre Fischer Any(sal_Int32(2))); 246b9e67834SAndre Fischer setPropertyValue( 247b9e67834SAndre Fischer maPropertyIdToNameMap[Int_DeckBorderSize], 248b9e67834SAndre Fischer Any(sal_Int32(1))); 249b9e67834SAndre Fischer setPropertyValue( 250b9e67834SAndre Fischer maPropertyIdToNameMap[Int_DeckSeparatorHeight], 251b9e67834SAndre Fischer Any(sal_Int32(1))); 252b9e67834SAndre Fischer setPropertyValue( 253b9e67834SAndre Fischer maPropertyIdToNameMap[Color_DeckTitleFont], 2548dcb2a10SAndre Fischer Any(sal_Int32(rStyle.GetFontColor().GetRGBColor()))); 255b9e67834SAndre Fischer setPropertyValue( 256b9e67834SAndre Fischer maPropertyIdToNameMap[Int_DeckTitleBarHeight], 25795a18594SAndre Fischer Any(sal_Int32(Alternatives( 25895a18594SAndre Fischer 26, 25995a18594SAndre Fischer 26, 26095a18594SAndre Fischer rStyle.GetFloatTitleHeight())))); 261b9e67834SAndre Fischer setPropertyValue( 262b9e67834SAndre Fischer maPropertyIdToNameMap[Paint_PanelBackground], 2638dcb2a10SAndre Fischer Any(sal_Int32(rStyle.GetDialogColor().GetRGBColor()))); 2648dcb2a10SAndre Fischer // Any(sal_Int32(mbIsHighContrastMode ? 0x000000 : 2658dcb2a10SAndre Fischer // 0xffffff))); 2668dcb2a10SAndre Fischer 267b9e67834SAndre Fischer setPropertyValue( 268b9e67834SAndre Fischer maPropertyIdToNameMap[Paint_PanelTitleBarBackground], 2698dcb2a10SAndre Fischer Any(Tools::VclToAwtGradient(Gradient( 2708dcb2a10SAndre Fischer GRADIENT_LINEAR, 2718dcb2a10SAndre Fischer aSecondColor.GetRGBColor(), 2728dcb2a10SAndre Fischer aBaseBackgroundColor.GetRGBColor() 2738dcb2a10SAndre Fischer )))); 274b9e67834SAndre Fischer setPropertyValue( 275b9e67834SAndre Fischer maPropertyIdToNameMap[Color_PanelTitleFont], 276b9e67834SAndre Fischer Any(sal_Int32(mbIsHighContrastMode ? 0x00ff00 : 0x262626))); 277b9e67834SAndre Fischer setPropertyValue( 278b9e67834SAndre Fischer maPropertyIdToNameMap[Int_PanelTitleBarHeight], 27995a18594SAndre Fischer Any(sal_Int32(Alternatives( 28095a18594SAndre Fischer 26, 28195a18594SAndre Fischer 26, 28295a18594SAndre Fischer rStyle.GetTitleHeight())))); 283b9e67834SAndre Fischer setPropertyValue( 284b9e67834SAndre Fischer maPropertyIdToNameMap[Paint_TabBarBackground], 2858dcb2a10SAndre Fischer Any(sal_Int32(aBaseBackgroundColor.GetRGBColor()))); 286b9e67834SAndre Fischer setPropertyValue( 287b9e67834SAndre Fischer maPropertyIdToNameMap[Int_TabBarLeftPadding], 288b9e67834SAndre Fischer Any(sal_Int32(2))); 289b9e67834SAndre Fischer setPropertyValue( 290b9e67834SAndre Fischer maPropertyIdToNameMap[Int_TabBarTopPadding], 291b9e67834SAndre Fischer Any(sal_Int32(2))); 292b9e67834SAndre Fischer setPropertyValue( 293b9e67834SAndre Fischer maPropertyIdToNameMap[Int_TabBarRightPadding], 294b9e67834SAndre Fischer Any(sal_Int32(2))); 295b9e67834SAndre Fischer setPropertyValue( 296b9e67834SAndre Fischer maPropertyIdToNameMap[Int_TabBarBottomPadding], 297b9e67834SAndre Fischer Any(sal_Int32(2))); 298b9e67834SAndre Fischer 299b9e67834SAndre Fischer setPropertyValue( 300b9e67834SAndre Fischer maPropertyIdToNameMap[Int_TabMenuPadding], 301b9e67834SAndre Fischer Any(sal_Int32(6))); 302b9e67834SAndre Fischer setPropertyValue( 303b9e67834SAndre Fischer maPropertyIdToNameMap[Color_TabMenuSeparator], 3048dcb2a10SAndre Fischer Any(sal_Int32(aBorderColor.GetRGBColor()))); 305b9e67834SAndre Fischer setPropertyValue( 306b9e67834SAndre Fischer maPropertyIdToNameMap[Int_TabMenuSeparatorPadding], 307b9e67834SAndre Fischer Any(sal_Int32(7))); 308b9e67834SAndre Fischer 309b9e67834SAndre Fischer setPropertyValue( 310b9e67834SAndre Fischer maPropertyIdToNameMap[Int_TabItemWidth], 311b9e67834SAndre Fischer Any(sal_Int32(32))); 312b9e67834SAndre Fischer setPropertyValue( 313b9e67834SAndre Fischer maPropertyIdToNameMap[Int_TabItemHeight], 314b9e67834SAndre Fischer Any(sal_Int32(32))); 315b9e67834SAndre Fischer setPropertyValue( 316b9e67834SAndre Fischer maPropertyIdToNameMap[Color_TabItemBorder], 3178dcb2a10SAndre Fischer Any(sal_Int32(rStyle.GetActiveBorderColor().GetRGBColor()))); 3188dcb2a10SAndre Fischer // mbIsHighContrastMode ? 0x00ff00 : 0xbfbfbf))); 3198dcb2a10SAndre Fischer 3208dcb2a10SAndre Fischer setPropertyValue( 3218dcb2a10SAndre Fischer maPropertyIdToNameMap[Paint_DropDownBackground], 3228dcb2a10SAndre Fischer Any(sal_Int32(aBaseBackgroundColor.GetRGBColor()))); 3238dcb2a10SAndre Fischer setPropertyValue( 3248dcb2a10SAndre Fischer maPropertyIdToNameMap[Color_DropDownBorder], 3258dcb2a10SAndre Fischer Any(sal_Int32(rStyle.GetActiveBorderColor().GetRGBColor()))); 3268dcb2a10SAndre Fischer 3275f1c83ffSOliver-Rainer Wittmann setPropertyValue( 3285f1c83ffSOliver-Rainer Wittmann maPropertyIdToNameMap[Color_Highlight], 3295f1c83ffSOliver-Rainer Wittmann Any(sal_Int32(rStyle.GetHighlightColor().GetRGBColor()))); 3305f1c83ffSOliver-Rainer Wittmann setPropertyValue( 3315f1c83ffSOliver-Rainer Wittmann maPropertyIdToNameMap[Color_HighlightText], 3325f1c83ffSOliver-Rainer Wittmann Any(sal_Int32(rStyle.GetHighlightTextColor().GetRGBColor()))); 3335f1c83ffSOliver-Rainer Wittmann 334b9e67834SAndre Fischer setPropertyValue( 33595a18594SAndre Fischer maPropertyIdToNameMap[Paint_TabItemBackgroundNormal], 33695a18594SAndre Fischer Any()); 33795a18594SAndre Fischer setPropertyValue( 33895a18594SAndre Fischer maPropertyIdToNameMap[Paint_TabItemBackgroundHighlight], 3398dcb2a10SAndre Fischer Any(sal_Int32(rStyle.GetActiveTabColor().GetRGBColor()))); 3408dcb2a10SAndre Fischer // mbIsHighContrastMode ? 0x000000 : 0x00ffffff))); 341b9e67834SAndre Fischer 342b9e67834SAndre Fischer setPropertyValue( 343b9e67834SAndre Fischer maPropertyIdToNameMap[Paint_HorizontalBorder], 3448dcb2a10SAndre Fischer Any(sal_Int32(aBorderColor.GetRGBColor()))); 3458dcb2a10SAndre Fischer // mbIsHighContrastMode ? 0x00ff00 : 0xe4e4e4))); 346b9e67834SAndre Fischer setPropertyValue( 347b9e67834SAndre Fischer maPropertyIdToNameMap[Paint_VerticalBorder], 3488dcb2a10SAndre Fischer Any(sal_Int32(aBorderColor.GetRGBColor()))); 3498dcb2a10SAndre Fischer // mbIsHighContrastMode ? 0x00ff00 : 0xe4e4e4))); 350b9e67834SAndre Fischer 351b9e67834SAndre Fischer setPropertyValue( 352b9e67834SAndre Fischer maPropertyIdToNameMap[Image_Grip], 353b9e67834SAndre Fischer Any( 354b9e67834SAndre Fischer mbIsHighContrastMode 355b9e67834SAndre Fischer ? A2S("private:graphicrepository/sfx2/res/grip_hc.png") 356b9e67834SAndre Fischer : A2S("private:graphicrepository/sfx2/res/grip.png"))); 357b9e67834SAndre Fischer setPropertyValue( 358b9e67834SAndre Fischer maPropertyIdToNameMap[Image_Expand], 359b9e67834SAndre Fischer Any( 360b9e67834SAndre Fischer mbIsHighContrastMode 3617a32b0c8SAndre Fischer ? A2S("private:graphicrepository/svtools/res/triangle_right_hc.png") 3627a32b0c8SAndre Fischer : A2S("private:graphicrepository/svtools/res/triangle_right.png"))); 3637a32b0c8SAndre Fischer // ? A2S("private:graphicrepository/res/plus_sch.png") 3647a32b0c8SAndre Fischer // : A2S("private:graphicrepository/res/plus.png"))); 365b9e67834SAndre Fischer setPropertyValue( 366b9e67834SAndre Fischer maPropertyIdToNameMap[Image_Collapse], 367b9e67834SAndre Fischer Any( 368b9e67834SAndre Fischer mbIsHighContrastMode 3697a32b0c8SAndre Fischer ? A2S("private:graphicrepository/svtools/res/triangle_down_hc.png") 3707a32b0c8SAndre Fischer : A2S("private:graphicrepository/svtools/res/triangle_down.png"))); 3717a32b0c8SAndre Fischer // ? A2S("private:graphicrepository/res/minus_sch.png") 3727a32b0c8SAndre Fischer // : A2S("private:graphicrepository/res/minus.png"))); 373b9e67834SAndre Fischer setPropertyValue( 3747a32b0c8SAndre Fischer maPropertyIdToNameMap[Image_TabBarMenu], 375b9e67834SAndre Fischer Any( 376b9e67834SAndre Fischer mbIsHighContrastMode 37795a18594SAndre Fischer ? A2S("private:graphicrepository/sfx2/res/menu_hc.png") 378b9e67834SAndre Fischer : A2S("private:graphicrepository/sfx2/res/menu.png"))); 3797a32b0c8SAndre Fischer setPropertyValue( 3807a32b0c8SAndre Fischer maPropertyIdToNameMap[Image_PanelMenu], 3817a32b0c8SAndre Fischer Any( 3827a32b0c8SAndre Fischer mbIsHighContrastMode 3837a32b0c8SAndre Fischer ? A2S("private:graphicrepository/res/imh30823.png") 3847a32b0c8SAndre Fischer : A2S("private:graphicrepository/res/im30823.png"))); 3857a32b0c8SAndre Fischer setPropertyValue( 3867a32b0c8SAndre Fischer maPropertyIdToNameMap[Image_Closer], 3877a32b0c8SAndre Fischer Any(A2S("private:graphicrepository/sfx2/res/closedoc.png"))); 38895a18594SAndre Fischer setPropertyValue( 38995a18594SAndre Fischer maPropertyIdToNameMap[Image_ToolBoxItemSeparator], 39095a18594SAndre Fischer Any( 39195a18594SAndre Fischer A2S("private:graphicrepository/sfx2/res/separator.png"))); 392b9e67834SAndre Fischer 39395a18594SAndre Fischer // ToolBox 3948dcb2a10SAndre Fischer 3958dcb2a10SAndre Fischer /* 3968dcb2a10SAndre Fischer // Separator style 3978dcb2a10SAndre Fischer setPropertyValue( 3988dcb2a10SAndre Fischer maPropertyIdToNameMap[Paint_ToolBoxBackground], 3998dcb2a10SAndre Fischer Any(sal_Int32(rStyle.GetMenuColor().GetRGBColor()))); 4008dcb2a10SAndre Fischer setPropertyValue( 4018dcb2a10SAndre Fischer maPropertyIdToNameMap[Paint_ToolBoxBorderTopLeft], 4028dcb2a10SAndre Fischer Any()); 4038dcb2a10SAndre Fischer setPropertyValue( 4048dcb2a10SAndre Fischer maPropertyIdToNameMap[Paint_ToolBoxBorderCenterCorners], 4058dcb2a10SAndre Fischer Any()); 4068dcb2a10SAndre Fischer setPropertyValue( 4078dcb2a10SAndre Fischer maPropertyIdToNameMap[Paint_ToolBoxBorderBottomRight], 4088dcb2a10SAndre Fischer Any()); 4098dcb2a10SAndre Fischer setPropertyValue( 4108dcb2a10SAndre Fischer maPropertyIdToNameMap[Rect_ToolBoxPadding], 4118dcb2a10SAndre Fischer Any(awt::Rectangle(2,2,2,2))); 4128dcb2a10SAndre Fischer setPropertyValue( 4138dcb2a10SAndre Fischer maPropertyIdToNameMap[Rect_ToolBoxBorder], 4148dcb2a10SAndre Fischer Any(awt::Rectangle(0,0,0,0))); 4158dcb2a10SAndre Fischer setPropertyValue( 4168dcb2a10SAndre Fischer maPropertyIdToNameMap[Bool_UseToolBoxItemSeparator], 4178dcb2a10SAndre Fischer Any(true)); 4188dcb2a10SAndre Fischer 4198dcb2a10SAndre Fischer */ 4208dcb2a10SAndre Fischer 4218dcb2a10SAndre Fischer // Gradient style 42295a18594SAndre Fischer setPropertyValue( 42395a18594SAndre Fischer maPropertyIdToNameMap[Paint_ToolBoxBackground], 42495a18594SAndre Fischer Any(Tools::VclToAwtGradient(Gradient( 42595a18594SAndre Fischer GRADIENT_LINEAR, 42695a18594SAndre Fischer Color(0xf2f2f2), 42795a18594SAndre Fischer Color(0xfefefe) 42895a18594SAndre Fischer )))); 42995a18594SAndre Fischer setPropertyValue( 43095a18594SAndre Fischer maPropertyIdToNameMap[Paint_ToolBoxBorderTopLeft], 43195a18594SAndre Fischer mbIsHighContrastMode 43295a18594SAndre Fischer ? Any(util::Color(sal_uInt32(0x00ff00))) 43395a18594SAndre Fischer : Any(util::Color(sal_uInt32(0xf2f2f2)))); 43495a18594SAndre Fischer setPropertyValue( 43595a18594SAndre Fischer maPropertyIdToNameMap[Paint_ToolBoxBorderCenterCorners], 43695a18594SAndre Fischer mbIsHighContrastMode 43795a18594SAndre Fischer ? Any(util::Color(sal_uInt32(0x00ff00))) 43895a18594SAndre Fischer : Any(util::Color(sal_uInt32(0xf2f2f2)))); 439b9e67834SAndre Fischer setPropertyValue( 44095a18594SAndre Fischer maPropertyIdToNameMap[Paint_ToolBoxBorderBottomRight], 44195a18594SAndre Fischer mbIsHighContrastMode 44295a18594SAndre Fischer ? Any(util::Color(sal_uInt32(0x00ff00))) 44395a18594SAndre Fischer : Any(util::Color(sal_uInt32(0xf2f2f2)))); 44495a18594SAndre Fischer setPropertyValue( 44595a18594SAndre Fischer maPropertyIdToNameMap[Rect_ToolBoxPadding], 44695a18594SAndre Fischer Any(awt::Rectangle(2,2,2,2))); 44795a18594SAndre Fischer setPropertyValue( 44895a18594SAndre Fischer maPropertyIdToNameMap[Rect_ToolBoxBorder], 44995a18594SAndre Fischer Any(awt::Rectangle(1,1,1,1))); 45095a18594SAndre Fischer setPropertyValue( 45195a18594SAndre Fischer maPropertyIdToNameMap[Bool_UseToolBoxItemSeparator], 45295a18594SAndre Fischer Any(false)); 453b9e67834SAndre Fischer } 45495a18594SAndre Fischer catch(beans::UnknownPropertyException& rException) 455b9e67834SAndre Fischer { 45695a18594SAndre Fischer OSL_TRACE("unknown property: %s", 45795a18594SAndre Fischer OUStringToOString( 45895a18594SAndre Fischer rException.Message, 45995a18594SAndre Fischer RTL_TEXTENCODING_ASCII_US).getStr()); 460b9e67834SAndre Fischer OSL_ASSERT(false); 461b9e67834SAndre Fischer } 462ff12d537SAndre Fischer } 463ff12d537SAndre Fischer 464ff12d537SAndre Fischer 465ff12d537SAndre Fischer 466ff12d537SAndre Fischer 467b9e67834SAndre Fischer void SAL_CALL Theme::disposing (void) 468ff12d537SAndre Fischer { 469b9e67834SAndre Fischer ChangeListeners aListeners; 470b9e67834SAndre Fischer maChangeListeners.swap(aListeners); 471b9e67834SAndre Fischer 472b9e67834SAndre Fischer const lang::EventObject aEvent (static_cast<XWeak*>(this)); 473b9e67834SAndre Fischer 474b9e67834SAndre Fischer for (ChangeListeners::const_iterator 475b9e67834SAndre Fischer iContainer(maChangeListeners.begin()), 476b9e67834SAndre Fischer iContainerEnd(maChangeListeners.end()); 477b9e67834SAndre Fischer iContainerEnd!=iContainerEnd; 478b9e67834SAndre Fischer ++iContainerEnd) 479b9e67834SAndre Fischer { 480b9e67834SAndre Fischer for (ChangeListenerContainer::const_iterator 481b9e67834SAndre Fischer iListener(iContainer->second.begin()), 482b9e67834SAndre Fischer iEnd(iContainer->second.end()); 483b9e67834SAndre Fischer iListener!=iEnd; 484b9e67834SAndre Fischer ++iListener) 485b9e67834SAndre Fischer { 486b9e67834SAndre Fischer try 487b9e67834SAndre Fischer { 488b9e67834SAndre Fischer (*iListener)->disposing(aEvent); 489b9e67834SAndre Fischer } 490b9e67834SAndre Fischer catch(const Exception&) 491b9e67834SAndre Fischer { 492b9e67834SAndre Fischer } 493b9e67834SAndre Fischer } 494b9e67834SAndre Fischer } 495ff12d537SAndre Fischer } 496ff12d537SAndre Fischer 497ff12d537SAndre Fischer 498ff12d537SAndre Fischer 499ff12d537SAndre Fischer 500b9e67834SAndre Fischer Reference<beans::XPropertySet> Theme::GetPropertySet (void) 501ff12d537SAndre Fischer { 502b9e67834SAndre Fischer return Reference<beans::XPropertySet>(static_cast<XWeak*>(&GetCurrentTheme()), UNO_QUERY); 503ff12d537SAndre Fischer } 504ff12d537SAndre Fischer 505ff12d537SAndre Fischer 506ff12d537SAndre Fischer 507ff12d537SAndre Fischer 508b9e67834SAndre Fischer Reference<beans::XPropertySetInfo> SAL_CALL Theme::getPropertySetInfo (void) 509b9e67834SAndre Fischer throw(cssu::RuntimeException) 510ff12d537SAndre Fischer { 51195a18594SAndre Fischer return Reference<beans::XPropertySetInfo>(this); 512ff12d537SAndre Fischer } 513ff12d537SAndre Fischer 514ff12d537SAndre Fischer 515ff12d537SAndre Fischer 516ff12d537SAndre Fischer 517b9e67834SAndre Fischer void SAL_CALL Theme::setPropertyValue ( 518b9e67834SAndre Fischer const ::rtl::OUString& rsPropertyName, 519b9e67834SAndre Fischer const cssu::Any& rValue) 520b9e67834SAndre Fischer throw(cssu::RuntimeException) 521ff12d537SAndre Fischer { 522b9e67834SAndre Fischer PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); 523b9e67834SAndre Fischer if (iId == maPropertyNameToIdMap.end()) 52495a18594SAndre Fischer throw beans::UnknownPropertyException(rsPropertyName, NULL); 525b9e67834SAndre Fischer 526b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(iId->second)); 527b9e67834SAndre Fischer if (eType == PT_Invalid) 52895a18594SAndre Fischer throw beans::UnknownPropertyException(rsPropertyName, NULL); 529b9e67834SAndre Fischer 530b9e67834SAndre Fischer const ThemeItem eItem (iId->second); 531b9e67834SAndre Fischer 532b9e67834SAndre Fischer if (rValue == maRawValues[eItem]) 533b9e67834SAndre Fischer { 534b9e67834SAndre Fischer // Value is not different from the one in the property 535b9e67834SAndre Fischer // set => nothing to do. 536b9e67834SAndre Fischer return; 537b9e67834SAndre Fischer } 538b9e67834SAndre Fischer 539b9e67834SAndre Fischer const Any aOldValue (maRawValues[eItem]); 540b9e67834SAndre Fischer 541b9e67834SAndre Fischer const beans::PropertyChangeEvent aEvent( 542b9e67834SAndre Fischer static_cast<XWeak*>(this), 543b9e67834SAndre Fischer rsPropertyName, 544b9e67834SAndre Fischer sal_False, 545b9e67834SAndre Fischer eItem, 546b9e67834SAndre Fischer aOldValue, 547b9e67834SAndre Fischer rValue); 548b9e67834SAndre Fischer 549b9e67834SAndre Fischer if (DoVetoableListenersVeto(GetVetoableListeners(__AnyItem, false), aEvent)) 550b9e67834SAndre Fischer return; 551b9e67834SAndre Fischer if (DoVetoableListenersVeto(GetVetoableListeners(eItem, false), aEvent)) 552b9e67834SAndre Fischer return; 553b9e67834SAndre Fischer 554b9e67834SAndre Fischer maRawValues[eItem] = rValue; 555b9e67834SAndre Fischer ProcessNewValue(rValue, eItem, eType); 556b9e67834SAndre Fischer 557b9e67834SAndre Fischer BroadcastPropertyChange(GetChangeListeners(__AnyItem, false), aEvent); 558b9e67834SAndre Fischer BroadcastPropertyChange(GetChangeListeners(eItem, false), aEvent); 559ff12d537SAndre Fischer } 560ff12d537SAndre Fischer 561ff12d537SAndre Fischer 562ff12d537SAndre Fischer 563ff12d537SAndre Fischer 564b9e67834SAndre Fischer Any SAL_CALL Theme::getPropertyValue ( 565b9e67834SAndre Fischer const ::rtl::OUString& rsPropertyName) 566b9e67834SAndre Fischer throw(css::beans::UnknownPropertyException, 567b9e67834SAndre Fischer css::lang::WrappedTargetException, 568b9e67834SAndre Fischer cssu::RuntimeException) 569ff12d537SAndre Fischer { 570b9e67834SAndre Fischer PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); 571b9e67834SAndre Fischer if (iId == maPropertyNameToIdMap.end()) 572b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 573b9e67834SAndre Fischer 574b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(iId->second)); 575b9e67834SAndre Fischer if (eType == PT_Invalid) 576b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 577b9e67834SAndre Fischer 578b9e67834SAndre Fischer const ThemeItem eItem (iId->second); 579b9e67834SAndre Fischer 580b9e67834SAndre Fischer return maRawValues[eItem]; 581ff12d537SAndre Fischer } 582ff12d537SAndre Fischer 583ff12d537SAndre Fischer 584ff12d537SAndre Fischer 585ff12d537SAndre Fischer 586b9e67834SAndre Fischer void SAL_CALL Theme::addPropertyChangeListener( 587b9e67834SAndre Fischer const ::rtl::OUString& rsPropertyName, 588b9e67834SAndre Fischer const cssu::Reference<css::beans::XPropertyChangeListener>& rxListener) 589b9e67834SAndre Fischer throw(css::beans::UnknownPropertyException, 590b9e67834SAndre Fischer css::lang::WrappedTargetException, 591b9e67834SAndre Fischer cssu::RuntimeException) 592ff12d537SAndre Fischer { 593b9e67834SAndre Fischer ThemeItem eItem (__AnyItem); 594b9e67834SAndre Fischer if (rsPropertyName.getLength() > 0) 595b9e67834SAndre Fischer { 596b9e67834SAndre Fischer PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); 597b9e67834SAndre Fischer if (iId == maPropertyNameToIdMap.end()) 598b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 599b9e67834SAndre Fischer 600b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(iId->second)); 601b9e67834SAndre Fischer if (eType == PT_Invalid) 602b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 603b9e67834SAndre Fischer 604b9e67834SAndre Fischer eItem = iId->second; 605b9e67834SAndre Fischer } 606b9e67834SAndre Fischer ChangeListenerContainer* pListeners = GetChangeListeners(eItem, true); 607b9e67834SAndre Fischer if (pListeners != NULL) 608b9e67834SAndre Fischer pListeners->push_back(rxListener); 609ff12d537SAndre Fischer } 610ff12d537SAndre Fischer 611ff12d537SAndre Fischer 612ff12d537SAndre Fischer 613ff12d537SAndre Fischer 614b9e67834SAndre Fischer void SAL_CALL Theme::removePropertyChangeListener( 615b9e67834SAndre Fischer const ::rtl::OUString& rsPropertyName, 616b9e67834SAndre Fischer const cssu::Reference<css::beans::XPropertyChangeListener>& rxListener) 617b9e67834SAndre Fischer throw(css::beans::UnknownPropertyException, 618b9e67834SAndre Fischer css::lang::WrappedTargetException, 619b9e67834SAndre Fischer cssu::RuntimeException) 620ff12d537SAndre Fischer { 621b9e67834SAndre Fischer ThemeItem eItem (__AnyItem); 622b9e67834SAndre Fischer if (rsPropertyName.getLength() > 0) 623b9e67834SAndre Fischer { 624b9e67834SAndre Fischer PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); 625b9e67834SAndre Fischer if (iId == maPropertyNameToIdMap.end()) 626b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 627b9e67834SAndre Fischer 628b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(iId->second)); 629b9e67834SAndre Fischer if (eType == PT_Invalid) 630b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 631b9e67834SAndre Fischer 632b9e67834SAndre Fischer eItem = iId->second; 633b9e67834SAndre Fischer } 634b9e67834SAndre Fischer ChangeListenerContainer* pContainer = GetChangeListeners(eItem, false); 635b9e67834SAndre Fischer if (pContainer != NULL) 636b9e67834SAndre Fischer { 637b9e67834SAndre Fischer ChangeListenerContainer::iterator iListener (::std::find(pContainer->begin(), pContainer->end(), rxListener)); 638b9e67834SAndre Fischer if (iListener != pContainer->end()) 639b9e67834SAndre Fischer { 640b9e67834SAndre Fischer pContainer->erase(iListener); 641b9e67834SAndre Fischer 642b9e67834SAndre Fischer // Remove the listener container when empty. 643b9e67834SAndre Fischer if (pContainer->empty()) 644b9e67834SAndre Fischer maChangeListeners.erase(eItem); 645b9e67834SAndre Fischer } 646b9e67834SAndre Fischer } 647ff12d537SAndre Fischer } 648ff12d537SAndre Fischer 649ff12d537SAndre Fischer 650ff12d537SAndre Fischer 651ff12d537SAndre Fischer 652b9e67834SAndre Fischer void SAL_CALL Theme::addVetoableChangeListener( 653b9e67834SAndre Fischer const ::rtl::OUString& rsPropertyName, 654b9e67834SAndre Fischer const cssu::Reference<css::beans::XVetoableChangeListener>& rxListener) 655b9e67834SAndre Fischer throw(css::beans::UnknownPropertyException, 656b9e67834SAndre Fischer css::lang::WrappedTargetException, 657b9e67834SAndre Fischer cssu::RuntimeException) 658ff12d537SAndre Fischer { 659b9e67834SAndre Fischer ThemeItem eItem (__AnyItem); 660b9e67834SAndre Fischer if (rsPropertyName.getLength() > 0) 661b9e67834SAndre Fischer { 662b9e67834SAndre Fischer PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); 663b9e67834SAndre Fischer if (iId == maPropertyNameToIdMap.end()) 664b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 665b9e67834SAndre Fischer 666b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(iId->second)); 667b9e67834SAndre Fischer if (eType == PT_Invalid) 668b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 669b9e67834SAndre Fischer 670b9e67834SAndre Fischer eItem = iId->second; 671b9e67834SAndre Fischer } 672b9e67834SAndre Fischer VetoableListenerContainer* pListeners = GetVetoableListeners(eItem, true); 673b9e67834SAndre Fischer if (pListeners != NULL) 674b9e67834SAndre Fischer pListeners->push_back(rxListener); 675ff12d537SAndre Fischer } 676ff12d537SAndre Fischer 677ff12d537SAndre Fischer 678ff12d537SAndre Fischer 679ff12d537SAndre Fischer 680b9e67834SAndre Fischer void SAL_CALL Theme::removeVetoableChangeListener( 681b9e67834SAndre Fischer const ::rtl::OUString& rsPropertyName, 682b9e67834SAndre Fischer const cssu::Reference<css::beans::XVetoableChangeListener>& rxListener) 683b9e67834SAndre Fischer throw(css::beans::UnknownPropertyException, 684b9e67834SAndre Fischer css::lang::WrappedTargetException, 685b9e67834SAndre Fischer cssu::RuntimeException) 686ff12d537SAndre Fischer { 687b9e67834SAndre Fischer ThemeItem eItem (__AnyItem); 688b9e67834SAndre Fischer if (rsPropertyName.getLength() > 0) 689b9e67834SAndre Fischer { 690b9e67834SAndre Fischer PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); 691b9e67834SAndre Fischer if (iId == maPropertyNameToIdMap.end()) 692b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 693b9e67834SAndre Fischer 694b9e67834SAndre Fischer const PropertyType eType (GetPropertyType(iId->second)); 695b9e67834SAndre Fischer if (eType == PT_Invalid) 696b9e67834SAndre Fischer throw beans::UnknownPropertyException(); 697b9e67834SAndre Fischer 698b9e67834SAndre Fischer eItem = iId->second; 699b9e67834SAndre Fischer } 700b9e67834SAndre Fischer VetoableListenerContainer* pContainer = GetVetoableListeners(eItem, false); 701b9e67834SAndre Fischer if (pContainer != NULL) 702b9e67834SAndre Fischer { 703b9e67834SAndre Fischer VetoableListenerContainer::iterator iListener (::std::find(pContainer->begin(), pContainer->end(), rxListener)); 704b9e67834SAndre Fischer if (iListener != pContainer->end()) 705b9e67834SAndre Fischer { 706b9e67834SAndre Fischer pContainer->erase(iListener); 707b9e67834SAndre Fischer // Remove container when empty. 708b9e67834SAndre Fischer if (pContainer->empty()) 709b9e67834SAndre Fischer maVetoableListeners.erase(eItem); 710b9e67834SAndre Fischer } 711b9e67834SAndre Fischer } 712ff12d537SAndre Fischer } 713ff12d537SAndre Fischer 714ff12d537SAndre Fischer 715ff12d537SAndre Fischer 716ff12d537SAndre Fischer 71795a18594SAndre Fischer cssu::Sequence<css::beans::Property> SAL_CALL Theme::getProperties (void) 71895a18594SAndre Fischer throw(cssu::RuntimeException) 71995a18594SAndre Fischer { 72095a18594SAndre Fischer ::std::vector<beans::Property> aProperties; 72195a18594SAndre Fischer 72295a18594SAndre Fischer for (sal_Int32 nItem(__Begin),nEnd(__End); nItem!=nEnd; ++nItem) 72395a18594SAndre Fischer { 72495a18594SAndre Fischer const ThemeItem eItem (static_cast<ThemeItem>(nItem)); 72595a18594SAndre Fischer const PropertyType eType (GetPropertyType(eItem)); 72695a18594SAndre Fischer if (eType == PT_Invalid) 72795a18594SAndre Fischer continue; 72895a18594SAndre Fischer 72995a18594SAndre Fischer const beans::Property aProperty( 73095a18594SAndre Fischer maPropertyIdToNameMap[eItem], 73195a18594SAndre Fischer eItem, 73295a18594SAndre Fischer GetCppuType(eType), 73395a18594SAndre Fischer 0); 73495a18594SAndre Fischer aProperties.push_back(aProperty); 73595a18594SAndre Fischer } 73695a18594SAndre Fischer 73795a18594SAndre Fischer return cssu::Sequence<css::beans::Property>( 73895a18594SAndre Fischer &aProperties.front(), 73995a18594SAndre Fischer aProperties.size()); 74095a18594SAndre Fischer } 74195a18594SAndre Fischer 74295a18594SAndre Fischer 74395a18594SAndre Fischer 74495a18594SAndre Fischer 74595a18594SAndre Fischer beans::Property SAL_CALL Theme::getPropertyByName (const ::rtl::OUString& rsPropertyName) 74695a18594SAndre Fischer throw(css::beans::UnknownPropertyException, 74795a18594SAndre Fischer cssu::RuntimeException) 74895a18594SAndre Fischer { 74995a18594SAndre Fischer PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); 75095a18594SAndre Fischer if (iId == maPropertyNameToIdMap.end()) 75195a18594SAndre Fischer throw beans::UnknownPropertyException(); 75295a18594SAndre Fischer 75395a18594SAndre Fischer const PropertyType eType (GetPropertyType(iId->second)); 75495a18594SAndre Fischer if (eType == PT_Invalid) 75595a18594SAndre Fischer throw beans::UnknownPropertyException(); 75695a18594SAndre Fischer 75795a18594SAndre Fischer const ThemeItem eItem (iId->second); 75895a18594SAndre Fischer 75995a18594SAndre Fischer return beans::Property( 76095a18594SAndre Fischer rsPropertyName, 76195a18594SAndre Fischer eItem, 76295a18594SAndre Fischer GetCppuType(eType), 76395a18594SAndre Fischer 0); 76495a18594SAndre Fischer } 76595a18594SAndre Fischer 76695a18594SAndre Fischer 76795a18594SAndre Fischer 76895a18594SAndre Fischer 76995a18594SAndre Fischer sal_Bool SAL_CALL Theme::hasPropertyByName (const ::rtl::OUString& rsPropertyName) 77095a18594SAndre Fischer throw(cssu::RuntimeException) 77195a18594SAndre Fischer { 77295a18594SAndre Fischer PropertyNameToIdMap::const_iterator iId (maPropertyNameToIdMap.find(rsPropertyName)); 77395a18594SAndre Fischer if (iId == maPropertyNameToIdMap.end()) 77495a18594SAndre Fischer return sal_False; 77595a18594SAndre Fischer 77695a18594SAndre Fischer const PropertyType eType (GetPropertyType(iId->second)); 77795a18594SAndre Fischer if (eType == PT_Invalid) 77895a18594SAndre Fischer return sal_False; 77995a18594SAndre Fischer 78095a18594SAndre Fischer return sal_True; 78195a18594SAndre Fischer } 78295a18594SAndre Fischer 78395a18594SAndre Fischer 78495a18594SAndre Fischer 78595a18594SAndre Fischer 786b9e67834SAndre Fischer void Theme::SetupPropertyMaps (void) 787ff12d537SAndre Fischer { 78895a18594SAndre Fischer maPropertyIdToNameMap.resize(__Post_Rect); 789b9e67834SAndre Fischer maImages.resize(__Image_Color - __Pre_Image - 1); 790b9e67834SAndre Fischer maColors.resize(__Color_Paint - __Image_Color - 1); 791b9e67834SAndre Fischer maPaints.resize(__Paint_Int - __Color_Paint - 1); 792b9e67834SAndre Fischer maIntegers.resize(__Int_Bool - __Paint_Int - 1); 79395a18594SAndre Fischer maBooleans.resize(__Bool_Rect - __Int_Bool - 1); 79495a18594SAndre Fischer maRectangles.resize(__Post_Rect - __Bool_Rect - 1); 795b9e67834SAndre Fischer 796b9e67834SAndre Fischer #define AddEntry(e) maPropertyNameToIdMap[A2S(#e)]=e; maPropertyIdToNameMap[e]=A2S(#e) 79795a18594SAndre Fischer 798b9e67834SAndre Fischer AddEntry(Image_Grip); 799b9e67834SAndre Fischer AddEntry(Image_Expand); 800b9e67834SAndre Fischer AddEntry(Image_Collapse); 8017a32b0c8SAndre Fischer AddEntry(Image_TabBarMenu); 8027a32b0c8SAndre Fischer AddEntry(Image_PanelMenu); 80395a18594SAndre Fischer AddEntry(Image_ToolBoxItemSeparator); 8047a32b0c8SAndre Fischer AddEntry(Image_Closer); 805b9e67834SAndre Fischer 806b9e67834SAndre Fischer AddEntry(Color_DeckTitleFont); 807b9e67834SAndre Fischer AddEntry(Color_PanelTitleFont); 808b9e67834SAndre Fischer AddEntry(Color_TabMenuSeparator); 809b9e67834SAndre Fischer AddEntry(Color_TabItemBorder); 8108dcb2a10SAndre Fischer AddEntry(Color_DropDownBorder); 8115f1c83ffSOliver-Rainer Wittmann AddEntry(Color_Highlight); 8125f1c83ffSOliver-Rainer Wittmann AddEntry(Color_HighlightText); 813b9e67834SAndre Fischer 814b9e67834SAndre Fischer AddEntry(Paint_DeckBackground); 815b9e67834SAndre Fischer AddEntry(Paint_DeckTitleBarBackground); 816b9e67834SAndre Fischer AddEntry(Paint_PanelBackground); 817b9e67834SAndre Fischer AddEntry(Paint_PanelTitleBarBackground); 818b9e67834SAndre Fischer AddEntry(Paint_TabBarBackground); 81995a18594SAndre Fischer AddEntry(Paint_TabItemBackgroundNormal); 82095a18594SAndre Fischer AddEntry(Paint_TabItemBackgroundHighlight); 821b9e67834SAndre Fischer AddEntry(Paint_HorizontalBorder); 822b9e67834SAndre Fischer AddEntry(Paint_VerticalBorder); 82395a18594SAndre Fischer AddEntry(Paint_ToolBoxBackground); 82495a18594SAndre Fischer AddEntry(Paint_ToolBoxBorderTopLeft); 82595a18594SAndre Fischer AddEntry(Paint_ToolBoxBorderCenterCorners); 82695a18594SAndre Fischer AddEntry(Paint_ToolBoxBorderBottomRight); 8278dcb2a10SAndre Fischer AddEntry(Paint_DropDownBackground); 828b9e67834SAndre Fischer 829b9e67834SAndre Fischer AddEntry(Int_DeckTitleBarHeight); 830b9e67834SAndre Fischer AddEntry(Int_DeckBorderSize); 831b9e67834SAndre Fischer AddEntry(Int_DeckSeparatorHeight); 832b9e67834SAndre Fischer AddEntry(Int_PanelTitleBarHeight); 833b9e67834SAndre Fischer AddEntry(Int_TabMenuPadding); 834b9e67834SAndre Fischer AddEntry(Int_TabMenuSeparatorPadding); 835b9e67834SAndre Fischer AddEntry(Int_TabItemWidth); 836b9e67834SAndre Fischer AddEntry(Int_TabItemHeight); 837b9e67834SAndre Fischer AddEntry(Int_DeckLeftPadding); 838b9e67834SAndre Fischer AddEntry(Int_DeckTopPadding); 839b9e67834SAndre Fischer AddEntry(Int_DeckRightPadding); 840b9e67834SAndre Fischer AddEntry(Int_DeckBottomPadding); 841b9e67834SAndre Fischer AddEntry(Int_TabBarLeftPadding); 842b9e67834SAndre Fischer AddEntry(Int_TabBarTopPadding); 843b9e67834SAndre Fischer AddEntry(Int_TabBarRightPadding); 844b9e67834SAndre Fischer AddEntry(Int_TabBarBottomPadding); 845b9e67834SAndre Fischer 846b9e67834SAndre Fischer AddEntry(Bool_UseSymphonyIcons); 84795a18594SAndre Fischer AddEntry(Bool_UseSystemColors); 84895a18594SAndre Fischer AddEntry(Bool_UseToolBoxItemSeparator); 84995a18594SAndre Fischer AddEntry(Bool_IsHighContrastModeActive); 85095a18594SAndre Fischer 85195a18594SAndre Fischer AddEntry(Rect_ToolBoxPadding); 85295a18594SAndre Fischer AddEntry(Rect_ToolBoxBorder); 85395a18594SAndre Fischer 854b9e67834SAndre Fischer #undef AddEntry 855b9e67834SAndre Fischer 856b9e67834SAndre Fischer maRawValues.resize(maPropertyIdToNameMap.size()); 857ff12d537SAndre Fischer } 858ff12d537SAndre Fischer 859ff12d537SAndre Fischer 860ff12d537SAndre Fischer 861ff12d537SAndre Fischer 862b9e67834SAndre Fischer Theme::PropertyType Theme::GetPropertyType (const ThemeItem eItem) 863ff12d537SAndre Fischer { 864b9e67834SAndre Fischer switch(eItem) 865b9e67834SAndre Fischer { 866b9e67834SAndre Fischer case Image_Grip: 867b9e67834SAndre Fischer case Image_Expand: 868b9e67834SAndre Fischer case Image_Collapse: 8697a32b0c8SAndre Fischer case Image_TabBarMenu: 8707a32b0c8SAndre Fischer case Image_PanelMenu: 87195a18594SAndre Fischer case Image_ToolBoxItemSeparator: 8727a32b0c8SAndre Fischer case Image_Closer: 873b9e67834SAndre Fischer return PT_Image; 874b9e67834SAndre Fischer 875b9e67834SAndre Fischer case Color_DeckTitleFont: 876b9e67834SAndre Fischer case Color_PanelTitleFont: 877b9e67834SAndre Fischer case Color_TabMenuSeparator: 878b9e67834SAndre Fischer case Color_TabItemBorder: 8798dcb2a10SAndre Fischer case Color_DropDownBorder: 8805f1c83ffSOliver-Rainer Wittmann case Color_Highlight: 8815f1c83ffSOliver-Rainer Wittmann case Color_HighlightText: 882b9e67834SAndre Fischer return PT_Color; 883b9e67834SAndre Fischer 884b9e67834SAndre Fischer case Paint_DeckBackground: 885b9e67834SAndre Fischer case Paint_DeckTitleBarBackground: 886b9e67834SAndre Fischer case Paint_PanelBackground: 887b9e67834SAndre Fischer case Paint_PanelTitleBarBackground: 888b9e67834SAndre Fischer case Paint_TabBarBackground: 88995a18594SAndre Fischer case Paint_TabItemBackgroundNormal: 89095a18594SAndre Fischer case Paint_TabItemBackgroundHighlight: 891b9e67834SAndre Fischer case Paint_HorizontalBorder: 892b9e67834SAndre Fischer case Paint_VerticalBorder: 89395a18594SAndre Fischer case Paint_ToolBoxBackground: 89495a18594SAndre Fischer case Paint_ToolBoxBorderTopLeft: 89595a18594SAndre Fischer case Paint_ToolBoxBorderCenterCorners: 89695a18594SAndre Fischer case Paint_ToolBoxBorderBottomRight: 8978dcb2a10SAndre Fischer case Paint_DropDownBackground: 898b9e67834SAndre Fischer return PT_Paint; 899b9e67834SAndre Fischer 900b9e67834SAndre Fischer case Int_DeckTitleBarHeight: 901b9e67834SAndre Fischer case Int_DeckBorderSize: 902b9e67834SAndre Fischer case Int_DeckSeparatorHeight: 903b9e67834SAndre Fischer case Int_PanelTitleBarHeight: 904b9e67834SAndre Fischer case Int_TabMenuPadding: 905b9e67834SAndre Fischer case Int_TabMenuSeparatorPadding: 906b9e67834SAndre Fischer case Int_TabItemWidth: 907b9e67834SAndre Fischer case Int_TabItemHeight: 908b9e67834SAndre Fischer case Int_DeckLeftPadding: 909b9e67834SAndre Fischer case Int_DeckTopPadding: 910b9e67834SAndre Fischer case Int_DeckRightPadding: 911b9e67834SAndre Fischer case Int_DeckBottomPadding: 912b9e67834SAndre Fischer case Int_TabBarLeftPadding: 913b9e67834SAndre Fischer case Int_TabBarTopPadding: 914b9e67834SAndre Fischer case Int_TabBarRightPadding: 915b9e67834SAndre Fischer case Int_TabBarBottomPadding: 916b9e67834SAndre Fischer return PT_Integer; 917b9e67834SAndre Fischer 918b9e67834SAndre Fischer case Bool_UseSymphonyIcons: 91995a18594SAndre Fischer case Bool_UseSystemColors: 92095a18594SAndre Fischer case Bool_UseToolBoxItemSeparator: 92195a18594SAndre Fischer case Bool_IsHighContrastModeActive: 922b9e67834SAndre Fischer return PT_Boolean; 923b9e67834SAndre Fischer 92495a18594SAndre Fischer case Rect_ToolBoxBorder: 92595a18594SAndre Fischer case Rect_ToolBoxPadding: 92695a18594SAndre Fischer return PT_Rectangle; 92795a18594SAndre Fischer 928b9e67834SAndre Fischer default: 929b9e67834SAndre Fischer return PT_Invalid; 930b9e67834SAndre Fischer } 931ff12d537SAndre Fischer } 932ff12d537SAndre Fischer 933ff12d537SAndre Fischer 934ff12d537SAndre Fischer 935ff12d537SAndre Fischer 93695a18594SAndre Fischer cssu::Type Theme::GetCppuType (const PropertyType eType) 93795a18594SAndre Fischer { 93895a18594SAndre Fischer switch(eType) 93995a18594SAndre Fischer { 94095a18594SAndre Fischer case PT_Image: 94195a18594SAndre Fischer return getCppuType((rtl::OUString*)NULL); 94295a18594SAndre Fischer 94395a18594SAndre Fischer case PT_Color: 94495a18594SAndre Fischer return getCppuType((sal_uInt32*)NULL); 94595a18594SAndre Fischer 94695a18594SAndre Fischer case PT_Paint: 94795a18594SAndre Fischer return getCppuVoidType(); 94895a18594SAndre Fischer 94995a18594SAndre Fischer case PT_Integer: 95095a18594SAndre Fischer return getCppuType((sal_Int32*)NULL); 95195a18594SAndre Fischer 95295a18594SAndre Fischer case PT_Boolean: 95395a18594SAndre Fischer return getCppuType((sal_Bool*)NULL); 95495a18594SAndre Fischer 95595a18594SAndre Fischer case PT_Rectangle: 95695a18594SAndre Fischer return getCppuType((awt::Rectangle*)NULL); 95795a18594SAndre Fischer 95895a18594SAndre Fischer case PT_Invalid: 95995a18594SAndre Fischer default: 96095a18594SAndre Fischer return getCppuVoidType(); 96195a18594SAndre Fischer } 96295a18594SAndre Fischer } 96395a18594SAndre Fischer 96495a18594SAndre Fischer 96595a18594SAndre Fischer 96695a18594SAndre Fischer 967b9e67834SAndre Fischer sal_Int32 Theme::GetIndex (const ThemeItem eItem, const PropertyType eType) 968ff12d537SAndre Fischer { 969b9e67834SAndre Fischer switch(eType) 970b9e67834SAndre Fischer { 971b9e67834SAndre Fischer case PT_Image: 972b9e67834SAndre Fischer return eItem - __Pre_Image-1; 973b9e67834SAndre Fischer case PT_Color: 974b9e67834SAndre Fischer return eItem - __Image_Color-1; 975b9e67834SAndre Fischer case PT_Paint: 976b9e67834SAndre Fischer return eItem - __Color_Paint-1; 977b9e67834SAndre Fischer case PT_Integer: 978b9e67834SAndre Fischer return eItem - __Paint_Int-1; 979b9e67834SAndre Fischer case PT_Boolean: 980b9e67834SAndre Fischer return eItem - __Int_Bool-1; 98195a18594SAndre Fischer case PT_Rectangle: 98295a18594SAndre Fischer return eItem - __Bool_Rect-1; 983b9e67834SAndre Fischer 984b9e67834SAndre Fischer default: 985b9e67834SAndre Fischer OSL_ASSERT(false); 986b9e67834SAndre Fischer return 0; 987b9e67834SAndre Fischer } 988ff12d537SAndre Fischer } 989ff12d537SAndre Fischer 990ff12d537SAndre Fischer 991ff12d537SAndre Fischer 992ff12d537SAndre Fischer 993b9e67834SAndre Fischer Theme::VetoableListenerContainer* Theme::GetVetoableListeners ( 994b9e67834SAndre Fischer const ThemeItem eItem, 995b9e67834SAndre Fischer const bool bCreate) 996ff12d537SAndre Fischer { 997b9e67834SAndre Fischer VetoableListeners::iterator iContainer (maVetoableListeners.find(eItem)); 998b9e67834SAndre Fischer if (iContainer != maVetoableListeners.end()) 999b9e67834SAndre Fischer return &iContainer->second; 1000b9e67834SAndre Fischer else if (bCreate) 1001b9e67834SAndre Fischer { 1002b9e67834SAndre Fischer maVetoableListeners[eItem] = VetoableListenerContainer(); 1003b9e67834SAndre Fischer return &maVetoableListeners[eItem]; 1004b9e67834SAndre Fischer } 1005b9e67834SAndre Fischer else 1006b9e67834SAndre Fischer return NULL; 1007ff12d537SAndre Fischer } 1008ff12d537SAndre Fischer 1009ff12d537SAndre Fischer 1010ff12d537SAndre Fischer 1011ff12d537SAndre Fischer 1012b9e67834SAndre Fischer Theme::ChangeListenerContainer* Theme::GetChangeListeners ( 1013b9e67834SAndre Fischer const ThemeItem eItem, 1014b9e67834SAndre Fischer const bool bCreate) 1015ff12d537SAndre Fischer { 1016b9e67834SAndre Fischer ChangeListeners::iterator iContainer (maChangeListeners.find(eItem)); 1017b9e67834SAndre Fischer if (iContainer != maChangeListeners.end()) 1018b9e67834SAndre Fischer return &iContainer->second; 1019b9e67834SAndre Fischer else if (bCreate) 1020b9e67834SAndre Fischer { 1021b9e67834SAndre Fischer maChangeListeners[eItem] = ChangeListenerContainer(); 1022b9e67834SAndre Fischer return &maChangeListeners[eItem]; 1023b9e67834SAndre Fischer } 1024b9e67834SAndre Fischer else 1025b9e67834SAndre Fischer return NULL; 1026ff12d537SAndre Fischer } 1027ff12d537SAndre Fischer 1028ff12d537SAndre Fischer 1029ff12d537SAndre Fischer 1030ff12d537SAndre Fischer 1031b9e67834SAndre Fischer bool Theme::DoVetoableListenersVeto ( 1032b9e67834SAndre Fischer const VetoableListenerContainer* pListeners, 1033b9e67834SAndre Fischer const beans::PropertyChangeEvent& rEvent) const 1034ff12d537SAndre Fischer { 1035b9e67834SAndre Fischer if (pListeners == NULL) 1036b9e67834SAndre Fischer return false; 1037b9e67834SAndre Fischer 1038b9e67834SAndre Fischer VetoableListenerContainer aListeners (*pListeners); 1039b9e67834SAndre Fischer try 1040b9e67834SAndre Fischer { 1041b9e67834SAndre Fischer for (VetoableListenerContainer::const_iterator 1042b9e67834SAndre Fischer iListener(aListeners.begin()), 1043b9e67834SAndre Fischer iEnd(aListeners.end()); 1044b9e67834SAndre Fischer iListener!=iEnd; 1045b9e67834SAndre Fischer ++iListener) 1046b9e67834SAndre Fischer { 1047b9e67834SAndre Fischer (*iListener)->vetoableChange(rEvent); 1048b9e67834SAndre Fischer } 1049b9e67834SAndre Fischer } 1050b9e67834SAndre Fischer catch(const beans::PropertyVetoException&) 1051b9e67834SAndre Fischer { 1052b9e67834SAndre Fischer return true; 1053b9e67834SAndre Fischer } 1054b9e67834SAndre Fischer catch(const Exception&) 1055b9e67834SAndre Fischer { 1056b9e67834SAndre Fischer // Ignore any other errors (such as disposed listeners). 1057b9e67834SAndre Fischer } 1058b9e67834SAndre Fischer return false; 1059ff12d537SAndre Fischer } 1060ff12d537SAndre Fischer 1061ff12d537SAndre Fischer 1062ff12d537SAndre Fischer 1063ff12d537SAndre Fischer 1064b9e67834SAndre Fischer void Theme::BroadcastPropertyChange ( 1065b9e67834SAndre Fischer const ChangeListenerContainer* pListeners, 1066b9e67834SAndre Fischer const beans::PropertyChangeEvent& rEvent) const 1067ff12d537SAndre Fischer { 1068b9e67834SAndre Fischer if (pListeners == NULL) 1069b9e67834SAndre Fischer return; 1070b9e67834SAndre Fischer 1071b9e67834SAndre Fischer const ChangeListenerContainer aListeners (*pListeners); 1072b9e67834SAndre Fischer try 1073b9e67834SAndre Fischer { 1074b9e67834SAndre Fischer for (ChangeListenerContainer::const_iterator 1075b9e67834SAndre Fischer iListener(aListeners.begin()), 1076b9e67834SAndre Fischer iEnd(aListeners.end()); 1077b9e67834SAndre Fischer iListener!=iEnd; 1078b9e67834SAndre Fischer ++iListener) 1079b9e67834SAndre Fischer { 1080b9e67834SAndre Fischer (*iListener)->propertyChange(rEvent); 1081b9e67834SAndre Fischer } 1082b9e67834SAndre Fischer } 1083b9e67834SAndre Fischer catch(const Exception&) 1084b9e67834SAndre Fischer { 1085b9e67834SAndre Fischer // Ignore any errors (such as disposed listeners). 1086b9e67834SAndre Fischer } 1087ff12d537SAndre Fischer } 1088ff12d537SAndre Fischer 1089ff12d537SAndre Fischer 1090ff12d537SAndre Fischer 1091ff12d537SAndre Fischer 1092b9e67834SAndre Fischer void Theme::ProcessNewValue ( 1093b9e67834SAndre Fischer const Any& rValue, 1094b9e67834SAndre Fischer const ThemeItem eItem, 1095b9e67834SAndre Fischer const PropertyType eType) 1096ff12d537SAndre Fischer { 1097b9e67834SAndre Fischer const sal_Int32 nIndex (GetIndex (eItem, eType)); 1098b9e67834SAndre Fischer switch (eType) 1099b9e67834SAndre Fischer { 1100b9e67834SAndre Fischer case PT_Image: 1101b9e67834SAndre Fischer { 1102b9e67834SAndre Fischer ::rtl::OUString sURL; 1103b9e67834SAndre Fischer if (rValue >>= sURL) 1104b9e67834SAndre Fischer { 1105b9e67834SAndre Fischer maImages[nIndex] = Tools::GetImage(sURL, NULL); 1106b9e67834SAndre Fischer } 1107b9e67834SAndre Fischer break; 1108b9e67834SAndre Fischer } 1109b9e67834SAndre Fischer case PT_Color: 1110b9e67834SAndre Fischer { 111195a18594SAndre Fischer sal_Int32 nColorValue (0); 1112b9e67834SAndre Fischer if (rValue >>= nColorValue) 1113b9e67834SAndre Fischer { 1114b9e67834SAndre Fischer maColors[nIndex] = Color(nColorValue); 1115b9e67834SAndre Fischer } 1116b9e67834SAndre Fischer break; 1117b9e67834SAndre Fischer } 1118b9e67834SAndre Fischer case PT_Paint: 1119b9e67834SAndre Fischer { 112095a18594SAndre Fischer maPaints[nIndex] = Paint::Create(rValue); 1121b9e67834SAndre Fischer break; 1122b9e67834SAndre Fischer } 1123b9e67834SAndre Fischer case PT_Integer: 1124b9e67834SAndre Fischer { 112595a18594SAndre Fischer sal_Int32 nValue (0); 1126b9e67834SAndre Fischer if (rValue >>= nValue) 1127b9e67834SAndre Fischer { 1128b9e67834SAndre Fischer maIntegers[nIndex] = nValue; 1129b9e67834SAndre Fischer } 1130b9e67834SAndre Fischer break; 1131b9e67834SAndre Fischer } 1132b9e67834SAndre Fischer case PT_Boolean: 1133b9e67834SAndre Fischer { 113495a18594SAndre Fischer sal_Bool nValue (0); 1135b9e67834SAndre Fischer if (rValue >>= nValue) 1136b9e67834SAndre Fischer { 1137b9e67834SAndre Fischer maBooleans[nIndex] = (nValue==sal_True); 113895a18594SAndre Fischer if (eItem == Bool_IsHighContrastModeActive) 113995a18594SAndre Fischer { 114095a18594SAndre Fischer mbIsHighContrastModeSetManually = true; 114195a18594SAndre Fischer mbIsHighContrastMode = maBooleans[nIndex]; 114295a18594SAndre Fischer HandleDataChange(); 114395a18594SAndre Fischer } 114495a18594SAndre Fischer else if (eItem == Bool_UseSystemColors) 114595a18594SAndre Fischer { 114695a18594SAndre Fischer HandleDataChange(); 114795a18594SAndre Fischer } 114895a18594SAndre Fischer } 114995a18594SAndre Fischer break; 115095a18594SAndre Fischer } 115195a18594SAndre Fischer case PT_Rectangle: 115295a18594SAndre Fischer { 115395a18594SAndre Fischer awt::Rectangle aBox; 115495a18594SAndre Fischer if (rValue >>= aBox) 115595a18594SAndre Fischer { 115695a18594SAndre Fischer maRectangles[nIndex] = Rectangle( 115795a18594SAndre Fischer aBox.X, 115895a18594SAndre Fischer aBox.Y, 115995a18594SAndre Fischer aBox.Width, 116095a18594SAndre Fischer aBox.Height); 1161b9e67834SAndre Fischer } 1162b9e67834SAndre Fischer break; 1163b9e67834SAndre Fischer } 1164b9e67834SAndre Fischer case PT_Invalid: 1165b9e67834SAndre Fischer OSL_ASSERT(eType != PT_Invalid); 1166b9e67834SAndre Fischer throw RuntimeException(); 1167b9e67834SAndre Fischer } 1168ff12d537SAndre Fischer } 1169ff12d537SAndre Fischer 1170b9e67834SAndre Fischer 1171b9e67834SAndre Fischer 1172b9e67834SAndre Fischer 1173ff12d537SAndre Fischer } } // end of namespace sfx2::sidebar 1174