swift
Loading...
Searching...
No Matches
contextapplicationproxy.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#ifndef SWIFT_CORE_CONTEXT_CONTEXTAPPLICATION_PROXY_H
7#define SWIFT_CORE_CONTEXT_CONTEXTAPPLICATION_PROXY_H
8
9#include <QObject>
10#include <QSet>
11#include <QString>
12#include <QStringList>
13#include <QTimer>
14
18#include "misc/statusmessage.h"
19#include "misc/valuecache.h"
20
21// clazy:excludeall=const-signal-or-slot
22
23class QDBusConnection;
24
25namespace swift::misc
26{
28}
29
30namespace swift::core
31{
32 class CCoreFacade;
33 namespace context
34 {
37 class SWIFT_CORE_EXPORT CContextApplicationProxy : public IContextApplication
38 {
40 friend class IContextApplication;
41
42 public:
44 ~CContextApplicationProxy() override = default;
45
46 public slots:
49 const swift::misc::CIdentifier &origin) override;
50
53
55 QStringList getUnsavedSettingsKeys() const override;
56
59
61 void synchronizeLocalSettings() override;
62
64 swift::misc::CStatusMessage saveSettings(const QString &keyPrefix = {}) override;
65
67 swift::misc::CStatusMessage saveSettingsByKey(const QStringList &keys) override;
68
70 swift::misc::CStatusMessage loadSettings() override;
71
73 void registerHotkeyActions(const QStringList &actions, const swift::misc::CIdentifier &origin) override;
74
76 void callHotkeyActionRemotely(const QString &action, bool argument,
77 const swift::misc::CIdentifier &origin) override;
78
80 swift::misc::CIdentifier registerApplication(const swift::misc::CIdentifier &application) override;
81
83 void unregisterApplication(const swift::misc::CIdentifier &application) override;
84
86 swift::misc::CIdentifierList getRegisteredApplications() const override;
87
89 swift::misc::CIdentifier getApplicationIdentifier() const override;
90
94 static bool isContextResponsive(const QString &dbusAddress, QString &msg, int timeoutMs = 1500);
95
96 protected:
99 : IContextApplication(mode, runtime)
100 {}
101
103 CContextApplicationProxy(const QString &serviceName, QDBusConnection &connection,
105
106 private:
107 swift::misc::CGenericDBusInterface *m_dBusInterface = nullptr;
108 QSet<swift::misc::CIdentifier> m_proxyPingIdentifiers;
109 QTimer m_pingTimer;
110
112 void relaySignals(const QString &serviceName, QDBusConnection &connection);
113
115 void reRegisterApplications();
116
117 void processRemoteHotkeyActionCall(const QString &action, bool argument,
118 const swift::misc::CIdentifier &origin);
119 };
120 } // namespace context
121} // namespace swift::core
122
123#endif // SWIFT_CORE_CONTEXT_CONTEXTAPPLICATION_PROXY_H
ContextMode
How to handle a given context.
The class providing facades (the contexts) for all DBus relevant operations.
Definition corefacade.h:57
void changeSettings(const swift::misc::CValueCachePacket &settings, const swift::misc::CIdentifier &origin)
Ratify some settings changed by another process.
CContextApplicationProxy(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime)
Constructor.
QStringList getUnsavedSettingsKeys() const
Get keys of all unsaved settings currently in core settings cache.
swift::misc::CStatusMessage saveSettings(const QString &keyPrefix={})
Save core settings to disk.
void synchronizeLocalSettings()
Update local settings with settings from core.
swift::core::context::CSettingsDictionary getUnsavedSettingsKeysDescribed() const
Get keys and descriptions of all unsaved settings currently in core settings cache.
swift::misc::CValueCachePacket getAllSettings() const
Get all settings currently in core settings cache.
Used for hand written interface based on virtual methods.
Value object encapsulating information identifying a component of a modular distributed swift process...
Definition identifier.h:29
Value object encapsulating a list of object identifiers.
Streamable status message, e.g.
Value class used for signalling changed values in the cache.
Definition valuecache.h:67
swift::misc::CDictionary< QString, QString, QMap > CSettingsDictionary
Value type for settings keys with descriptions.
Backend services of the swift project, like dealing with the network or the simulators.
Definition actionbind.cpp:7
Free functions in swift::misc.
Q_OBJECTQ_OBJECT
#define SWIFT_CORE_EXPORT
Export a class or function from the library.