DataDescriptionUIInterface Class Reference

#include <datadescription_ui.h>

Inheritance diagram for DataDescriptionUIInterface:

Detailed Description

This interface provides helper functions for ui stuff in combination with descriptions.

Static Public Member Functions

static MAXON_METHOD Result< void > BuildPopupMenuForDescription (const DataDescriptionWithUIAndString &description, const HashMap< CString, CString > &externalVariables, const ContextVarsMap &contextVars, const ValueReceiver< SubMenuEntry && > &mainMenuEntries)
 
static MAXON_METHOD Result< BoolEvaluateCondition (const CString &condition, const DataDescriptionWithUIAndString &description, const GetDataCallbackType &getDataCallback, const HashMap< CString, CString > &externalVariables)
 
static MAXON_METHOD Result< BoolEvaluateCondition (const CString &condition, const DataDescriptionWithUIAndString &description, const GetDescEntriesCallbackType &getDescCallback, const GetDataCallbackType &getDataCallback, const HashMap< CString, CString > &externalVariables)
 
static MAXON_METHOD Result< BaseArray< CString > > TokenizeCondition (const CString &condition, const DataDescriptionWithUIAndString &description, const GetDescEntriesCallbackType &getDescCallback, const GetDataCallbackType &getDataCallback, const ValueReceiver< const ConditionToken & > &tokenRecv=ValueReceiver< const ConditionToken & >{})
 

Private Member Functions

 MAXON_INTERFACE (DataDescriptionUIInterface, MAXON_REFERENCE_CONST, "net.maxon.interface.datadescriptionui", MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel"))
 

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( DataDescriptionUIInterface  ,
MAXON_REFERENCE_CONST  ,
"net.maxon.interface.datadescriptionui"  ,
MAXON_IMPLEMENTATION_MODULE("net.maxon.kernel")   
)
private

◆ BuildPopupMenuForDescription()

static MAXON_METHOD Result<void> BuildPopupMenuForDescription ( const DataDescriptionWithUIAndString description,
const HashMap< CString, CString > &  externalVariables,
const ContextVarsMap contextVars,
const ValueReceiver< SubMenuEntry && > &  mainMenuEntries 
)
static

BuildPopupMenuForDescription description.

Parameters
[in]descriptionDescription to use.
[in]externalVariablesExternal variables for the FormulaParser.
[in]contextVarsHashMap with variables to execute and evaluate the menu checks for each context that should be used.
[out]mainMenuEntriesValue Receiver which receives the created menu entries.
Returns
OK on success.

◆ EvaluateCondition() [1/2]

static MAXON_METHOD Result<Bool> EvaluateCondition ( const CString condition,
const DataDescriptionWithUIAndString description,
const GetDataCallbackType getDataCallback,
const HashMap< CString, CString > &  externalVariables 
)
static

Evaluates a condition within a given description.

See also
EvaluateCondition, will use a default GetDescEntriesCallbackType callback to read from #description.

◆ EvaluateCondition() [2/2]

static MAXON_METHOD Result<Bool> EvaluateCondition ( const CString condition,
const DataDescriptionWithUIAndString description,
const GetDescEntriesCallbackType getDescCallback,
const GetDataCallbackType getDataCallback,
const HashMap< CString, CString > &  externalVariables 
)
static

Evaluates a condition within a given description. The GetDescEntriesCallbackType allows to provided altered DataDictionary for requested attributes if desired.

Parameters
[in]conditionCondition string to evaluate.
[in]descriptionDescription to use.
[in]getDescCallbackCallback to get "data"/"gui" description entries related to the condition to evaluate. Also can modify the id given to #getDataCallback;
[in]getDataCallbackCallback to get data for the evaluation.
[in]externalVariablesExternal variables for the FormulaParser.
Returns
True if the condition matches. False if not.

◆ TokenizeCondition()

static MAXON_METHOD Result<BaseArray<CString> > TokenizeCondition ( const CString condition,
const DataDescriptionWithUIAndString description,
const GetDescEntriesCallbackType getDescCallback,
const GetDataCallbackType getDataCallback,
const ValueReceiver< const ConditionToken & > &  tokenRecv = ValueReceiver< const ConditionToken & >{} 
)
static

Split a condition into tokens. Called from EvaluateCondition. Token will be replaced by their value for the FormulaParser. If #getDescCallback is empty, #tokenRecv will be called directly with CONDITIONTOKENTYPE::VARIABLE type for all tokens of unknown type (i.e. all kinds of attributes or variable, unknown characters and names). This can be useful for some parsing situations outside of the DataDescription regular use cases.

See also
EvaluateCondition.
Parameters
[in]tokenRecvReceiver for the tokens.
Returns
The final (replaced) token list.