SDKDatabaseInterface Class Reference

#include <database.h>

Inheritance diagram for SDKDatabaseInterface:

Detailed Description

The SDKDatabaseInterface is a database to store functions and commands and to define a menu structure.

Static Public Member Functions

static MAXON_METHOD Result< void > AddAction (const String &name, const String &ID, const String &path)
 
static MAXON_METHOD Result< void > AddFunction (Delegate< Result< void >()> d, FunctionSettings settings)
 
static MAXON_METHOD Result< void > ExecuteFunctions ()
 
static MAXON_METHOD Result< void > ExecuteAllFunctions ()
 
static MAXON_METHOD Result< void > ExecuteAction (const String &ID)
 
static MAXON_METHOD Result< void > AddCommand (Delegate< Result< void >(BaseDocument *)> d, const CommandSettings &settings)
 
static MAXON_METHOD Result< Int32AddClassicCommand (const ClassicCommandSettings &settings)
 
static MAXON_METHOD Result< void > ExecuteID (const String &ID, Int32 &pluginID, BaseDocument *doc)
 
static MAXON_METHOD Result< BaseArray< String > > GetFunctionsIDs ()
 
static MAXON_METHOD Result< void > GetAutoTestFunctions (BaseArray< String > &ids)
 
static MAXON_METHOD Result< BaseArray< String > > GetCommandIDs ()
 
static MAXON_METHOD Result< BaseArray< String > > GetClassicCommandIDs ()
 
static MAXON_METHOD Result< BoolIsFunctionID (const String &id)
 
static MAXON_METHOD Result< BoolIsActionID (const String &id)
 
static MAXON_METHOD Result< BoolIsCommandID (const String &id)
 
static MAXON_METHOD Result< BoolIsClassicCommandID (const String &id)
 
static MAXON_METHOD Result< void > ExecuteFunction (const String &id)
 
static MAXON_METHOD Result< void > ExecuteCommand (const String &id, BaseDocument *doc)
 
static MAXON_METHOD Result< BaseArray< MenuEntry > > GetMenuStructure ()
 
static MAXON_METHOD Result< BoolExecuteActionOrFunction (const String &ID)
 
static MAXON_METHOD Result< BoolExecuteCommandEx (const String &ID, BaseDocument *doc)
 
static MAXON_METHOD Result< BoolGetClassicCommand (const String &ID, maxon::Int32 &pluginID)
 
static MAXON_METHOD Result< void > GetStatistics (BaseArray< StatisticsElement > &statistics)
 
static MAXON_METHOD Result< void > GetAutoTestIDs (BaseArray< String > &ids)
 

Private Member Functions

 MAXON_INTERFACE (SDKDatabaseInterface, MAXON_REFERENCE_CONST, "net.maxonsdk.interface.database")
 

Private Attributes

 MAXON_INTERFACE_SINGLE_IMPLEMENTATION
 

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( SDKDatabaseInterface  ,
MAXON_REFERENCE_CONST  ,
"net.maxonsdk.interface.database"   
)
private

◆ AddAction()

static MAXON_METHOD Result<void> AddAction ( const String name,
const String ID,
const String path 
)
static

Adds an action to the database. Such an action is represented in the GUI and used to call functions.

Parameters
[in]nameThe name of the Action. Will be displayed in the GUI.
[in]IDThe Id of the Action. Used to associate an Action with a function in AddFunction() with the FunctionSettings argument.
[in]pathThe menu structure containing the Action in the GUI. Menus have to be separated with "::".
Returns
maxon::OK on success.

◆ AddFunction()

static MAXON_METHOD Result<void> AddFunction ( Delegate< Result< void >()>  d,
FunctionSettings  settings 
)
static

Adds a function to the function database.

Parameters
[in]dA delegate storing the reference to a C++ function.
[in]settingsThe function settings defining the behaviour of the function.
Returns
maxon::OK on success.

◆ ExecuteFunctions()

static MAXON_METHOD Result<void> ExecuteFunctions ( )
static

Executes all functions that are suitable for automatic testing (FunctionSettings._startup = true).

Returns
maxon::OK on success or AggregatedError with all collected errors.

◆ ExecuteAllFunctions()

static MAXON_METHOD Result<void> ExecuteAllFunctions ( )
static

Executes all functions (including functions not suitable for automatic testing).

Returns
maxon::OK on success or AggregatedError with all collected errors.

◆ ExecuteAction()

static MAXON_METHOD Result<void> ExecuteAction ( const String ID)
static

Executes the functions associated with the Action of the given ID.

Parameters
[in]IDAn Action ID.
Returns
maxon::OK if no error occurred or AggregatedError with all collected errors.

◆ AddCommand()

static MAXON_METHOD Result<void> AddCommand ( Delegate< Result< void >(BaseDocument *)>  d,
const CommandSettings settings 
)
static

Adds a command to the function database.

Parameters
[in]dA delegate storing the reference to a C++ function.
[in]settingsThe function settings defining the behaviour of the function.
Returns
maxon::OK on success.

