|
MT Showcase SDK
|
This is a singleton class that manages the Showcase runtime. More...
#include <Showcase.hpp>
Public Member Functions | |
| void | tearDown () |
| Clear all UI, content and settings and reset node graph This should only be called once just before shutting down the application. | |
| GraphPtr | graph () |
| Graph class handles Showcase node graph parsing and queries. More... | |
| UserInterfacePtr | ui () |
| UserInterface class handles all UI-components in Showcase. More... | |
| ServiceProviderPtr | services () |
| ServiceProvider class handles all registered services in Showcase. More... | |
| RemoteControlPtr | remoteControl () |
| RemoteControl class handles communication with the Showcase Editor. More... | |
| std::shared_ptr< ScheduleManager > | scheduleManager () |
| Schedule manager notifies scheduled events to update their status at requested times. More... | |
| void | init () |
| Initialize Showcase instance, this will parse and load all packages and prepare Showcase data Called automatically when Showcase instance is created. More... | |
| PackagePtr | packageOfComponent (const QString &componentName) |
| Find a package that includes a component with the given name. More... | |
| void | addCSSFiles (const std::vector< QString > &filePaths) |
| Load given CSS files to the application. More... | |
| void | addCSSFile (const QString &filePath) |
| Load given CSS file to the application. More... | |
| void | removeCSSFiles (const std::vector< QString > &filePaths) |
| Unload given CSS files from the application. More... | |
| void | removeCSSFile (const QString &filePath) |
| Unload given CSS file from the application. More... | |
| void | run () |
| Start the Showcase application This will load the UI and services for the selected run configuration, or display the welcome screen if no run configuration is selected. More... | |
| bool | hasRunConfiguration () const |
| Run configuration determines Showcase application looks, content and settings. More... | |
| RunConfigurationPtr | runConfiguration () |
| Run configuration determines Showcase application looks, content and settings. More... | |
| void | reloadRunConfiguration (bool showLoadingOverlay=false) |
| Reset all UI and services and reload the current run configuration. More... | |
| void | runConfigurationChanged (int id) |
| Notifies Showcase that a run configuration has changed. More... | |
| void | reloadSchedule () |
| Reload the current schedule configuration. | |
| void | scheduleChanged (int id) |
| Notifies Showcase that a schedule has changed. More... | |
| void | registerWidgetInstance (Valuable::Node::Uuid widgetId, std::weak_ptr< WidgetInstance > instance) |
| Register a WidgetInstance for given widgetId. More... | |
| void | unregisterWidgetInstance (Valuable::Node::Uuid widgetId) |
| Unregister a WidgetInstance for given widget id. More... | |
| std::shared_ptr< WidgetInstance > | widgetInstance (Valuable::Node::Uuid widgetId) |
| Get a WidgetInstance for the given widget id. More... | |
| void | showErrorScreen (const QByteArray &css="", const QString &error="") |
| Display an error screen with an optional error text and CSS class. More... | |
| void | removeErrorScreen () |
| Remove the error screen if it's active. | |
| QString | editorAddress (bool hideDefaultPort=true) const |
| Get the URL address of the connected Showcase Editor. More... | |
| void | minimize () |
| Minimize Showcase, for example when another application is running in fullscreen. | |
| void | resume () |
| Resume Showcase. | |
| QString | remoteControlServer () const |
| Get the address of the Showcase Editor's control server. More... | |
| std::shared_ptr< folly::Executor > | graphExecutor () |
| Showcase uses a single executor for all graph handling. More... | |
| std::shared_ptr< folly::Executor > | configExecutor () |
| Showcase uses a single executor for handling configuration. More... | |
| bool | verifyGraphExecutorCallingThread () const |
| All graph handling should happen in the graph executor's thread, this will check the current thread. More... | |
| void | addThemeComponent (const QString &component) |
| Some components are 'theme-defaults'. More... | |
| const QStringList & | themeComponents () const |
| Get a list of all registered theme defaults components. More... | |
| void | setShowExit (bool show) |
| If show exit is enabled, Showcase Welcome screen displays a button to exit Showcase. More... | |
Static Public Member Functions | |
| static void | setAssetsPath (const QString &path) |
| Set the path to main Showcase assets directory This will add the path to search paths as Utils::assetSearchPathName. More... | |
| static std::weak_ptr< Showcase > | weakInstance () |
| Access a weak pointer to Showcase instance. More... | |
| static const QString & | version () |
| Current version of Showcase core. More... | |
| static QByteArray | showcaseGitHash () |
| Showcase build git hash, or empty string if git hash is not available. | |
| static boost::expected < QString, QString > | showcaseRoot () |
| Find the Showcase root folder. More... | |
| static QString | localDataDirectory () |
| Local directory for Showcase data. More... | |
| static QString | localCacheDirectory () |
| Showcase saves some data in a local cache directory. More... | |
| static QString | logDirectory () |
| Log directory for Showcase. More... | |
| static void | errorMessage (const QString &msg) |
| Log the given error message. More... | |
This is a singleton class that manages the Showcase runtime.
You can access other aspects of Showcase like the user interface, configuration or packages through this class.
| void Showcase::Showcase::addCSSFile | ( | const QString & | filePath | ) |
Load given CSS file to the application.
You can load the same file multiple times if it's used by multiple different packages. In that case you need to remove the file multiple times as well.
| filePath | path to the CSS file |
| void Showcase::Showcase::addCSSFiles | ( | const std::vector< QString > & | filePaths | ) |
Load given CSS files to the application.
| filePaths | paths to the CSS files |
| void Showcase::Showcase::addThemeComponent | ( | const QString & | component | ) |
Some components are 'theme-defaults'.
They are never used directly, but other components can use their settings if they have matching slots or attributes. For example a component with attribute "rotate-towards-hands" will use that attribute value from theme defaults if it doesn't have it defined itself Register a new component as a theme default
| component | name of the component |
|
inline |
Showcase uses a single executor for handling configuration.
| QString Showcase::Showcase::editorAddress | ( | bool | hideDefaultPort = true | ) | const |
|
static |
Log the given error message.
| msg | error message to log |
| GraphPtr Showcase::Showcase::graph | ( | ) |
|
inline |
| bool Showcase::Showcase::hasRunConfiguration | ( | ) | const |
| void Showcase::Showcase::init | ( | ) |
Initialize Showcase instance, this will parse and load all packages and prepare Showcase data Called automatically when Showcase instance is created.
Load all libs from default locations and environment Need to load everything here, because we need to call Showcase::instance() during addition of components
Add global CSS file for components that don't come from packages, such as the root component
|
static |
Showcase saves some data in a local cache directory.
For example previous run configuration and generated PDF page images are saved in this location.
|
static |
|
static |
| PackagePtr Showcase::Showcase::packageOfComponent | ( | const QString & | componentName | ) |
Find a package that includes a component with the given name.
| componentName | Unique name that identifies the component |
| void Showcase::Showcase::registerWidgetInstance | ( | Valuable::Node::Uuid | widgetId, |
| std::weak_ptr< WidgetInstance > | instance | ||
| ) |
Register a WidgetInstance for given widgetId.
| widgetId | id of the widget to register an instance for |
| instance | to register |
| void Showcase::Showcase::reloadRunConfiguration | ( | bool | showLoadingOverlay = false | ) |
Reset all UI and services and reload the current run configuration.
| showLoadingOverlay | if true, show a loading overlay until the new run configuration has finished loading |
| RemoteControlPtr Showcase::Showcase::remoteControl | ( | ) |
RemoteControl class handles communication with the Showcase Editor.
| QString Showcase::Showcase::remoteControlServer | ( | ) | const |
Get the address of the Showcase Editor's control server.
Note that this address can be different from the Editor address, as the server uses a different port
| void Showcase::Showcase::removeCSSFile | ( | const QString & | filePath | ) |
Unload given CSS file from the application.
| filePath | path to the CSS file |
| void Showcase::Showcase::removeCSSFiles | ( | const std::vector< QString > & | filePaths | ) |
Unload given CSS files from the application.
| filePaths | paths to the CSS files |
| void Showcase::Showcase::run | ( | ) |
Start the Showcase application This will load the UI and services for the selected run configuration, or display the welcome screen if no run configuration is selected.
If control host is not specified read run confs manually
| RunConfigurationPtr Showcase::Showcase::runConfiguration | ( | ) |
Run configuration determines Showcase application looks, content and settings.
| void Showcase::Showcase::runConfigurationChanged | ( | int | id | ) |
Notifies Showcase that a run configuration has changed.
If this is the current run configuration, it's reloaded
| id | if of the changed configuration |
| void Showcase::Showcase::scheduleChanged | ( | int | id | ) |
Notifies Showcase that a schedule has changed.
| id | if of the changed schedule |
| ScheduleManagerPtr Showcase::Showcase::scheduleManager | ( | ) |
Schedule manager notifies scheduled events to update their status at requested times.
| ServiceProviderPtr Showcase::Showcase::services | ( | ) |
ServiceProvider class handles all registered services in Showcase.
|
static |
Set the path to main Showcase assets directory This will add the path to search paths as Utils::assetSearchPathName.
| path | path to new assets directory |
| void Showcase::Showcase::setShowExit | ( | bool | show | ) |
|
static |
| void Showcase::Showcase::showErrorScreen | ( | const QByteArray & | css = "", |
| const QString & | error = "" |
||
| ) |
Display an error screen with an optional error text and CSS class.
| css | css class to apply to the error screen |
| error | error text to show in the error screen |
| const QStringList & Showcase::Showcase::themeComponents | ( | ) | const |
Get a list of all registered theme defaults components.
| UserInterfacePtr Showcase::Showcase::ui | ( | ) |
UserInterface class handles all UI-components in Showcase.
| void Showcase::Showcase::unregisterWidgetInstance | ( | Valuable::Node::Uuid | widgetId | ) |
Unregister a WidgetInstance for given widget id.
| widgetId | id of the widget to unregister |
| bool Showcase::Showcase::verifyGraphExecutorCallingThread | ( | ) | const |
All graph handling should happen in the graph executor's thread, this will check the current thread.
Used for internal debugging
|
static |
Current version of Showcase core.
|
static |
| std::shared_ptr< WidgetInstance > Showcase::Showcase::widgetInstance | ( | Valuable::Node::Uuid | widgetId | ) |
Get a WidgetInstance for the given widget id.
Showcase keeps track of which widget instance matches widget ids.
| widgetId | id of the widget to query the instance for |