Molybden API
|
Provides access to Molybden app. More...
#include <app.hpp>
Public Member Functions | |
virtual const AppOptions & | options ()=0 |
Returns the app options. | |
virtual bool | isProduction ()=0 |
Indicates whether the app is running in the production or development mode. | |
virtual std::string | baseUrl ()=0 |
Returns the base URL of the resource that represents app user interface. | |
virtual std::string | name ()=0 |
Returns the current application name. | |
virtual std::string | version ()=0 |
Returns the current application version. | |
virtual std::string | copyright ()=0 |
Returns the current application copyright. | |
virtual std::string | description ()=0 |
Returns the current application description. | |
virtual std::string | getPath (PathKey key)=0 |
Returns absolute path to the directory specified by the given key or an empty string if there's no such path for the given key. | |
virtual void | restart ()=0 |
Restarts this application. | |
virtual void | quit ()=0 |
Terminates this app instance. | |
virtual std::shared_ptr< Desktop > | desktop ()=0 |
Returns the desktop instance that provides functionality related to the desktop environment. | |
virtual std::shared_ptr< Dock > | dock ()=0 |
Returns an object that allows working with the application icon in the Dock on macOS. | |
virtual std::shared_ptr< Profile > | profile ()=0 |
Returns the default app profile. | |
virtual std::shared_ptr< Profile > | profile (const std::string &name)=0 |
Returns the profile with the given name if it exists. | |
virtual std::vector< std::shared_ptr< Profile > > | profiles ()=0 |
Returns the list of the profiles in this app including the default profile. | |
virtual void | deleteProfile (std::shared_ptr< Profile > profile)=0 |
Deletes the given profile from the list of available profiles, closes all browsers associated with it, releases all allocated resources and files in the user data directory. | |
virtual std::vector< std::shared_ptr< Tray > > | trays ()=0 |
Returns the list of the available (non-destroyed) application trays. | |
virtual std::shared_ptr< Clipboard > | clipboard ()=0 |
Returns an object that allows working with the system clipboard. | |
virtual void | setMainMenu (std::shared_ptr< Menu > menu)=0 |
Sets the given menu as the application menu on macOS. | |
virtual void | setTheme (AppTheme theme)=0 |
Sets the given theme to the app. | |
virtual AppTheme | theme ()=0 |
Returns the application theme. | |
virtual std::shared_ptr< GlobalShortcuts > | globalShortcuts ()=0 |
Returns an object that allows registering global shortcuts. | |
Static Public Member Functions | |
static void | init (const std::function< void(std::shared_ptr< App > app)> &callback) |
Initializes this application and creates an application instance. | |
static void | init (const AppOptions &options, const std::function< void(std::shared_ptr< App > app)> &callback) |
Initializes this application and creates an application instance with the given options. | |
Provides access to Molybden app.
|
pure virtual |
Returns the current application copyright.
The application copyright is taken from the molybden.conf.json
file.
|
pure virtual |
Deletes the given profile from the list of available profiles, closes all browsers associated with it, releases all allocated resources and files in the user data directory.
When the profile is deleted, the cache files and preferences of the associated browsers are lost.
Does nothing if the given profile is already deleted or it is the default profile. The default profile cannot be deleted.
profile | profile to delete. |
|
pure virtual |
Returns the current application description.
The application description is taken from the molybden.conf.json
file.
|
pure virtual |
Returns an object that allows working with the application icon in the Dock on macOS.
On other platforms, returns a valid object, but each method of the object will do nothing.
|
pure virtual |
Returns the current application name.
The application name is taken from the molybden.conf.json
file.
|
pure virtual |
Returns the default app profile.
The type of the default profile is configured via the AppOptions::enable_incognito
property. If it is true, then the default profile will be an incognito profile, otherwise a regular profile.
|
pure virtual |
Returns the profile with the given name if it exists.
name | the profile name. |
|
pure virtual |
Terminates this app instance.
Closes all browser instances and releases the allocated resources.
|
pure virtual |
Restarts this application.
The new application instance will use the same working directory and the command line arguments as the current one.
|
pure virtual |
Sets the given theme to the app.
On macOS, the dark mode theme was introduced in 10.14 Mojave, so setting dark mode in 10.13 and lower changes only the web theme, the UI theme stays always light.
|
pure virtual |
Returns the application theme.
By default, the app theme is set to AppTheme::kSystem
.
|
pure virtual |
Returns the current application version.
The application version is taken from the molybden.conf.json
file. The returned string follows the major.minor.patch
format.