CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::UIAppearance Class Reference

An object that describes the appearance of a UI view. More...

#include <CeresEngine/UI/UIAppearance.hpp>

Inheritance diagram for CeresEngine::UIAppearance:
CeresEngine::RefCounted< UIAppearance >

Public Member Functions

 UIAppearance ()
 
 ~UIAppearance () noexcept
 
template<typename T >
void set (const UIAppearanceProperty< T > &property, const T &value)
 Sets a new property override on the appearance.
 
template<typename T >
Optional< const T & > get (const UIAppearanceProperty< T > &property) const
 Tries to find an override for the given appearance property.
 
- Public Member Functions inherited from CeresEngine::RefCounted< UIAppearance >
 RefCounted (Args &&... args)
 Creates a new RefCounted object and constructs a new Deleter by forwarding Args to it.
 
void retain () noexcept
 Retains the object by increment it's reference count by one.
 
bool release () noexcept
 Relases the object by decrementing it's reference count by one.
 

Private Types

using PropertyVariant = Variant< UIColor, double, Paint, HFont >
 

Private Attributes

HashMap< String, PropertyVariantmProperties
 

Detailed Description

An object that describes the appearance of a UI view.

Member Typedef Documentation

◆ PropertyVariant

Constructor & Destructor Documentation

◆ UIAppearance()

CeresEngine::UIAppearance::UIAppearance ( )

◆ ~UIAppearance()

CeresEngine::UIAppearance::~UIAppearance ( )
noexcept

Member Function Documentation

◆ get()

template<typename T >
template Optional< const HFont & > CeresEngine::UIAppearance::get ( const UIAppearanceProperty< T > &  property) const

Tries to find an override for the given appearance property.

Template Parameters
TThe property value type.
Parameters
propertyThe appearance property.
Returns
An optional value that will return the override value if defined or an empty value if not.

◆ set()

template<typename T >
template void CeresEngine::UIAppearance::set ( const UIAppearanceProperty< T > &  property,
const T value 
)

Sets a new property override on the appearance.

Any views or subviews to which the appearance is attached to, will use this value when resolving the property.

Template Parameters
TThe property value type.
Parameters
propertyThe appearance property.
valueThe new appearance property override value.

Member Data Documentation

◆ mProperties

HashMap<String, PropertyVariant> CeresEngine::UIAppearance::mProperties
private

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