swift
Loading...
Searching...
No Matches
swift::core::context::CContextApplicationProxy Class Reference

Application context proxy. More...

#include <contextapplicationproxy.h>

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

Public Slots

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

 ~CContextApplicationProxy ()=default
 Destructor.
Public Member Functions inherited from swift::core::context::IContextApplication
QString getPathAndContextId () const
 Id and path name for round trip protection.
 ~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?
CCoreFacade * getRuntime ()
 Runtime.
const CCoreFacade * getRuntime () const
 Const runtime.
CCoreFacadeConfig::ContextMode getMode () const
 Mode.
qint64 getUniqueId () const
 Unique id.
const IContextApplication * getIContextApplication () const
 Context for application.
IContextApplication * getIContextApplication ()
 Application.
IContextAudio * getIContextAudio ()
 Context for network.
const IContextAudio * getIContextAudio () const
 Context for network.
IContextNetwork * getIContextNetwork ()
 Context for network.
const IContextNetwork * getIContextNetwork () const
 Context for network.
IContextOwnAircraft * getIContextOwnAircraft ()
 Context for own aircraft.
const IContextOwnAircraft * getIContextOwnAircraft () const
 Context for own aircraft.
const IContextSimulator * getIContextSimulator () const
 Context for simulator.
IContextSimulator * getIContextSimulator ()
 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.
Public Member Functions inherited from QObject
QBindable< QString > bindableObjectName ()
 QObject (QObject *parent)
 QT_NO_CONTEXTLESS_CONNECT QT_NO_CONTEXTLESS_CONNECT
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 Q_CLASSINFO (Name, Value)
 Q_EMIT Q_EMIT
 Q_ENUM (...)
 Q_ENUMS (...)
 Q_ENUM_NS (...)
 Q_FLAG (...)
 Q_FLAGS (...)
 Q_FLAG_NS (...)
 Q_GADGET Q_GADGET
 Q_GADGET_EXPORT (EXPORT_MACRO)
 Q_INTERFACES (...)
 Q_INVOKABLE Q_INVOKABLE
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 Q_NAMESPACE Q_NAMESPACE
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 Q_OBJECT Q_OBJECT
 Q_PROPERTY (...)
 Q_REVISION Q_REVISION
 Q_SET_OBJECT_NAME (Object)
 Q_SIGNAL Q_SIGNAL
 Q_SIGNALS Q_SIGNALS
 Q_SLOT Q_SLOT
 Q_SLOTS Q_SLOTS
T qobject_cast (QObject *object)
T qobject_cast (const QObject *object)
bool blockSignals (bool block)
virtual bool event (QEvent *e)
virtual bool eventFilter (QObject *watched, QEvent *event)
bool moveToThread (QThread *targetThread)
bool setProperty (const char *name, QVariant &&value)
bool setProperty (const char *name, const QVariant &value)
int startTimer (int interval, Qt::TimerType timerType)
int startTimer (std::chrono::nanoseconds interval, Qt::TimerType timerType)
void deleteLater ()
void destroyed (QObject *obj)
void installEventFilter (QObject *filterObj)
void killTimer (Qt::TimerId id)
void killTimer (int id)
void objectNameChanged (const QString &objectName)
void removeEventFilter (QObject *obj)
void setObjectName (QAnyStringView name)
void setObjectName (const QString &name)
void setParent (QObject *parent)
QList< QByteArray > dynamicPropertyNames () const const
QList< T > findChildren (QAnyStringView name, Qt::FindChildOptions options) const const
QList< T > findChildren (Qt::FindChildOptions options) const const
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
QObject * parent () const const
QString objectName () const const
QThread * thread () const const
QVariant property (const char *name) const const
T findChild (QAnyStringView name, Qt::FindChildOptions options) const const
T findChild (Qt::FindChildOptions options) const const
bool disconnect (const QObject *receiver, const char *method) const const
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
bool inherits (const char *className) const const
bool isQmlExposed () const const
bool isQuickItemType () const const
bool isWidgetType () const const
bool isWindowType () const const
bool signalsBlocked () const const
virtual const QMetaObject * metaObject () const const
const QObjectList & children () const const
void dumpObjectInfo () const const
void dumpObjectTree () const const

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.
Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
virtual void connectNotify (const QMetaMethod &signal)
virtual void customEvent (QEvent *event)
virtual void disconnectNotify (const QMetaMethod &signal)
virtual void timerEvent (QTimerEvent *event)
QObject * sender () const const
bool isSignalConnected (const QMetaMethod &signal) const const
int receivers (const char *signal) const const
int senderSignalIndex () const const

Friends

class IContextApplication

Additional Inherited Members

Public Types inherited from QObject
enum  TimerId
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.
void hotkeyActionsRegistered (const QStringList &actions, const swift::misc::CIdentifier &origin)
 New action was registered.
void remoteHotkeyAction (const QString &action, bool argument, const swift::misc::CIdentifier &origin)
 Call a hotkey action on a remote process.
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 IContextApplication * create (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 Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString tr (const char *sourceText, const char *disambiguation, int n)
bool disconnect (const QMetaObject::Connection &connection)
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
Public Attributes inherited from QObject
typedef QObjectList
 Invalid
Static Protected Member Functions inherited from swift::core::context::IContext
static const misc::CStatusMessage & statusMessageEmptyContext ()
 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
Properties inherited from QObject
 objectName

Detailed Description

Application context proxy.

Definition at line 37 of file contextapplicationproxy.h.

Constructor & Destructor Documentation

◆ CContextApplicationProxy() [1/2]

swift::core::context::CContextApplicationProxy::CContextApplicationProxy ( CCoreFacadeConfig::ContextMode mode,
CCoreFacade * runtime )
inlineprotected

Constructor.

Definition at line 98 of file contextapplicationproxy.h.

◆ CContextApplicationProxy() [2/2]

swift::core::context::CContextApplicationProxy::CContextApplicationProxy ( const QString & serviceName,
QDBusConnection & connection,
CCoreFacadeConfig::ContextMode mode,
CCoreFacade * runtime )
protected

DBus version constructor.

Definition at line 22 of file contextapplicationproxy.cpp.

Member Function Documentation

◆ callHotkeyActionRemotely

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

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 117 of file contextapplicationproxy.cpp.

◆ changeSettings

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

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
slot

Get all settings currently in core settings cache.

Definition at line 66 of file contextapplicationproxy.cpp.

◆ getApplicationIdentifier

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

Identifier of application, remote side if distributed.

Definition at line 145 of file contextapplicationproxy.cpp.

◆ getRegisteredApplications

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

All registered applications.

Definition at line 140 of file contextapplicationproxy.cpp.

◆ getUnsavedSettingsKeys

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

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
slot

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 167 of file contextapplicationproxy.cpp.

◆ loadSettings

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

Load core settings from disk.

Definition at line 107 of file contextapplicationproxy.cpp.

◆ registerApplication

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

Register application, can also be used for ping.

Definition at line 123 of file contextapplicationproxy.cpp.

◆ registerHotkeyActions

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

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 112 of file contextapplicationproxy.cpp.

◆ saveSettings

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

Save core settings to disk.

Definition at line 97 of file contextapplicationproxy.cpp.

◆ saveSettingsByKey

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

Save core settings to disk.

Definition at line 102 of file contextapplicationproxy.cpp.

◆ synchronizeLocalSettings

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

Update local settings with settings from core.

Definition at line 91 of file contextapplicationproxy.cpp.

◆ unregisterApplication

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

Unregister application.

Definition at line 134 of file contextapplicationproxy.cpp.

◆ IContextApplication

friend class IContextApplication
friend

Definition at line 40 of file contextapplicationproxy.h.


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