Application Class Reference

#include <application.h>

Detailed Description

Application wide functions. Implement this interface to be able to link against the kernel library.

Public Member Functions

 MAXON_OBSERVABLE_STATIC (Result< Bool >, ObservableApplicationMessage,(const Id &messageId, const DataDictionary &messageData), ObservableCombinerRunAllBoolUntilFalse)
 

Static Public Member Functions

static MAXON_FUNCTION Result< UrlGetUrl (APPLICATION_URLTYPE urlType)
 
static MAXON_METHOD Result< UrlGetTempUrl (const Url &directory)
 
static MAXON_METHOD Result< BaseArray< Url > > GetModulePaths ()
 
static MAXON_METHOD Int GetCommandLineArgCount ()
 
static MAXON_METHOD String GetCommandLineArg (Int idx)
 
static MAXON_METHOD DataDictionary GetMachineInfo ()
 
static MAXON_METHOD APPLICATIONMODE GetApplicationMode ()
 
static MAXON_METHOD Bool SetApplicationMode (APPLICATIONMODE mode)
 
static MAXON_METHOD Bool GetFeature (APPLICATIONFEATURE feature)
 
static MAXON_METHOD void SetFeature (APPLICATIONFEATURE feature, Bool value)
 
static MAXON_METHOD Result< void > GetVersion (Int &version, String &buildID)
 
static MAXON_METHOD String FormatVersionString (Int rawVersionNumber)
 

Static Protected Member Functions

static MAXON_METHOD Result< UrlGetUrlI (APPLICATION_URLTYPE urlType)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (Application, MAXON_REFERENCE_NONE, "net.maxon.interface.application")
 

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( Application  ,
MAXON_REFERENCE_NONE  ,
"net.maxon.interface.application"   
)
private

◆ GetUrl()

static MAXON_FUNCTION Result<Url> GetUrl ( APPLICATION_URLTYPE  urlType)
static

Returns the requested url.

Parameters
[in]urlTypeType of the url, see APPLICATION_URLTYPE.
Returns
Url containing the requested.

◆ GetTempUrl()

static MAXON_METHOD Result<Url> GetTempUrl ( const Url directory)
static

Returns a new unique url for a temporary file. A typical use for this is Url tempfile = Application::GetTempUrl(tempDirectory);

Parameters
[in]directoryDirectory url where the temporary file should be created in.
Returns
Url pointing to the temporary file.

◆ GetModulePaths()

static MAXON_METHOD Result<BaseArray<Url> > GetModulePaths ( )
static

Returns all module paths configured through g_modulePath, g_additionalModulePath and user preferences.

Returns
Array containing all paths that are searched for modules.

◆ GetCommandLineArgCount()

static MAXON_METHOD Int GetCommandLineArgCount ( )
static

Returns the number of command line arguments delivered to the app on startup.

Returns
Number of arguments to request via GetCommandLineArg().

◆ GetCommandLineArg()

static MAXON_METHOD String GetCommandLineArg ( Int  idx)
static

Returns a command line argument.

Parameters
[in]idxThe index of the argument. (0 >= idx < GetCommandLineArgCount()).
Returns
The requested argument.

◆ GetMachineInfo()

static MAXON_METHOD DataDictionary GetMachineInfo ( )
static

Returns information about the system and processor. See maxon::MACHINEINFO for DataDictionary properties.

◆ GetApplicationMode()

static MAXON_METHOD APPLICATIONMODE GetApplicationMode ( )
static

Retrieves the current application mode. This mode defines the behavior after the startup is done.

Returns
The current application mode.

◆ SetApplicationMode()

static MAXON_METHOD Bool SetApplicationMode ( APPLICATIONMODE  mode)
static

Sets a new application mode. This mode defines the behavior after the startup is done. Please note that it's only possible to raise the mode from APPLICATIONMODE::DONTWAIT to APPLICATIONMODE::KEEPRUNNING.

Parameters
[in]modeThe new mode to be set.
Returns
True if the function changed the mode successfully.

◆ GetFeature()

static MAXON_METHOD Bool GetFeature ( APPLICATIONFEATURE  feature)
static

◆ SetFeature()

static MAXON_METHOD void SetFeature ( APPLICATIONFEATURE  feature,
Bool  value 
)
static
Parameters
[in]featureThe feature to set or clear.
[in]valueThe value of the feature

◆ GetVersion()

static MAXON_METHOD Result<void> GetVersion ( Int version,
String buildID 
)
static

Gets the version number and build ID.

Parameters
[out]versionThe version number will be assigned to this value.
[out]buildIDVariable that will hold the buildID.

◆ FormatVersionString()

static MAXON_METHOD String FormatVersionString ( Int  rawVersionNumber)
static

Formats the Int version returned by GetVersion() into a string with the 2023 (and later) format

Parameters
[in]rawVersionNumberThe version to be formatted.
Returns
The formatted string.

◆ MAXON_OBSERVABLE_STATIC()

MAXON_OBSERVABLE_STATIC ( Result< Bool ,
ObservableApplicationMessage  ,
(const Id &messageId, const DataDictionary &messageData)  ,
ObservableCombinerRunAllBoolUntilFalse   
)

ObservableDatabaseRegistrationChange after a database was added or removed to the system. This can be used to update editors.

◆ GetUrlI()

static MAXON_METHOD Result<Url> GetUrlI ( APPLICATION_URLTYPE  urlType)
staticprotected