score::ApplicationContext Struct Reference

Used to access all the application-wide state and structures. More...

Inheritance diagram for score::ApplicationContext:
score::GUIApplicationContext

Detailed Description

Used to access all the application-wide state and structures.

For instance : menus, toolbars, registered factories, etc.

Accessible through score::AppContext() ; however, it is better to try to get a reference to it by constructor injection.

Public Member Functions

 ApplicationContext (const score::ApplicationSettings &, const ApplicationComponents &, DocumentList &l, const std::vector< std::unique_ptr< score::SettingsDelegateModel >> &)
 
 ApplicationContext (const ApplicationContext &)=delete
 
 ApplicationContext (ApplicationContext &&)=delete
 
ApplicationContextoperator= (const ApplicationContext &)=delete
 
template<typename T >
T & settings () const
 Access a specific Settings model instance. More...
 
const auto & addons () const
 List of all the registered addons. More...
 
template<typename T >
const T & interfaces () const
 Access to a specific interface list. More...
 
auto instantiateUndoCommand (const CommandData &cmd) const
 instantiateUndoCommand Is used to generate a Command from its serialized data. More...
 
const score::DocumentContextcurrentDocument () const noexcept
 

Public Attributes

const score::ApplicationSettingsapplicationSettings
 Access to start-up command-line settings.
 
const score::ApplicationComponentscomponents
 
DocumentListdocuments
 

Member Function Documentation

◆ addons()

const auto& score::ApplicationContext::addons ( ) const
inline

List of all the registered addons.

See also
score::Addon

◆ instantiateUndoCommand()

auto score::ApplicationContext::instantiateUndoCommand ( const CommandData cmd) const
inline

instantiateUndoCommand Is used to generate a Command from its serialized data.

Parameters
parent_nameThe name of the object able to generate the command. Must be a CustomCommand.
nameThe name of the command to generate.
dataThe data of the command.

Ownership of the command is transferred to the caller, and he must delete it.

◆ interfaces()

template<typename T >
const T& score::ApplicationContext::interfaces ( ) const
inline

Access to a specific interface list.

See also
score::InterfaceList

◆ settings()

template<typename T >
T& score::ApplicationContext::settings ( ) const
inline

Access a specific Settings model instance.

See also
score::Settings::Model

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