LibreOffice Module sfx2 (master) 1
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
sfx2::sidebar::Theme Class Referencefinal

Simple collection of colors, gradients, fonts that define the look of the sidebar and its controls. More...

#include <Theme.hxx>

Inheritance diagram for sfx2::sidebar::Theme:
[legend]
Collaboration diagram for sfx2::sidebar::Theme:
[legend]

Public Types

enum  ThemeItem {
  Begin_ ,
  Pre_Color_ = Begin_ ,
  AnyItem_ = Pre_Color_ ,
  Image_Color_ ,
  Color_Highlight ,
  Color_HighlightText ,
  Color_DeckBackground ,
  Color_DeckTitleBarBackground ,
  Color_PanelBackground ,
  Color_PanelTitleBarBackground ,
  Color_TabBarBackground ,
  Color_Int_ ,
  Int_DeckBorderSize ,
  Int_DeckSeparatorHeight ,
  Int_DeckLeftPadding ,
  Int_DeckTopPadding ,
  Int_DeckRightPadding ,
  Int_DeckBottomPadding ,
  Int_Bool_ ,
  Bool_UseSystemColors ,
  Bool_IsHighContrastModeActive ,
  Post_Bool_ ,
  End_ =Post_Bool_
}
 

Public Member Functions

void InitializeTheme ()
 
 Theme ()
 
virtual ~Theme () override
 
 Theme (const Theme &)=delete
 
Themeoperator= (const Theme &)=delete
 
virtual void disposing (std::unique_lock< std::mutex > &) override
 
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo () override
 
virtual void SAL_CALL setPropertyValue (const OUString &rsPropertyName, const css::uno::Any &rValue) override
 
virtual css::uno::Any SAL_CALL getPropertyValue (const OUString &rsPropertyName) override
 
virtual void SAL_CALL addPropertyChangeListener (const OUString &rsPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &rxListener) override
 
virtual void SAL_CALL removePropertyChangeListener (const OUString &rsPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &rxListener) override
 
virtual void SAL_CALL addVetoableChangeListener (const OUString &rsPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &rxListener) override
 
virtual void SAL_CALL removeVetoableChangeListener (const OUString &rsPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &rxListener) override
 
virtual css::uno::Sequence< css::beans::Property > SAL_CALL getProperties () override
 
virtual css::beans::Property SAL_CALL getPropertyByName (const OUString &rsName) override
 
virtual sal_Bool SAL_CALL hasPropertyByName (const OUString &rsName) override
 
- Public Member Functions inherited from comphelper::WeakComponentImplHelper< typename... Ifc >
virtual void SAL_CALL acquire () noexcept override
 
virtual void SAL_CALL release () noexcept override
 
virtual void SAL_CALL dispose () noexcept final override
 
virtual void SAL_CALL addEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) final override
 
virtual void SAL_CALL removeEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) final override
 
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) override
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () override
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () override
 
- Public Member Functions inherited from comphelper::WeakComponentImplHelperBase
virtual ~WeakComponentImplHelperBase () override
 
virtual void SAL_CALL dispose () override
 
virtual void SAL_CALL addEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) override
 
virtual void SAL_CALL removeEventListener (css::uno::Reference< css::lang::XEventListener > const &rxListener) override
 
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) override
 
virtual void disposing (std::unique_lock< std::mutex > &)
 
- Public Member Functions inherited from comphelper::UnoImplBase
virtual ~UnoImplBase ()
 

Static Public Member Functions

static Color GetColor (const ThemeItem eItem)
 
static sal_Int32 GetInteger (const ThemeItem eItem)
 
static bool IsHighContrastMode ()
 
static void HandleDataChange ()
 
static css::uno::Reference< css::beans::XPropertySetGetPropertySet ()
 

Private Types

enum  PropertyType {
  PT_Color ,
  PT_Integer ,
  PT_Boolean ,
  PT_Invalid
}
 
typedef std::unordered_map< OUString, ThemeItemPropertyNameToIdMap
 
typedef std::vector< OUString > PropertyIdToNameMap
 
typedef ::std::vector< css::uno::Any > RawValueContainer
 
typedef std::vector< css::uno::Reference< css::beans::XPropertyChangeListener > > ChangeListenerContainer
 
typedef std::map< ThemeItem, ChangeListenerContainerChangeListeners
 
typedef std::vector< css::uno::Reference< css::beans::XVetoableChangeListener > > VetoableListenerContainer
 
typedef std::map< ThemeItem, VetoableListenerContainerVetoableListeners
 

Private Member Functions

void SetupPropertyMaps ()
 
void UpdateTheme ()
 
VetoableListenerContainerGetVetoableListeners (const ThemeItem eItem, const bool bCreate)
 
ChangeListenerContainerGetChangeListeners (const ThemeItem eItem, const bool bCreate)
 
void ProcessNewValue (const css::uno::Any &rValue, const ThemeItem eItem, const PropertyType eType)
 

Static Private Member Functions

static ThemeGetCurrentTheme ()
 
static PropertyType GetPropertyType (const ThemeItem eItem)
 
static css::uno::Type const & GetCppuType (const PropertyType eType)
 
static sal_Int32 GetIndex (const ThemeItem eItem, const PropertyType eType)
 
static bool DoVetoableListenersVeto (const VetoableListenerContainer *pListeners, const css::beans::PropertyChangeEvent &rEvent)
 
static void BroadcastPropertyChange (const ChangeListenerContainer *pListeners, const css::beans::PropertyChangeEvent &rEvent)
 

Private Attributes

std::vector< ColormaColors
 
std::vector< sal_Int32 > maIntegers
 
std::vector< bool > maBooleans
 
bool mbIsHighContrastMode
 
bool mbIsHighContrastModeSetManually
 
PropertyNameToIdMap maPropertyNameToIdMap
 
PropertyIdToNameMap maPropertyIdToNameMap
 
RawValueContainer maRawValues
 
ChangeListeners maChangeListeners
 
VetoableListeners maVetoableListeners
 

Additional Inherited Members

- Protected Member Functions inherited from comphelper::WeakComponentImplHelperBase
void throwIfDisposed (std::unique_lock< std::mutex > &)
 
- Protected Attributes inherited from comphelper::WeakComponentImplHelperBase
comphelper::OInterfaceContainerHelper4< css::lang::XEventListener > maEventListeners
 
- Protected Attributes inherited from comphelper::UnoImplBase
std::mutex m_aMutex
 
bool m_bDisposed
 

Detailed Description

Simple collection of colors, gradients, fonts that define the look of the sidebar and its controls.

Definition at line 42 of file Theme.hxx.

Member Typedef Documentation

◆ ChangeListenerContainer

typedef std::vector<css::uno::Reference<css::beans::XPropertyChangeListener> > sfx2::sidebar::Theme::ChangeListenerContainer
private

Definition at line 140 of file Theme.hxx.

◆ ChangeListeners

Definition at line 141 of file Theme.hxx.

◆ PropertyIdToNameMap

typedef std::vector<OUString> sfx2::sidebar::Theme::PropertyIdToNameMap
private

Definition at line 135 of file Theme.hxx.

◆ PropertyNameToIdMap

typedef std::unordered_map<OUString,ThemeItem> sfx2::sidebar::Theme::PropertyNameToIdMap
private

Definition at line 133 of file Theme.hxx.

◆ RawValueContainer

typedef ::std::vector<css::uno::Any> sfx2::sidebar::Theme::RawValueContainer
private

Definition at line 137 of file Theme.hxx.

◆ VetoableListenerContainer

typedef std::vector<css::uno::Reference<css::beans::XVetoableChangeListener> > sfx2::sidebar::Theme::VetoableListenerContainer
private

Definition at line 143 of file Theme.hxx.

◆ VetoableListeners

Definition at line 144 of file Theme.hxx.

Member Enumeration Documentation

◆ PropertyType

Enumerator
PT_Color 
PT_Integer 
PT_Boolean 
PT_Invalid 

Definition at line 147 of file Theme.hxx.

◆ ThemeItem

Enumerator
Begin_ 
Pre_Color_ 
AnyItem_ 
Image_Color_ 
Color_Highlight 
Color_HighlightText 
Color_DeckBackground 
Color_DeckTitleBarBackground 
Color_PanelBackground 
Color_PanelTitleBarBackground 
Color_TabBarBackground 
Color_Int_ 
Int_DeckBorderSize 
Int_DeckSeparatorHeight 
Int_DeckLeftPadding 
Int_DeckTopPadding 
Int_DeckRightPadding 
Int_DeckBottomPadding 
Int_Bool_ 
Bool_UseSystemColors 
Bool_IsHighContrastModeActive 
Post_Bool_ 
End_ 

Definition at line 46 of file Theme.hxx.

Constructor & Destructor Documentation

◆ Theme() [1/2]

sfx2::sidebar::Theme::Theme ( )

Definition at line 38 of file Theme.cxx.