◆ AddClassicCommand()

static MAXON_METHOD Result<Int32> AddClassicCommand ( const ClassicCommandSettings settings)
static

Adds a classic command. The command invokes the CommandData plugin that was registered with the returned ID.

Parameters
[in]settingsClassic command settings.
Returns
Plugin ID for convenience.

◆ ExecuteID()

static MAXON_METHOD Result<void> ExecuteID ( const String ID,
Int32 pluginID,
BaseDocument doc 
)
static

Executes the given ID. param[in] ID A command ID, function ID or action ID. param[out] ID The plugin CommandData ID if it is a classic command. param[in] doc The document to execute a command on.

Returns
maxon::OK on success.

◆ GetFunctionsIDs()

static MAXON_METHOD Result<BaseArray<String> > GetFunctionsIDs ( )
static

Returns all function IDs.

Returns
An array of function IDs.

◆ GetAutoTestFunctions()

static MAXON_METHOD Result<void> GetAutoTestFunctions ( BaseArray< String > &  ids)
static

Gets all auto-test funtions.

Parameters
[out]idsBaseArray filled with the IDs of auto test functions.
Returns
OK on success.

◆ GetCommandIDs()

static MAXON_METHOD Result<BaseArray<String> > GetCommandIDs ( )
static

Returns all command IDs.

Returns
An array of command IDs.

◆ GetClassicCommandIDs()

static MAXON_METHOD Result<BaseArray<String> > GetClassicCommandIDs ( )
static

Returns all classic command IDs.

Returns
An array of classic command IDs.

◆ IsFunctionID()

static MAXON_METHOD Result<Bool> IsFunctionID ( const String id)
static

Checks if the given ID is a function ID.

Parameters
[in]idThe ID to check
Returns
True if it is a function ID.

◆ IsActionID()

static MAXON_METHOD Result<Bool> IsActionID ( const String id)
static

Checks if the given ID is an action ID.

Parameters
[in]idThe ID to check
Returns
True if it is an action ID.

◆ IsCommandID()

static MAXON_METHOD Result<Bool> IsCommandID ( const String id)
static

Checks if the given ID is a command ID.

Parameters
[in]idThe ID to check
Returns
True if it is a command ID.

◆ IsClassicCommandID()

static MAXON_METHOD Result<Bool> IsClassicCommandID ( const String id)
static

Checks if the given ID is a classic command ID.

Parameters
[in]idThe ID to check
Returns
True if it is a classic command ID.

◆ ExecuteFunction()

static MAXON_METHOD Result<void> ExecuteFunction ( const String id)
static

Executes the given function.

Parameters
[in]idThe ID of a function.
Returns
maxon::OK on success.

◆ ExecuteCommand()

static MAXON_METHOD Result<void> ExecuteCommand ( const String id,
BaseDocument doc 
)
static

Executes the given command. Compare ExecuteCommandEx().

Parameters
[in]idThe ID of a function.
[in]docThe BaseDocument to execute the command in.
Returns
maxon::OK on success.

◆ GetMenuStructure()

static MAXON_METHOD Result<BaseArray<MenuEntry> > GetMenuStructure ( )
static

Returns the combined menu structure of all Actions, commands and classic commands.

Returns
A BaseArray of MenuEntry elements representing Actions or sub-menus.

◆ ExecuteActionOrFunction()

static MAXON_METHOD Result<Bool> ExecuteActionOrFunction ( const String ID)
static

Executes an action or function.

Parameters
[in]IDThe ID of a function or action
Returns
true if the given ID was the ID of a function or action.

◆ ExecuteCommandEx()

static MAXON_METHOD Result<Bool> ExecuteCommandEx ( const String ID,
BaseDocument doc 
)
static

Executes the given command.

Parameters
[in]IDThe ID of a command.
[in]docThe BaseDocument to execute the command in.
Returns
true if the given ID was the ID of a command.

◆ GetClassicCommand()

static MAXON_METHOD Result<Bool> GetClassicCommand ( const String ID,
maxon::Int32 pluginID 
)
static

Returns the plugin ID of the given classic command.

Parameters
[in]IDThe ID of a classic command.
[in,out]pluginIDThe classic plugin ID; to be used with CallCommand().
Returns
true if the given ID was the ID of a classic command.

◆ GetStatistics()

static MAXON_METHOD Result<void> GetStatistics ( BaseArray< StatisticsElement > &  statistics)
static

Returns an array with execution statistics of the current session.

Parameters
[out]statisticsAn array that will be filled with statistics.
Returns
OK on success.

◆ GetAutoTestIDs()

static MAXON_METHOD Result<void> GetAutoTestIDs ( BaseArray< String > &  ids)
static

Provides the IDs of all auto-test functions.

Parameters
[out]idsAn array that will be filled with function IDs.
Returns
OK on success.

Member Data Documentation

◆ MAXON_INTERFACE_SINGLE_IMPLEMENTATION

MAXON_INTERFACE_SINGLE_IMPLEMENTATION
private