TGUI  1.3.0
Loading...
Searching...
No Matches
tgui::BaseThemeLoader Class Referenceabstract

Base class for theme loader implementations. More...

#include <TGUI/Loading/ThemeLoader.hpp>

Inheritance diagram for tgui::BaseThemeLoader:
tgui::DefaultThemeLoader

Public Member Functions

virtual ~BaseThemeLoader ()=default
 Virtual destructor.
 
virtual void preload (const String &primary)
 Optionally already do some work when only the primary parameter is known yet.
 
virtual TGUI_NODISCARD std::map< String, StringgetGlobalProperties (const String &primary)
 Loads the global property-value pairs from the theme.
 
virtual TGUI_NODISCARD const std::map< String, String > & load (const String &primary, const String &secondary)=0
 Loads the property-value pairs from the theme.
 
virtual TGUI_NODISCARD bool canLoad (const String &primary, const String &secondary)=0
 Check if the requested property-value pairs are available.
 

Protected Member Functions

void injectThemePath (const std::unique_ptr< DataIO::Node > &node, const String &path) const
 
void resolveReferences (std::map< String, std::reference_wrapper< const std::unique_ptr< DataIO::Node > > > &sections, const std::map< String, String > &globalProperties, const std::unique_ptr< DataIO::Node > &node) const
 

Detailed Description

Base class for theme loader implementations.

Member Function Documentation

◆ canLoad()

virtual TGUI_NODISCARD bool tgui::BaseThemeLoader::canLoad ( const String & primary,
const String & secondary )
pure virtual

Check if the requested property-value pairs are available.

Parameters
primaryPrimary parameter of the loader
secondarySecondary parameter of the loader

For the default loader, the primary parameter is the filename while the secondary parameter is the section name.

Returns
Whether a map op property-value pairs is available

Implemented in tgui::DefaultThemeLoader.

◆ getGlobalProperties()

virtual TGUI_NODISCARD std::map< String, String > tgui::BaseThemeLoader::getGlobalProperties ( const String & primary)
virtual

Loads the global property-value pairs from the theme.

Parameters
primaryPrimary parameter of the loader

For the default loader, the primary parameter is the filename.

Returns
Map of property-value pairs

Reimplemented in tgui::DefaultThemeLoader.

◆ load()

virtual TGUI_NODISCARD const std::map< String, String > & tgui::BaseThemeLoader::load ( const String & primary,
const String & secondary )
pure virtual

Loads the property-value pairs from the theme.

Parameters
primaryPrimary parameter of the loader
secondarySecondary parameter of the loader

For the default loader, the primary parameter is the filename while the secondary parameter is the section name.

Returns
Map of property-value pairs

Implemented in tgui::DefaultThemeLoader.

◆ preload()

virtual void tgui::BaseThemeLoader::preload ( const String & primary)
virtual

Optionally already do some work when only the primary parameter is known yet.

Parameters
primaryPrimary parameter of the loader (filename of the theme file in DefaultThemeLoader)

Reimplemented in tgui::DefaultThemeLoader.


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