References SetupPropertyMaps().

◆ ~Theme()

sfx2::sidebar::Theme::~Theme ( )
overridevirtual

Definition at line 45 of file Theme.cxx.

◆ Theme() [2/2]

sfx2::sidebar::Theme::Theme ( const Theme )
delete

Member Function Documentation

◆ addPropertyChangeListener()

void SAL_CALL sfx2::sidebar::Theme::addPropertyChangeListener ( const OUString &  rsPropertyName,
const css::uno::Reference< css::beans::XPropertyChangeListener > &  rxListener 
)
overridevirtual

◆ addVetoableChangeListener()

void SAL_CALL sfx2::sidebar::Theme::addVetoableChangeListener ( const OUString &  rsPropertyName,
const css::uno::Reference< css::beans::XVetoableChangeListener > &  rxListener 
)
overridevirtual

◆ BroadcastPropertyChange()

void sfx2::sidebar::Theme::BroadcastPropertyChange ( const ChangeListenerContainer pListeners,
const css::beans::PropertyChangeEvent &  rEvent 
)
staticprivate

Definition at line 603 of file Theme.cxx.

References aListeners, and Exception.

Referenced by setPropertyValue().

◆ disposing()

void sfx2::sidebar::Theme::disposing ( std::unique_lock< std::mutex > &  )
overridevirtual

Reimplemented from comphelper::WeakComponentImplHelperBase.

Definition at line 144 of file Theme.cxx.

References aEvent, aListeners, Exception, and maChangeListeners.

◆ DoVetoableListenersVeto()

bool sfx2::sidebar::Theme::DoVetoableListenersVeto ( const VetoableListenerContainer pListeners,
const css::beans::PropertyChangeEvent &  rEvent 
)
staticprivate

Definition at line 577 of file Theme.cxx.

References aListeners, and Exception.

Referenced by setPropertyValue().

◆ GetChangeListeners()

Theme::ChangeListenerContainer * sfx2::sidebar::Theme::GetChangeListeners ( const ThemeItem  eItem,
const bool  bCreate 
)
private

◆ GetColor()

Color sfx2::sidebar::Theme::GetColor ( const ThemeItem  eItem)
static

◆ GetCppuType()

css::uno::Type const & sfx2::sidebar::Theme::GetCppuType ( const PropertyType  eType)
staticprivate

◆ GetCurrentTheme()

Theme & sfx2::sidebar::Theme::GetCurrentTheme ( )
staticprivate

◆ GetIndex()

sal_Int32 sfx2::sidebar::Theme::GetIndex ( const ThemeItem  eItem,
const PropertyType  eType 
)
staticprivate

Definition at line 529 of file Theme.cxx.

References Color_Int_, eType, Int_Bool_, Pre_Color_, PT_Boolean, PT_Color, and PT_Integer.

Referenced by GetColor(), GetInteger(), and ProcessNewValue().

◆ GetInteger()

sal_Int32 sfx2::sidebar::Theme::GetInteger ( const ThemeItem  eItem)
static

◆ getProperties()

css::uno::Sequence< css::beans::Property > SAL_CALL sfx2::sidebar::Theme::getProperties ( )
overridevirtual

◆ getPropertyByName()

beans::Property SAL_CALL sfx2::sidebar::Theme::getPropertyByName ( const OUString &  rsName)
overridevirtual

Definition at line 386 of file Theme.cxx.

References eType, GetCppuType(), GetPropertyType(), maPropertyNameToIdMap, and PT_Invalid.

◆ GetPropertySet()

Reference< beans::XPropertySet > sfx2::sidebar::Theme::GetPropertySet ( )
static

◆ getPropertySetInfo()

Reference< beans::XPropertySetInfo > SAL_CALL sfx2::sidebar::Theme::getPropertySetInfo ( )
overridevirtual

Definition at line 176 of file Theme.cxx.

◆ GetPropertyType()

Theme::PropertyType sfx2::sidebar::Theme::GetPropertyType ( const ThemeItem  eItem)
staticprivate

◆ getPropertyValue()

Any SAL_CALL sfx2::sidebar::Theme::getPropertyValue ( const OUString &  rsPropertyName)
overridevirtual

Definition at line 226 of file Theme.cxx.

References Any, eType, GetPropertyType(), maPropertyNameToIdMap, maRawValues, and PT_Invalid.

◆ GetVetoableListeners()

Theme::VetoableListenerContainer * sfx2::sidebar::Theme::GetVetoableListeners ( const ThemeItem  eItem,
const bool  bCreate 
)
private

