1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 #include "stylesettings.hxx"
22 #include <toolkit/awt/vclxwindow.hxx>
23 #include <toolkit/helper/vclunohelper.hxx>
25 #include <com/sun/star/lang/DisposedException.hpp>
27 #include <osl/diagnose.h>
28 #include <osl/mutex.hxx>
29 #include <vcl/event.hxx>
30 #include <vcl/window.hxx>
31 #include <vcl/settings.hxx>
32 #include <vcl/svapp.hxx>
37 using ::com::sun::star::uno::Reference
;
38 using ::com::sun::star::uno::RuntimeException
;
39 using ::com::sun::star::lang::DisposedException
;
40 using ::com::sun::star::lang::EventObject
;
41 using ::com::sun::star::awt::FontDescriptor
;
42 using ::com::sun::star::awt::XStyleChangeListener
;
45 IMPL_LINK( WindowStyleSettings
, OnWindowEvent
, VclWindowEvent
&, rEvent
, void )
47 if ( rEvent
.GetId() != VclEventId::WindowDataChanged
)
49 const DataChangedEvent
* pDataChangedEvent
= static_cast< const DataChangedEvent
* >( rEvent
.GetData() );
50 if ( !pDataChangedEvent
|| ( pDataChangedEvent
->GetType() != DataChangedEventType::SETTINGS
) )
52 if ( !( pDataChangedEvent
->GetFlags() & AllSettingsFlags::STYLE
) )
55 EventObject
aEvent( *pOwningWindow
);
56 aStyleChangeListeners
.notifyEach( &XStyleChangeListener::styleSettingsChanged
, aEvent
);
64 class StyleMethodGuard
67 explicit StyleMethodGuard( const VCLXWindow
* pOwningWindow
)
69 if ( pOwningWindow
== nullptr )
70 throw DisposedException();
74 SolarMutexGuard m_aGuard
;
79 //= WindowStyleSettings
82 WindowStyleSettings::WindowStyleSettings(::osl::Mutex
& i_rListenerMutex
, VCLXWindow
& i_rOwningWindow
)
83 : pOwningWindow( &i_rOwningWindow
)
84 ,aStyleChangeListeners( i_rListenerMutex
)
86 VclPtr
<vcl::Window
> pWindow
= i_rOwningWindow
.GetWindow();
88 throw RuntimeException();
89 pWindow
->AddEventListener( LINK( this, WindowStyleSettings
, OnWindowEvent
) );
93 WindowStyleSettings::~WindowStyleSettings()
98 void WindowStyleSettings::dispose()
100 StyleMethodGuard
aGuard( pOwningWindow
);
102 VclPtr
<vcl::Window
> pWindow
= pOwningWindow
->GetWindow();
103 OSL_ENSURE( pWindow
, "WindowStyleSettings::dispose: window has been reset before we could revoke the listener!" );
105 pWindow
->RemoveEventListener( LINK( this, WindowStyleSettings
, OnWindowEvent
) );
107 EventObject
aEvent( *this );
108 aStyleChangeListeners
.disposeAndClear( aEvent
);
110 pOwningWindow
= nullptr;
114 sal_Int32
WindowStyleSettings::ImplGetStyleColor( Color
const & (StyleSettings::*i_pGetter
)() const ) const
116 const VclPtr
<vcl::Window
> pWindow
= pOwningWindow
->GetWindow();
117 const AllSettings aAllSettings
= pWindow
->GetSettings();
118 const StyleSettings
& aStyleSettings
= aAllSettings
.GetStyleSettings();
119 return sal_Int32((aStyleSettings
.*i_pGetter
)());
122 void WindowStyleSettings::ImplSetStyleColor( void (StyleSettings::*i_pSetter
)( Color
const & ), sal_Int32 i_nColor
)
124 VclPtr
<vcl::Window
> pWindow
= pOwningWindow
->GetWindow();
125 AllSettings aAllSettings
= pWindow
->GetSettings();
126 StyleSettings aStyleSettings
= aAllSettings
.GetStyleSettings();
127 (aStyleSettings
.*i_pSetter
)( Color(ColorTransparency
, i_nColor
) );
128 aAllSettings
.SetStyleSettings( aStyleSettings
);
129 pWindow
->SetSettings( aAllSettings
);
132 FontDescriptor
WindowStyleSettings::ImplGetStyleFont( vcl::Font
const & (StyleSettings::*i_pGetter
)() const ) const
134 const VclPtr
<vcl::Window
> pWindow
= pOwningWindow
->GetWindow();
135 const AllSettings aAllSettings
= pWindow
->GetSettings();
136 const StyleSettings
& aStyleSettings
= aAllSettings
.GetStyleSettings();
137 return VCLUnoHelper::CreateFontDescriptor( (aStyleSettings
.*i_pGetter
)() );
140 void WindowStyleSettings::ImplSetStyleFont( void (StyleSettings::*i_pSetter
)( vcl::Font
const &),
141 vcl::Font
const & (StyleSettings::*i_pGetter
)() const, const FontDescriptor
& i_rFont
)
143 VclPtr
<vcl::Window
> pWindow
= pOwningWindow
->GetWindow();
144 AllSettings aAllSettings
= pWindow
->GetSettings();
145 StyleSettings aStyleSettings
= aAllSettings
.GetStyleSettings();
146 const vcl::Font aNewFont
= VCLUnoHelper::CreateFont( i_rFont
, (aStyleSettings
.*i_pGetter
)() );
147 (aStyleSettings
.*i_pSetter
)( aNewFont
);
148 aAllSettings
.SetStyleSettings( aStyleSettings
);
149 pWindow
->SetSettings( aAllSettings
);
152 ::sal_Int32 SAL_CALL
WindowStyleSettings::getActiveBorderColor()
154 StyleMethodGuard
aGuard( pOwningWindow
);
155 return ImplGetStyleColor( &StyleSettings::GetActiveBorderColor
);
159 void SAL_CALL
WindowStyleSettings::setActiveBorderColor( ::sal_Int32 _activebordercolor
)
161 StyleMethodGuard
aGuard( pOwningWindow
);
162 ImplSetStyleColor( &StyleSettings::SetActiveBorderColor
, _activebordercolor
);
166 ::sal_Int32 SAL_CALL
WindowStyleSettings::getActiveColor()
168 StyleMethodGuard
aGuard( pOwningWindow
);
169 return ImplGetStyleColor( &StyleSettings::GetActiveColor
);
173 void SAL_CALL
WindowStyleSettings::setActiveColor( ::sal_Int32 _activecolor
)
175 StyleMethodGuard
aGuard( pOwningWindow
);
176 ImplSetStyleColor( &StyleSettings::SetActiveColor
, _activecolor
);
180 ::sal_Int32 SAL_CALL
WindowStyleSettings::getActiveTabColor()
182 StyleMethodGuard
aGuard( pOwningWindow
);
183 return ImplGetStyleColor( &StyleSettings::GetActiveTabColor
);
187 void SAL_CALL
WindowStyleSettings::setActiveTabColor( ::sal_Int32 _activetabcolor
)
189 StyleMethodGuard
aGuard( pOwningWindow
);
190 ImplSetStyleColor( &StyleSettings::SetActiveTabColor
, _activetabcolor
);
194 ::sal_Int32 SAL_CALL
WindowStyleSettings::getActiveTextColor()
196 StyleMethodGuard
aGuard( pOwningWindow
);
197 return ImplGetStyleColor( &StyleSettings::GetActiveTextColor
);
201 void SAL_CALL
WindowStyleSettings::setActiveTextColor( ::sal_Int32 _activetextcolor
)
203 StyleMethodGuard
aGuard( pOwningWindow
);
204 ImplSetStyleColor( &StyleSettings::SetActiveTextColor
, _activetextcolor
);
208 ::sal_Int32 SAL_CALL
WindowStyleSettings::getButtonRolloverTextColor()
210 StyleMethodGuard
aGuard( pOwningWindow
);
211 return ImplGetStyleColor( &StyleSettings::GetButtonRolloverTextColor
);
215 void SAL_CALL
WindowStyleSettings::setButtonRolloverTextColor( ::sal_Int32 _buttonrollovertextcolor
)
217 StyleMethodGuard
aGuard( pOwningWindow
);
218 ImplSetStyleColor( &StyleSettings::SetButtonRolloverTextColor
, _buttonrollovertextcolor
);
219 // Also need to set ActionButtonRolloverTextColor as this setting can't be
220 // set through the UNO interface otherwise.
221 // Previously this setting was used to set colors for both scenarios,
222 // but action button setting was added to differentiate the buttons from
223 // "normal" buttons in some themes.
224 ImplSetStyleColor( &StyleSettings::SetActionButtonRolloverTextColor
, _buttonrollovertextcolor
);
228 ::sal_Int32 SAL_CALL
WindowStyleSettings::getButtonTextColor()
230 StyleMethodGuard
aGuard( pOwningWindow
);
231 return ImplGetStyleColor( &StyleSettings::GetButtonTextColor
);
235 void SAL_CALL
WindowStyleSettings::setButtonTextColor( ::sal_Int32 _buttontextcolor
)
237 StyleMethodGuard
aGuard( pOwningWindow
);
238 ImplSetStyleColor( &StyleSettings::SetButtonTextColor
, _buttontextcolor
);
239 // Also need to set ActionButtonTextColor and DefaultActionButtonTextColor
240 // as this two settings can't be set through the UNO interface otherwise.
241 // Previously this setting was used to set colors for all three scenarios,
242 // but action button setting was added to differentiate the buttons from
243 // "normal" buttons in some themes.
244 ImplSetStyleColor( &StyleSettings::SetActionButtonTextColor
, _buttontextcolor
);
245 ImplSetStyleColor( &StyleSettings::SetDefaultActionButtonTextColor
, _buttontextcolor
);
249 ::sal_Int32 SAL_CALL
WindowStyleSettings::getCheckedColor()
251 StyleMethodGuard
aGuard( pOwningWindow
);
252 return ImplGetStyleColor( &StyleSettings::GetCheckedColor
);
256 void SAL_CALL
WindowStyleSettings::setCheckedColor( ::sal_Int32 _checkedcolor
)
258 StyleMethodGuard
aGuard( pOwningWindow
);
259 ImplSetStyleColor( &StyleSettings::SetCheckedColor
, _checkedcolor
);
263 ::sal_Int32 SAL_CALL
WindowStyleSettings::getDarkShadowColor()
265 StyleMethodGuard
aGuard( pOwningWindow
);
266 return ImplGetStyleColor( &StyleSettings::GetDarkShadowColor
);
270 void SAL_CALL
WindowStyleSettings::setDarkShadowColor( ::sal_Int32 _darkshadowcolor
)
272 StyleMethodGuard
aGuard( pOwningWindow
);
273 ImplSetStyleColor( &StyleSettings::SetDarkShadowColor
, _darkshadowcolor
);
277 ::sal_Int32 SAL_CALL
WindowStyleSettings::getDeactiveBorderColor()
279 StyleMethodGuard
aGuard( pOwningWindow
);
280 return ImplGetStyleColor( &StyleSettings::GetDeactiveBorderColor
);
284 void SAL_CALL
WindowStyleSettings::setDeactiveBorderColor( ::sal_Int32 _deactivebordercolor
)
286 StyleMethodGuard
aGuard( pOwningWindow
);
287 ImplSetStyleColor( &StyleSettings::SetDeactiveBorderColor
, _deactivebordercolor
);
291 ::sal_Int32 SAL_CALL
WindowStyleSettings::getDeactiveColor()
293 StyleMethodGuard
aGuard( pOwningWindow
);
294 return ImplGetStyleColor( &StyleSettings::GetDeactiveColor
);
298 void SAL_CALL
WindowStyleSettings::setDeactiveColor( ::sal_Int32 _deactivecolor
)
300 StyleMethodGuard
aGuard( pOwningWindow
);
301 ImplSetStyleColor( &StyleSettings::SetDeactiveColor
, _deactivecolor
);
305 ::sal_Int32 SAL_CALL
WindowStyleSettings::getDeactiveTextColor()
307 StyleMethodGuard
aGuard( pOwningWindow
);
308 return ImplGetStyleColor( &StyleSettings::GetDeactiveTextColor
);
312 void SAL_CALL
WindowStyleSettings::setDeactiveTextColor( ::sal_Int32 _deactivetextcolor
)
314 StyleMethodGuard
aGuard( pOwningWindow
);
315 ImplSetStyleColor( &StyleSettings::SetDeactiveTextColor
, _deactivetextcolor
);
319 ::sal_Int32 SAL_CALL
WindowStyleSettings::getDialogColor()
321 StyleMethodGuard
aGuard( pOwningWindow
);
322 return ImplGetStyleColor( &StyleSettings::GetDialogColor
);
326 void SAL_CALL
WindowStyleSettings::setDialogColor( ::sal_Int32 _dialogcolor
)
328 StyleMethodGuard
aGuard( pOwningWindow
);
329 ImplSetStyleColor( &StyleSettings::SetDialogColor
, _dialogcolor
);
333 ::sal_Int32 SAL_CALL
WindowStyleSettings::getDialogTextColor()
335 StyleMethodGuard
aGuard( pOwningWindow
);
336 return ImplGetStyleColor( &StyleSettings::GetDialogTextColor
);
340 void SAL_CALL
WindowStyleSettings::setDialogTextColor( ::sal_Int32 _dialogtextcolor
)
342 StyleMethodGuard
aGuard( pOwningWindow
);
343 ImplSetStyleColor( &StyleSettings::SetDialogTextColor
, _dialogtextcolor
);
347 ::sal_Int32 SAL_CALL
WindowStyleSettings::getDisableColor()
349 StyleMethodGuard
aGuard( pOwningWindow
);
350 return ImplGetStyleColor( &StyleSettings::GetDisableColor
);
354 void SAL_CALL
WindowStyleSettings::setDisableColor( ::sal_Int32 _disablecolor
)
356 StyleMethodGuard
aGuard( pOwningWindow
);
357 ImplSetStyleColor( &StyleSettings::SetDisableColor
, _disablecolor
);
361 ::sal_Int32 SAL_CALL
WindowStyleSettings::getFaceColor()
363 StyleMethodGuard
aGuard( pOwningWindow
);
364 return ImplGetStyleColor( &StyleSettings::GetFaceColor
);
368 void SAL_CALL
WindowStyleSettings::setFaceColor( ::sal_Int32 _facecolor
)
370 StyleMethodGuard
aGuard( pOwningWindow
);
371 ImplSetStyleColor( &StyleSettings::SetFaceColor
, _facecolor
);
375 ::sal_Int32 SAL_CALL
WindowStyleSettings::getFaceGradientColor()
377 StyleMethodGuard
aGuard( pOwningWindow
);
378 const VclPtr
<vcl::Window
> pWindow
= pOwningWindow
->GetWindow();
379 const AllSettings aAllSettings
= pWindow
->GetSettings();
380 const StyleSettings
& aStyleSettings
= aAllSettings
.GetStyleSettings();
381 return sal_Int32(aStyleSettings
.GetFaceGradientColor());
385 ::sal_Int32 SAL_CALL
WindowStyleSettings::getFieldColor()
387 StyleMethodGuard
aGuard( pOwningWindow
);
388 return ImplGetStyleColor( &StyleSettings::GetFieldColor
);
392 void SAL_CALL
WindowStyleSettings::setFieldColor( ::sal_Int32 _fieldcolor
)
394 StyleMethodGuard
aGuard( pOwningWindow
);
395 ImplSetStyleColor( &StyleSettings::SetFieldColor
, _fieldcolor
);
399 ::sal_Int32 SAL_CALL
WindowStyleSettings::getFieldRolloverTextColor()
401 StyleMethodGuard
aGuard( pOwningWindow
);
402 return ImplGetStyleColor( &StyleSettings::GetFieldRolloverTextColor
);
406 void SAL_CALL
WindowStyleSettings::setFieldRolloverTextColor( ::sal_Int32 _fieldrollovertextcolor
)
408 StyleMethodGuard
aGuard( pOwningWindow
);
409 ImplSetStyleColor( &StyleSettings::SetFieldRolloverTextColor
, _fieldrollovertextcolor
);
413 ::sal_Int32 SAL_CALL
WindowStyleSettings::getFieldTextColor()
415 StyleMethodGuard
aGuard( pOwningWindow
);
416 return ImplGetStyleColor( &StyleSettings::GetFieldTextColor
);
420 void SAL_CALL
WindowStyleSettings::setFieldTextColor( ::sal_Int32 _fieldtextcolor
)
422 StyleMethodGuard
aGuard( pOwningWindow
);
423 ImplSetStyleColor( &StyleSettings::SetFieldTextColor
, _fieldtextcolor
);
427 ::sal_Int32 SAL_CALL
WindowStyleSettings::getGroupTextColor()
429 StyleMethodGuard
aGuard( pOwningWindow
);
430 return ImplGetStyleColor( &StyleSettings::GetGroupTextColor
);
434 void SAL_CALL
WindowStyleSettings::setGroupTextColor( ::sal_Int32 _grouptextcolor
)
436 StyleMethodGuard
aGuard( pOwningWindow
);
437 ImplSetStyleColor( &StyleSettings::SetGroupTextColor
, _grouptextcolor
);
441 ::sal_Int32 SAL_CALL
WindowStyleSettings::getHelpColor()
443 StyleMethodGuard
aGuard( pOwningWindow
);
444 return ImplGetStyleColor( &StyleSettings::GetHelpColor
);
448 void SAL_CALL
WindowStyleSettings::setHelpColor( ::sal_Int32 _helpcolor
)
450 StyleMethodGuard
aGuard( pOwningWindow
);
451 ImplSetStyleColor( &StyleSettings::SetHelpColor
, _helpcolor
);
455 ::sal_Int32 SAL_CALL
WindowStyleSettings::getHelpTextColor()
457 StyleMethodGuard
aGuard( pOwningWindow
);
458 return ImplGetStyleColor( &StyleSettings::GetHelpTextColor
);
462 void SAL_CALL
WindowStyleSettings::setHelpTextColor( ::sal_Int32 _helptextcolor
)
464 StyleMethodGuard
aGuard( pOwningWindow
);
465 ImplSetStyleColor( &StyleSettings::SetHelpTextColor
, _helptextcolor
);
469 ::sal_Int32 SAL_CALL
WindowStyleSettings::getHighlightColor()
471 StyleMethodGuard
aGuard( pOwningWindow
);
472 return ImplGetStyleColor( &StyleSettings::GetHighlightColor
);
476 void SAL_CALL
WindowStyleSettings::setHighlightColor( ::sal_Int32 _highlightcolor
)
478 StyleMethodGuard
aGuard( pOwningWindow
);
479 ImplSetStyleColor( &StyleSettings::SetHighlightColor
, _highlightcolor
);
483 ::sal_Int32 SAL_CALL
WindowStyleSettings::getHighlightTextColor()
485 StyleMethodGuard
aGuard( pOwningWindow
);
486 return ImplGetStyleColor( &StyleSettings::GetHighlightTextColor
);
490 void SAL_CALL
WindowStyleSettings::setHighlightTextColor( ::sal_Int32 _highlighttextcolor
)
492 StyleMethodGuard
aGuard( pOwningWindow
);
493 ImplSetStyleColor( &StyleSettings::SetHighlightTextColor
, _highlighttextcolor
);
497 ::sal_Int32 SAL_CALL
WindowStyleSettings::getInactiveTabColor()
499 StyleMethodGuard
aGuard( pOwningWindow
);
500 return ImplGetStyleColor( &StyleSettings::GetInactiveTabColor
);
504 void SAL_CALL
WindowStyleSettings::setInactiveTabColor( ::sal_Int32 _inactivetabcolor
)
506 StyleMethodGuard
aGuard( pOwningWindow
);
507 ImplSetStyleColor( &StyleSettings::SetInactiveTabColor
, _inactivetabcolor
);
511 ::sal_Int32 SAL_CALL
WindowStyleSettings::getLabelTextColor()
513 StyleMethodGuard
aGuard( pOwningWindow
);
514 return ImplGetStyleColor( &StyleSettings::GetLabelTextColor
);
518 void SAL_CALL
WindowStyleSettings::setLabelTextColor( ::sal_Int32 _labeltextcolor
)
520 StyleMethodGuard
aGuard( pOwningWindow
);
521 ImplSetStyleColor( &StyleSettings::SetLabelTextColor
, _labeltextcolor
);
525 ::sal_Int32 SAL_CALL
WindowStyleSettings::getLightColor()
527 StyleMethodGuard
aGuard( pOwningWindow
);
528 return ImplGetStyleColor( &StyleSettings::GetLightColor
);
532 void SAL_CALL
WindowStyleSettings::setLightColor( ::sal_Int32 _lightcolor
)
534 StyleMethodGuard
aGuard( pOwningWindow
);
535 ImplSetStyleColor( &StyleSettings::SetLightColor
, _lightcolor
);
539 ::sal_Int32 SAL_CALL
WindowStyleSettings::getMenuBarColor()
541 StyleMethodGuard
aGuard( pOwningWindow
);
542 return ImplGetStyleColor( &StyleSettings::GetMenuBarColor
);
546 void SAL_CALL
WindowStyleSettings::setMenuBarColor( ::sal_Int32 _menubarcolor
)
548 StyleMethodGuard
aGuard( pOwningWindow
);
549 ImplSetStyleColor( &StyleSettings::SetMenuBarColor
, _menubarcolor
);
553 ::sal_Int32 SAL_CALL
WindowStyleSettings::getMenuBarTextColor()
555 StyleMethodGuard
aGuard( pOwningWindow
);
556 return ImplGetStyleColor( &StyleSettings::GetMenuBarTextColor
);
560 void SAL_CALL
WindowStyleSettings::setMenuBarTextColor( ::sal_Int32 _menubartextcolor
)
562 StyleMethodGuard
aGuard( pOwningWindow
);
563 ImplSetStyleColor( &StyleSettings::SetMenuBarTextColor
, _menubartextcolor
);
567 ::sal_Int32 SAL_CALL
WindowStyleSettings::getMenuBorderColor()
569 StyleMethodGuard
aGuard( pOwningWindow
);
570 return ImplGetStyleColor( &StyleSettings::GetMenuBorderColor
);
574 void SAL_CALL
WindowStyleSettings::setMenuBorderColor( ::sal_Int32 _menubordercolor
)
576 StyleMethodGuard
aGuard( pOwningWindow
);
577 ImplSetStyleColor( &StyleSettings::SetMenuBorderColor
, _menubordercolor
);
581 ::sal_Int32 SAL_CALL
WindowStyleSettings::getMenuColor()
583 StyleMethodGuard
aGuard( pOwningWindow
);
584 return ImplGetStyleColor( &StyleSettings::GetMenuColor
);
588 void SAL_CALL
WindowStyleSettings::setMenuColor( ::sal_Int32 _menucolor
)
590 StyleMethodGuard
aGuard( pOwningWindow
);
591 ImplSetStyleColor( &StyleSettings::SetMenuColor
, _menucolor
);
595 ::sal_Int32 SAL_CALL
WindowStyleSettings::getMenuHighlightColor()
597 StyleMethodGuard
aGuard( pOwningWindow
);
598 return ImplGetStyleColor( &StyleSettings::GetMenuHighlightColor
);
602 void SAL_CALL
WindowStyleSettings::setMenuHighlightColor( ::sal_Int32 _menuhighlightcolor
)
604 StyleMethodGuard
aGuard( pOwningWindow
);
605 ImplSetStyleColor( &StyleSettings::SetMenuHighlightColor
, _menuhighlightcolor
);
609 ::sal_Int32 SAL_CALL
WindowStyleSettings::getMenuHighlightTextColor()
611 StyleMethodGuard
aGuard( pOwningWindow
);
612 return ImplGetStyleColor( &StyleSettings::GetMenuHighlightTextColor
);
616 void SAL_CALL
WindowStyleSettings::setMenuHighlightTextColor( ::sal_Int32 _menuhighlighttextcolor
)
618 StyleMethodGuard
aGuard( pOwningWindow
);
619 ImplSetStyleColor( &StyleSettings::SetMenuHighlightTextColor
, _menuhighlighttextcolor
);
623 ::sal_Int32 SAL_CALL
WindowStyleSettings::getMenuTextColor()
625 StyleMethodGuard
aGuard( pOwningWindow
);
626 return ImplGetStyleColor( &StyleSettings::GetMenuTextColor
);
630 void SAL_CALL
WindowStyleSettings::setMenuTextColor( ::sal_Int32 _menutextcolor
)
632 StyleMethodGuard
aGuard( pOwningWindow
);
633 ImplSetStyleColor( &StyleSettings::SetMenuTextColor
, _menutextcolor
);
637 ::sal_Int32 SAL_CALL
WindowStyleSettings::getMonoColor()
639 StyleMethodGuard
aGuard( pOwningWindow
);
640 return ImplGetStyleColor( &StyleSettings::GetMonoColor
);
644 void SAL_CALL
WindowStyleSettings::setMonoColor( ::sal_Int32 _monocolor
)
646 StyleMethodGuard
aGuard( pOwningWindow
);
647 ImplSetStyleColor( &StyleSettings::SetMonoColor
, _monocolor
);
651 ::sal_Int32 SAL_CALL
WindowStyleSettings::getRadioCheckTextColor()
653 StyleMethodGuard
aGuard( pOwningWindow
);
654 return ImplGetStyleColor( &StyleSettings::GetRadioCheckTextColor
);
658 void SAL_CALL
WindowStyleSettings::setRadioCheckTextColor( ::sal_Int32 _radiochecktextcolor
)
660 StyleMethodGuard
aGuard( pOwningWindow
);
661 ImplSetStyleColor( &StyleSettings::SetRadioCheckTextColor
, _radiochecktextcolor
);
665 ::sal_Int32 SAL_CALL
WindowStyleSettings::getSeparatorColor()
667 StyleMethodGuard
aGuard( pOwningWindow
);
668 const VclPtr
<vcl::Window
> pWindow
= pOwningWindow
->GetWindow();
669 const AllSettings aAllSettings
= pWindow
->GetSettings();
670 const StyleSettings
& aStyleSettings
= aAllSettings
.GetStyleSettings();
671 return sal_Int32(aStyleSettings
.GetSeparatorColor());
675 ::sal_Int32 SAL_CALL
WindowStyleSettings::getShadowColor()
677 StyleMethodGuard
aGuard( pOwningWindow
);
678 return ImplGetStyleColor( &StyleSettings::GetShadowColor
);
682 void SAL_CALL
WindowStyleSettings::setShadowColor( ::sal_Int32 _shadowcolor
)
684 StyleMethodGuard
aGuard( pOwningWindow
);
685 ImplSetStyleColor( &StyleSettings::SetShadowColor
, _shadowcolor
);
689 ::sal_Int32 SAL_CALL
WindowStyleSettings::getWindowColor()
691 StyleMethodGuard
aGuard( pOwningWindow
);
692 return ImplGetStyleColor( &StyleSettings::GetWindowColor
);
696 void SAL_CALL
WindowStyleSettings::setWindowColor( ::sal_Int32 _windowcolor
)
698 StyleMethodGuard
aGuard( pOwningWindow
);
699 ImplSetStyleColor( &StyleSettings::SetWindowColor
, _windowcolor
);
703 ::sal_Int32 SAL_CALL
WindowStyleSettings::getWindowTextColor()
705 StyleMethodGuard
aGuard( pOwningWindow
);
706 return ImplGetStyleColor( &StyleSettings::GetWindowTextColor
);
710 void SAL_CALL
WindowStyleSettings::setWindowTextColor( ::sal_Int32 _windowtextcolor
)
712 StyleMethodGuard
aGuard( pOwningWindow
);
713 ImplSetStyleColor( &StyleSettings::SetWindowTextColor
, _windowtextcolor
);
717 ::sal_Int32 SAL_CALL
WindowStyleSettings::getWorkspaceColor()
719 StyleMethodGuard
aGuard( pOwningWindow
);
720 return ImplGetStyleColor( &StyleSettings::GetWorkspaceColor
);
724 void SAL_CALL
WindowStyleSettings::setWorkspaceColor( ::sal_Int32 _workspacecolor
)
726 StyleMethodGuard
aGuard( pOwningWindow
);
727 ImplSetStyleColor( &StyleSettings::SetWorkspaceColor
, _workspacecolor
);
731 sal_Bool SAL_CALL
WindowStyleSettings::getHighContrastMode()
733 StyleMethodGuard
aGuard( pOwningWindow
);
734 const VclPtr
<vcl::Window
> pWindow
= pOwningWindow
->GetWindow();
735 const AllSettings aAllSettings
= pWindow
->GetSettings();
736 const StyleSettings
& aStyleSettings
= aAllSettings
.GetStyleSettings();
737 return aStyleSettings
.GetHighContrastMode();
741 void SAL_CALL
WindowStyleSettings::setHighContrastMode( sal_Bool _highcontrastmode
)
743 StyleMethodGuard
aGuard( pOwningWindow
);
744 VclPtr
<vcl::Window
> pWindow
= pOwningWindow
->GetWindow();
745 AllSettings aAllSettings
= pWindow
->GetSettings();
746 StyleSettings aStyleSettings
= aAllSettings
.GetStyleSettings();
747 aStyleSettings
.SetHighContrastMode( _highcontrastmode
);
748 aAllSettings
.SetStyleSettings( aStyleSettings
);
749 pWindow
->SetSettings( aAllSettings
);
753 FontDescriptor SAL_CALL
WindowStyleSettings::getApplicationFont()
755 StyleMethodGuard
aGuard( pOwningWindow
);
756 return ImplGetStyleFont( &StyleSettings::GetAppFont
);
760 void SAL_CALL
WindowStyleSettings::setApplicationFont( const FontDescriptor
& _applicationfont
)
762 StyleMethodGuard
aGuard( pOwningWindow
);
763 ImplSetStyleFont( &StyleSettings::SetAppFont
, &StyleSettings::GetAppFont
, _applicationfont
);
767 FontDescriptor SAL_CALL
WindowStyleSettings::getHelpFont()
769 StyleMethodGuard
aGuard( pOwningWindow
);
770 return ImplGetStyleFont( &StyleSettings::GetHelpFont
);
774 void SAL_CALL
WindowStyleSettings::setHelpFont( const FontDescriptor
& _helpfont
)
776 StyleMethodGuard
aGuard( pOwningWindow
);
777 ImplSetStyleFont( &StyleSettings::SetHelpFont
, &StyleSettings::GetHelpFont
, _helpfont
);
781 FontDescriptor SAL_CALL
WindowStyleSettings::getTitleFont()
783 StyleMethodGuard
aGuard( pOwningWindow
);
784 return ImplGetStyleFont( &StyleSettings::GetTitleFont
);
788 void SAL_CALL
WindowStyleSettings::setTitleFont( const FontDescriptor
& _titlefont
)
790 StyleMethodGuard
aGuard( pOwningWindow
);
791 ImplSetStyleFont( &StyleSettings::SetTitleFont
, &StyleSettings::GetTitleFont
, _titlefont
);
795 FontDescriptor SAL_CALL
WindowStyleSettings::getFloatTitleFont()
797 StyleMethodGuard
aGuard( pOwningWindow
);
798 return ImplGetStyleFont( &StyleSettings::GetFloatTitleFont
);
802 void SAL_CALL
WindowStyleSettings::setFloatTitleFont( const FontDescriptor
& _floattitlefont
)
804 StyleMethodGuard
aGuard( pOwningWindow
);
805 ImplSetStyleFont( &StyleSettings::SetFloatTitleFont
, &StyleSettings::GetFloatTitleFont
, _floattitlefont
);
809 FontDescriptor SAL_CALL
WindowStyleSettings::getMenuFont()
811 StyleMethodGuard
aGuard( pOwningWindow
);
812 return ImplGetStyleFont( &StyleSettings::GetMenuFont
);
816 void SAL_CALL
WindowStyleSettings::setMenuFont( const FontDescriptor
& _menufont
)
818 StyleMethodGuard
aGuard( pOwningWindow
);
819 ImplSetStyleFont( &StyleSettings::SetMenuFont
, &StyleSettings::GetMenuFont
, _menufont
);
823 FontDescriptor SAL_CALL
WindowStyleSettings::getToolFont()
825 StyleMethodGuard
aGuard( pOwningWindow
);
826 return ImplGetStyleFont( &StyleSettings::GetToolFont
);
830 void SAL_CALL
WindowStyleSettings::setToolFont( const FontDescriptor
& _toolfont
)
832 StyleMethodGuard
aGuard( pOwningWindow
);
833 ImplSetStyleFont( &StyleSettings::SetToolFont
, &StyleSettings::GetToolFont
, _toolfont
);
837 FontDescriptor SAL_CALL
WindowStyleSettings::getGroupFont()
839 StyleMethodGuard
aGuard( pOwningWindow
);
840 return ImplGetStyleFont( &StyleSettings::GetGroupFont
);
844 void SAL_CALL
WindowStyleSettings::setGroupFont( const FontDescriptor
& _groupfont
)
846 StyleMethodGuard
aGuard( pOwningWindow
);
847 ImplSetStyleFont( &StyleSettings::SetGroupFont
, &StyleSettings::GetGroupFont
, _groupfont
);
851 FontDescriptor SAL_CALL
WindowStyleSettings::getLabelFont()
853 StyleMethodGuard
aGuard( pOwningWindow
);
854 return ImplGetStyleFont( &StyleSettings::GetLabelFont
);
858 void SAL_CALL
WindowStyleSettings::setLabelFont( const FontDescriptor
& _labelfont
)
860 StyleMethodGuard
aGuard( pOwningWindow
);
861 ImplSetStyleFont( &StyleSettings::SetLabelFont
, &StyleSettings::GetLabelFont
, _labelfont
);
865 FontDescriptor SAL_CALL
WindowStyleSettings::getRadioCheckFont()
867 StyleMethodGuard
aGuard( pOwningWindow
);
868 return ImplGetStyleFont( &StyleSettings::GetRadioCheckFont
);
872 void SAL_CALL
WindowStyleSettings::setRadioCheckFont( const FontDescriptor
& _radiocheckfont
)
874 StyleMethodGuard
aGuard( pOwningWindow
);
875 ImplSetStyleFont( &StyleSettings::SetRadioCheckFont
, &StyleSettings::GetRadioCheckFont
, _radiocheckfont
);
879 FontDescriptor SAL_CALL
WindowStyleSettings::getPushButtonFont()
881 StyleMethodGuard
aGuard( pOwningWindow
);
882 return ImplGetStyleFont( &StyleSettings::GetPushButtonFont
);
886 void SAL_CALL
WindowStyleSettings::setPushButtonFont( const FontDescriptor
& _pushbuttonfont
)
888 StyleMethodGuard
aGuard( pOwningWindow
);
889 ImplSetStyleFont( &StyleSettings::SetPushButtonFont
, &StyleSettings::GetPushButtonFont
, _pushbuttonfont
);
893 FontDescriptor SAL_CALL
WindowStyleSettings::getFieldFont()
895 StyleMethodGuard
aGuard( pOwningWindow
);
896 return ImplGetStyleFont( &StyleSettings::GetFieldFont
);
900 void SAL_CALL
WindowStyleSettings::setFieldFont( const FontDescriptor
& _fieldfont
)
902 StyleMethodGuard
aGuard( pOwningWindow
);
903 ImplSetStyleFont( &StyleSettings::SetFieldFont
, &StyleSettings::GetFieldFont
, _fieldfont
);
907 void SAL_CALL
WindowStyleSettings::addStyleChangeListener( const Reference
< XStyleChangeListener
>& i_rListener
)
909 StyleMethodGuard
aGuard( pOwningWindow
);
910 if ( i_rListener
.is() )
911 aStyleChangeListeners
.addInterface( i_rListener
);
915 void SAL_CALL
WindowStyleSettings::removeStyleChangeListener( const Reference
< XStyleChangeListener
>& i_rListener
)
917 StyleMethodGuard
aGuard( pOwningWindow
);
918 if ( i_rListener
.is() )
919 aStyleChangeListeners
.removeInterface( i_rListener
);
923 } // namespace toolkit
926 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */