Pyrogenesis  trunk
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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:
Inheritance graph
[legend]
Collaboration diagram for IGUISetting:
Collaboration graph
[legend]

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 &&o)
 
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...
 
virtual CStr GetName () const =0
 Return the name of the setting, from JS. More...
 

Protected Attributes

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

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 &&  o)
protected

◆ ~IGUISetting()

virtual IGUISetting::~IGUISetting ( )
protectedvirtualdefault

Member Function Documentation

◆ DoFromJSVal()

virtual bool IGUISetting::DoFromJSVal ( const ScriptRequest rq,
JS::HandleValue  value 
)
protectedpure virtual

◆ DoFromString()

virtual bool IGUISetting::DoFromString ( const CStrW &  value)
protectedpure virtual

◆ 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()

virtual CStr IGUISetting::GetName ( ) const
protectedpure virtual

◆ 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.

◆ ToJSVal()

virtual void IGUISetting::ToJSVal ( const ScriptRequest rq,
JS::MutableHandleValue  value 
)
pure virtual

Member Data Documentation

◆ m_pObject

IGUIObject& IGUISetting::m_pObject
protected

The object that stores this setting.


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