◆ HandleDataChange()

void sfx2::sidebar::Theme::HandleDataChange ( )
static

◆ hasPropertyByName()

sal_Bool SAL_CALL sfx2::sidebar::Theme::hasPropertyByName ( const OUString &  rsName)
overridevirtual

Definition at line 407 of file Theme.cxx.

References eType, GetPropertyType(), maPropertyNameToIdMap, and PT_Invalid.

◆ InitializeTheme()

void sfx2::sidebar::Theme::InitializeTheme ( )

Definition at line 90 of file Theme.cxx.

References Any, Bool_UseSystemColors, maPropertyIdToNameMap, and setPropertyValue().

◆ IsHighContrastMode()

bool sfx2::sidebar::Theme::IsHighContrastMode ( )
static

◆ operator=()

Theme & sfx2::sidebar::Theme::operator= ( const Theme )
delete

◆ ProcessNewValue()

void sfx2::sidebar::Theme::ProcessNewValue ( const css::uno::Any &  rValue,
const ThemeItem  eItem,
const PropertyType  eType 
)
private

◆ removePropertyChangeListener()

void SAL_CALL sfx2::sidebar::Theme::removePropertyChangeListener ( const OUString &  rsPropertyName,
const css::uno::Reference< css::beans::XPropertyChangeListener > &  rxListener 
)
overridevirtual

◆ removeVetoableChangeListener()

void SAL_CALL sfx2::sidebar::Theme::removeVetoableChangeListener ( const OUString &  rsPropertyName,
const css::uno::Reference< css::beans::XVetoableChangeListener > &  rxListener 
)
overridevirtual

◆ setPropertyValue()

void SAL_CALL sfx2::sidebar::Theme::setPropertyValue ( const OUString &  rsPropertyName,
const css::uno::Any &  rValue 
)
overridevirtual

◆ SetupPropertyMaps()

void sfx2::sidebar::Theme::SetupPropertyMaps ( )
private

◆ UpdateTheme()

void sfx2::sidebar::Theme::UpdateTheme ( )
private

Member Data Documentation

◆ maBooleans

std::vector<bool> sfx2::sidebar::Theme::maBooleans
private

Definition at line 129 of file Theme.hxx.

Referenced by ProcessNewValue(), and SetupPropertyMaps().

◆ maChangeListeners

ChangeListeners sfx2::sidebar::Theme::maChangeListeners
private

Definition at line 142 of file Theme.hxx.

Referenced by disposing(), GetChangeListeners(), and removePropertyChangeListener().

◆ maColors

std::vector<Color> sfx2::sidebar::Theme::maColors
private

Definition at line 127 of file Theme.hxx.

Referenced by GetColor(), ProcessNewValue(), and SetupPropertyMaps().

◆ maIntegers

std::vector<sal_Int32> sfx2::sidebar::Theme::maIntegers
private

Definition at line 128 of file Theme.hxx.

Referenced by GetInteger(), ProcessNewValue(), and SetupPropertyMaps().

◆ maPropertyIdToNameMap

PropertyIdToNameMap sfx2::sidebar::Theme::maPropertyIdToNameMap
private

Definition at line 136 of file Theme.hxx.

Referenced by getProperties(), InitializeTheme(), SetupPropertyMaps(), and UpdateTheme().

◆ maPropertyNameToIdMap

PropertyNameToIdMap sfx2::sidebar::Theme::maPropertyNameToIdMap
private

◆ maRawValues

RawValueContainer sfx2::sidebar::Theme::maRawValues
private

Definition at line 138 of file Theme.hxx.

Referenced by getPropertyValue(), HandleDataChange(), setPropertyValue(), and SetupPropertyMaps().

◆ maVetoableListeners

VetoableListeners sfx2::sidebar::Theme::maVetoableListeners
private

Definition at line 145 of file Theme.hxx.

Referenced by GetVetoableListeners(), and removeVetoableChangeListener().

◆ mbIsHighContrastMode

bool sfx2::sidebar::Theme::mbIsHighContrastMode
private

Definition at line 130 of file Theme.hxx.

Referenced by HandleDataChange(), IsHighContrastMode(), and ProcessNewValue().

◆ mbIsHighContrastModeSetManually

bool sfx2::sidebar::Theme::mbIsHighContrastModeSetManually
private

Definition at line 131 of file Theme.hxx.

Referenced by HandleDataChange(), and ProcessNewValue().


The documentation for this class was generated from the following files: