Used to access all the application-wide state and structures. More...
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 | |
| ApplicationContext & | operator= (const ApplicationContext &)=delete |
| template<typename T > | |
| T & | settings () const |
| Access a specific Settings model instance. | |
| template<typename T > | |
| T * | findSettings () const noexcept |
| Access a Settings model instance, or null when its plug-in did not register one. | |
| const auto & | allSettings () const noexcept |
| const auto & | addons () const |
| List of all the registered addons. | |
| template<typename T > | |
| const T & | interfaces () const |
| Access to a specific interface list. | |
| auto | instantiateUndoCommand (const CommandData &cmd) const |
| instantiateUndoCommand Is used to generate a Command from its serialized data. | |
| const score::DocumentContext * | currentDocument () const noexcept |
Public Attributes | |
| const score::ApplicationSettings & | applicationSettings |
| Access to start-up command-line settings. | |
| const score::ApplicationComponents & | components |
| DocumentList & | documents |
Member Function Documentation
◆ addons()
|
inline |
List of all the registered addons.
- See also
- score::Addon
◆ findSettings()
|
inlinenoexcept |
Access a Settings model instance, or null when its plug-in did not register one.
settings() aborts the process in that case, which is the right answer for application code (a missing settings model means the plug-in it belongs to is not loaded, and nothing downstream can work). Callers that can report the situation themselves want the null instead.
◆ instantiateUndoCommand()
|
inline |
instantiateUndoCommand Is used to generate a Command from its serialized data.
- Parameters
-
parent_name The name of the object able to generate the command. Must be a CustomCommand. name The name of the command to generate. data The data of the command.
Ownership of the command is transferred to the caller, and he must delete it.
◆ interfaces()
|
inline |
Access to a specific interface list.
- See also
- score::InterfaceList
◆ settings()
|
inline |
Access a specific Settings model instance.
- See also
- score::Settings::Model
The documentation for this struct was generated from the following files:
- ApplicationContext.hpp
- ApplicationContext.cpp