swift
Public Slots | Public Member Functions | Protected Member Functions | Friends | List of all members
swift::core::context::CContextApplicationProxy Class Reference

Application context proxy. More...

Inheritance diagram for swift::core::context::CContextApplicationProxy:
[legend]

Public Slots

virtual void changeSettings (const swift::misc::CValueCachePacket &settings, const swift::misc::CIdentifier &origin)
 Ratify some settings changed by another process. More...
 
virtual swift::misc::CValueCachePacket getAllSettings () const
 Get all settings currently in core settings cache. More...
 
virtual QStringList getUnsavedSettingsKeys () const
 Get keys of all unsaved settings currently in core settings cache. More...
 
virtual swift::core::context::CSettingsDictionary getUnsavedSettingsKeysDescribed () const
 Get keys and descriptions of all unsaved settings currently in core settings cache. More...
 
virtual void synchronizeLocalSettings ()
 Update local settings with settings from core. More...
 
virtual swift::misc::CStatusMessage saveSettings (const QString &keyPrefix={})
 Save core settings to disk. More...
 
virtual swift::misc::CStatusMessage saveSettingsByKey (const QStringList &keys)
 Save core settings to disk. More...
 
virtual swift::misc::CStatusMessage loadSettings ()
 Load core settings from disk. More...
 
virtual void registerHotkeyActions (const QStringList &actions, const swift::misc::CIdentifier &origin)
 Register hotkey action implemented by another process. More...
 
virtual void callHotkeyActionRemotely (const QString &action, bool argument, const swift::misc::CIdentifier &origin)
 Call a hotkey action on a remote process. More...
 
virtual swift::misc::CIdentifier registerApplication (const swift::misc::CIdentifier &application)
 Register application, can also be used for ping. More...
 
virtual void unregisterApplication (const swift::misc::CIdentifier &application)
 Unregister application. More...
 
virtual swift::misc::CIdentifierList getRegisteredApplications () const
 All registered applications. More...
 
virtual swift::misc::CIdentifier getApplicationIdentifier () const
 Identifier of application, remote side if distributed. More...
 
static bool isContextResponsive (const QString &dbusAddress, QString &msg, int timeoutMs=1500)
 Used to test if there is a core running? More...
 
- Public Slots inherited from swift::core::context::IContextApplication
virtual void changeSettings (const misc::CValueCachePacket &settings, const misc::CIdentifier &origin)
 Ratify some settings changed by another process. More...
 
virtual misc::CValueCachePacket getAllSettings () const =0
 Get all settings currently in core settings cache.
 
virtual QStringList getUnsavedSettingsKeys () const =0
 Get keys of all unsaved settings currently in core settings cache.
 
virtual CSettingsDictionary getUnsavedSettingsKeysDescribed () const =0
 Get keys and descriptions of all unsaved settings currently in core settings cache.
 
virtual void synchronizeLocalSettings ()=0
 Update local settings with settings from core.
 
virtual misc::CStatusMessage saveSettings (const QString &keyPrefix={})=0
 Save core settings to disk.
 
virtual misc::CStatusMessage saveSettingsByKey (const QStringList &keys)=0
 Save core settings to disk.
 
virtual misc::CStatusMessage loadSettings ()=0
 Load core settings from disk.
 
virtual void registerHotkeyActions (const QStringList &actions, const misc::CIdentifier &origin)
 Register hotkey action implemented by another process. More...
 
virtual void callHotkeyActionRemotely (const QString &action, bool argument, const misc::CIdentifier &origin)
 Call a hotkey action on a remote process. More...
 
virtual misc::CIdentifier registerApplication (const misc::CIdentifier &application)=0
 Register application, can also be used for ping.
 
virtual void unregisterApplication (const misc::CIdentifier &application)=0
 Unregister application.
 
virtual misc::CIdentifierList getRegisteredApplications () const =0
 All registered applications.
 
virtual misc::CIdentifier getApplicationIdentifier () const =0
 Identifier of application, remote side if distributed.
 
bool parseCommandLine (const QString &commandLine, const swift::misc::CIdentifier &originator)
 Forward to facade.
 

Public Member Functions

virtual ~CContextApplicationProxy ()
 Destructor.
 
- Public Member Functions inherited from swift::core::context::IContextApplication
QString getPathAndContextId () const
 Id and path name for round trip protection. More...
 
 ~IContextApplication ()=default
 Destructor.
 
- Public Member Functions inherited from swift::core::context::IContext
 ~IContext ()=default
 Destructor.
 
bool isUsingImplementingObject () const
 Using local implementing object?
 
bool isLocalObject () const
 Local or remote object?
 
bool isEmptyObject () const
 Empty object?
 
CCoreFacadegetRuntime ()
 Runtime.
 
const CCoreFacadegetRuntime () const
 Const runtime.
 
CCoreFacadeConfig::ContextMode getMode () const
 Mode.
 
qint64 getUniqueId () const
 Unique id.
 
const IContextApplicationgetIContextApplication () const
 Context for application.
 
IContextApplicationgetIContextApplication ()
 Application.
 
IContextAudiogetIContextAudio ()
 Context for network.
 
const IContextAudiogetIContextAudio () const
 Context for network.
 
IContextNetworkgetIContextNetwork ()
 Context for network.
 
const IContextNetworkgetIContextNetwork () const
 Context for network.
 
IContextOwnAircraftgetIContextOwnAircraft ()
 Context for own aircraft.
 
const IContextOwnAircraftgetIContextOwnAircraft () const
 Context for own aircraft.
 
const IContextSimulatorgetIContextSimulator () const
 Context for simulator.
 
IContextSimulatorgetIContextSimulator ()
 Simulator.
 
void setDebugEnabled (bool debug)
 Set debug flag.
 
bool isDebugEnabled () const
 Debug enabled?
 
virtual bool parseCommandLine (const QString &commandLine, const swift::misc::CIdentifier &originator)=0
 Parse a given command line.
 

Protected Member Functions

 CContextApplicationProxy (CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime)
 Constructor.
 
 CContextApplicationProxy (const QString &serviceName, QDBusConnection &connection, CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime)
 DBus version constructor.
 
- Protected Member Functions inherited from swift::core::context::IContextApplication
 IContextApplication (CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime)
 Constructor.
 
- Protected Member Functions inherited from swift::core::context::IContext
 IContext (CCoreFacadeConfig::ContextMode mode, QObject *parent)
 Constructor.
 
QString buildPathAndContextId (const QString &path) const
 Path and context id.
 
void relayBaseClassSignals (const QString &serviceName, QDBusConnection &connection, const QString &objectPath, const QString &interfaceName)
 Relay signals from this class.
 
void logEmptyContextWarning (const QString &functionName) const
 Empty context called.
 
virtual void onAboutToShutdown ()
 Called when shutdown is about to be called.
 
void registerWithDBus (const QString &objectPath, misc::CDBusServer *server)
 Register myself in DBus.
 

Friends

class IContextApplication
 

Additional Inherited Members

- Signals inherited from swift::core::context::IContextApplication
void registrationChanged ()
 A component changes.
 
void settingsChanged (const swift::misc::CValueCachePacket &settings, const swift::misc::CIdentifier &origin)
 One or more settings were changed. More...
 
void hotkeyActionsRegistered (const QStringList &actions, const swift::misc::CIdentifier &origin)
 New action was registered. More...
 
void remoteHotkeyAction (const QString &action, bool argument, const swift::misc::CIdentifier &origin)
 Call a hotkey action on a remote process. More...
 
- Signals inherited from swift::core::context::IContext
void changedLogOrDebugSettings ()
 Log or debug values changed.
 
- Static Public Member Functions inherited from swift::core::context::IContextApplication
static const QString & InterfaceName ()
 Service name.
 
static const QString & ObjectPath ()
 Service path.
 
static IContextApplicationcreate (CCoreFacade *parent, CCoreFacadeConfig::ContextMode mode, swift::misc::CDBusServer *server, QDBusConnection &connection)
 Factory method.
 
- Static Public Member Functions inherited from swift::core::context::IContext
static const QStringList & getLogCategories ()
 Log categories.
 
- Static Protected Member Functions inherited from swift::core::context::IContext
static const misc::CStatusMessagestatusMessageEmptyContext ()
 Standard message when status message is returned in empty context.
 
- Static Protected Attributes inherited from swift::core::context::IContextApplication
static constexpr int PingIdentifiersMs = 20000
 how often identifiers are pinged
 

Detailed Description

Application context proxy.

Definition at line 37 of file contextapplicationproxy.h.

Member Function Documentation

◆ callHotkeyActionRemotely

void swift::core::context::CContextApplicationProxy::callHotkeyActionRemotely ( const QString &  action,
bool  argument,
const swift::misc::CIdentifier origin 
)
virtualslot

Call a hotkey action on a remote process.

Note
Not pure because it can be called from the base class constructor.
This is the function which relays action calls via DBus

Definition at line 114 of file contextapplicationproxy.cpp.

◆ changeSettings

void swift::core::context::CContextApplicationProxy::changeSettings ( const swift::misc::CValueCachePacket settings,
const swift::misc::CIdentifier origin 
)
virtualslot

Ratify some settings changed by another process.

Note
Not pure because it can be called from the base class constructor.
This is the function which relays cache changes via DBus.

Definition at line 61 of file contextapplicationproxy.cpp.

◆ getAllSettings

swift::misc::CValueCachePacket swift::core::context::CContextApplicationProxy::getAllSettings ( ) const
virtualslot

Get all settings currently in core settings cache.

Definition at line 66 of file contextapplicationproxy.cpp.

◆ getApplicationIdentifier

CIdentifier swift::core::context::CContextApplicationProxy::getApplicationIdentifier ( ) const
virtualslot

Identifier of application, remote side if distributed.

Definition at line 139 of file contextapplicationproxy.cpp.

◆ getRegisteredApplications

swift::misc::CIdentifierList swift::core::context::CContextApplicationProxy::getRegisteredApplications ( ) const
virtualslot

All registered applications.

Definition at line 134 of file contextapplicationproxy.cpp.

◆ getUnsavedSettingsKeys

QStringList swift::core::context::CContextApplicationProxy::getUnsavedSettingsKeys ( ) const
virtualslot

Get keys of all unsaved settings currently in core settings cache.

Definition at line 71 of file contextapplicationproxy.cpp.

◆ getUnsavedSettingsKeysDescribed

CSettingsDictionary swift::core::context::CContextApplicationProxy::getUnsavedSettingsKeysDescribed ( ) const
virtualslot

Get keys and descriptions of all unsaved settings currently in core settings cache.

Definition at line 76 of file contextapplicationproxy.cpp.

◆ isContextResponsive

bool swift::core::context::CContextApplicationProxy::isContextResponsive ( const QString &  dbusAddress,
QString &  msg,
int  timeoutMs = 1500 
)
staticslot

Used to test if there is a core running?

Note
creates and connects via proxy object, so not meant for very frequent tests
See also
CDBusServer::isDBusAvailable as lightweight, but less accurate alternative

Definition at line 152 of file contextapplicationproxy.cpp.

◆ loadSettings

swift::misc::CStatusMessage swift::core::context::CContextApplicationProxy::loadSettings ( )
virtualslot

Load core settings from disk.

Definition at line 104 of file contextapplicationproxy.cpp.

◆ registerApplication

CIdentifier swift::core::context::CContextApplicationProxy::registerApplication ( const swift::misc::CIdentifier application)
virtualslot

Register application, can also be used for ping.

Definition at line 120 of file contextapplicationproxy.cpp.

◆ registerHotkeyActions

void swift::core::context::CContextApplicationProxy::registerHotkeyActions ( const QStringList &  actions,
const swift::misc::CIdentifier origin 
)
virtualslot

Register hotkey action implemented by another process.

Note
Not pure because it can be called from the base class constructor.
This is the function which relays action registrations via DBus

Definition at line 109 of file contextapplicationproxy.cpp.

◆ saveSettings

swift::misc::CStatusMessage swift::core::context::CContextApplicationProxy::saveSettings ( const QString &  keyPrefix = {})
virtualslot

Save core settings to disk.

Definition at line 94 of file contextapplicationproxy.cpp.

◆ saveSettingsByKey

swift::misc::CStatusMessage swift::core::context::CContextApplicationProxy::saveSettingsByKey ( const QStringList &  keys)
virtualslot

Save core settings to disk.

Definition at line 99 of file contextapplicationproxy.cpp.

◆ synchronizeLocalSettings

void swift::core::context::CContextApplicationProxy::synchronizeLocalSettings ( )
virtualslot

Update local settings with settings from core.

Definition at line 88 of file contextapplicationproxy.cpp.

◆ unregisterApplication

void swift::core::context::CContextApplicationProxy::unregisterApplication ( const swift::misc::CIdentifier application)
virtualslot

Unregister application.

Definition at line 128 of file contextapplicationproxy.cpp.


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