Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
IGUISetting Class Referenceabstract

This setting interface allows GUI objects to call setting function functions without having to know the setting type. More...

#include <CGUISetting.h>

Inheritance diagram for IGUISetting:
Collaboration diagram for IGUISetting:

Public Member Functions

 NONCOPYABLE (IGUISetting)
 
 IGUISetting (const CStr &name, IGUIObject *owner)
 
bool FromString (const CStrW &value, const bool sendMessage)
 Parses the given string and assigns to the setting value. More...
 
bool FromJSVal (const ScriptRequest &rq, JS::HandleValue value, const bool sendMessage)
 Parses the given JS::Value using Script::FromJSVal and assigns it to the setting data. More...
 
virtual void ToJSVal (const ScriptRequest &rq, JS::MutableHandleValue value)=0
 Converts the setting data to a JS::Value using Script::ToJSVal. More...
 

Protected Member Functions

 IGUISetting (IGUISetting &&other)
 
IGUISettingoperator= (IGUISetting &&other)=delete
 
virtual ~IGUISetting ()=default
 
virtual bool DoFromString (const CStrW &value)=0
 
virtual bool DoFromJSVal (const ScriptRequest &rq, JS::HandleValue value)=0
 
virtual void OnSettingChange (const CStr &setting, bool sendMessage)
 Triggers the IGUIObject logic when a setting changes. More...
 
const CStr & GetName () const
 Return the name of the setting, from JS. More...
 

Protected Attributes

IGUIObjectm_Object
 The object that stores this setting. More...
 

Private Attributes

CStr m_Name
 

Detailed Description

This setting interface allows GUI objects to call setting function functions without having to know the setting type.

This is fact is used for setting the value from a JS value or XML value (string) and when deleting the setting, when the type of the setting value is not known in advance.

Constructor & Destructor Documentation

◆ IGUISetting() [1/2]

IGUISetting::IGUISetting ( const CStr &  name,
IGUIObject owner 
)

◆ IGUISetting() [2/2]

IGUISetting::IGUISetting ( IGUISetting &&  other)
protected

◆ ~IGUISetting()

virtual IGUISetting::~IGUISetting ( )
protectedvirtualdefault

Member Function Documentation

◆ DoFromJSVal()

◆ DoFromString()

◆ FromJSVal()

bool IGUISetting::FromJSVal ( const ScriptRequest rq,
JS::HandleValue  value,
const bool  sendMessage 
)

Parses the given JS::Value using Script::FromJSVal and assigns it to the setting data.

Parses the given JS::Value using ScriptInterface::FromJSVal and assigns it to the setting data.

◆ FromString()

bool IGUISetting::FromString ( const CStrW &  value,
const bool  sendMessage 
)

Parses the given string and assigns to the setting value.

Used for parsing XML attributes.

◆ GetName()

const CStr & IGUISetting::GetName ( ) const
inlineprotected

Return the name of the setting, from JS.

◆ NONCOPYABLE()

IGUISetting::NONCOPYABLE ( IGUISetting  )

◆ OnSettingChange()

void IGUISetting::OnSettingChange ( const CStr &  setting,
bool  sendMessage 
)
protectedvirtual

Triggers the IGUIObject logic when a setting changes.

This should be called by derived classes when something externally visible changes, unless overloaded to provide similar behaviour.

Reimplemented in CGUIHotkey.

◆ operator=()

IGUISetting & IGUISetting::operator= ( IGUISetting &&  other)
protecteddelete

◆ ToJSVal()

Member Data Documentation

◆ m_Name

CStr IGUISetting::m_Name
private

◆ m_Object

IGUIObject& IGUISetting::m_Object
protected

The object that stores this setting.


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