Rogue Wave Views Application Framework Package API Reference Guide |
Rogue Wave Views Documentation Home |
Application Framework interface class. More...
#include <ilviews/appframe/interf.h>
Public Member Functions | |
IlBoolean | callMethod (const IlSymbol *methodName, IlvDvValue *returnedValue,...) |
Generic method for calling a method that is exported in a class interface. More... | |
IlvDvValue & | getFieldValue (const IlSymbol *fieldName, IlvDvValue &value) const |
Gets a field value. More... | |
virtual IlBoolean | isProcessingAction (const IlSymbol *methodName) const |
Returns IlTrue if the given action can be processed by the class. More... | |
virtual IlBoolean | processAction (const IlSymbol *actionName) |
Processes an action. More... | |
virtual IlBoolean | refreshAction (const IlSymbol *actionName, IlvDvActionDescriptor *desc) const |
Refresh all the menu items that reference the action given by the parameter actionName. More... | |
void | setFieldValue (const IlSymbol *fieldName, const IlvDvValue &value) |
Sets a field value. More... | |
Application Framework interface class.
Library: ilvappframe
Application Framework provides an introspection mechanism that allows a C++ class to:
getFieldValue(fieldName)
and setFieldValue(fieldName, value)
, callMethod(methodName, values)
.This mechanism provides the following advantages:
To be introspected, a class must both inherit from the IlvDvInterface
class and add some macros in its declaration and its implementation file.
Here is a sample of how to use Application Framework introspection:
Naming Convention for Macros Used for Scripting and Introspection
The root of the macro name must be Method
. If the declared method returns a value, the macro must begin with prefix Typed
.
If the declared method contains arguments, the macro must end with the suffix number equal to the number of parameters of the method.
Here are some macro samples:
IlFloat getPosition() const
will be declared TypedMethod(GetPosition, getPosition, IlFloat)
in the interface table. const char* set(int)
will be declared TypedMethod1(Set, set, int, ExportedFirstParameterName, const char*)
in the interface table. void setPosition(int x, int y)
will be declared Method2(SetPosition, setPosition, int, X, int, Y)
in the interface table. IlBoolean IlvDvInterface::callMethod | ( | const IlSymbol * | methodName, |
IlvDvValue * | returnedValue, | ||
... | |||
) |
Generic method for calling a method that is exported in a class interface.
Calls a method that is exported in the interface table of the class by using the macro xxxMethodxxx(externalName, method,...)
. The externalName
corresponds to the methodName parameter.
methodName | The name of the method to call. |
returnedValue | The returned value of the called method is stored in this parameter. If the type of the called method is void , this field is not filled. |
IlTrue
if the C++ method is called. IlvDvValue& IlvDvInterface::getFieldValue | ( | const IlSymbol * | fieldName, |
IlvDvValue & | value | ||
) | const |
Gets a field value.
Gets the value of the field declared in the interface table with an external name that is equal to the fieldName parameter. The value is set in the value parameter.
Returns IlTrue
if the given action can be processed by the class.
IlTrue
if the given action can be processed by the class. Reimplemented in IlvDvDocTemplate.
Processes an action.
Tries to process the action given by the parameter actionName. If a macro Action(actionName, actionMethod)
is inserted in the interface table of the class with a specified external name equal to the actionName parameter, the processAction
method will automatically call the actionMethod
method.
IlTrue
if the action is processed. Reimplemented in IlvDvApplication, IlvDvDocTemplate, and IlvDvDockableMainWindow.
|
virtual |
Refresh all the menu items that reference the action given by the parameter actionName.
If a macro RefreshAction(actionName, refreshMethod)
is inserted in the interface table of the class with a specified external name equal to the actionName parameter, the refreshAction
method will automatically call the refreshMethod
method, with desc as the parameter.
All modifications brought to the desc parameter are directly dispatched to all the menu items that reference the action.
IlTrue
if the given action is refreshed. Reimplemented in IlvDvApplication.
void IlvDvInterface::setFieldValue | ( | const IlSymbol * | fieldName, |
const IlvDvValue & | value | ||
) |
Sets a field value.
Sets the value value to the field that is declared in the interface table with an external name equal to the fieldName parameter.
© Copyright 2017, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.