swift
Loading...
Searching...
No Matches
contextapplicationimpl.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_IMPL_H
7#define SWIFT_CORE_CONTEXT_CONTEXTAPPLICATION_IMPL_H
8
9#include <QObject>
10#include <QString>
11#include <QStringList>
12
16#include "misc/identifiable.h"
17#include "misc/identifierlist.h"
18#include "misc/statusmessage.h"
19#include "misc/valuecache.h"
20
21// clazy:excludeall=const-signal-or-slot
22
23namespace swift::misc
24{
25 class CDBusServer;
26}
27
28namespace swift::core
29{
30 class CCoreFacade;
31 namespace context
32 {
34 class SWIFT_CORE_EXPORT CContextApplication : public IContextApplication, public swift::misc::CIdentifiable
35 {
38 friend class swift::core::CCoreFacade;
39 friend class IContextApplication;
40
41 public slots:
44 const swift::misc::CIdentifier &origin) override;
45
48
50 QStringList getUnsavedSettingsKeys() const override;
51
54
56 void synchronizeLocalSettings() override;
57
59 swift::misc::CStatusMessage saveSettings(const QString &keyPrefix = {}) override;
60
63
66
68 void registerHotkeyActions(const QStringList &actions, const swift::misc::CIdentifier &origin) override;
69
71 void callHotkeyActionRemotely(const QString &action, bool argument,
72 const swift::misc::CIdentifier &origin) override;
73
76
78 void unregisterApplication(const swift::misc::CIdentifier &application) override;
79
82
85
86 protected:
88 CContextApplication(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime);
89
90 private:
91 swift::misc::CIdentifierList m_registeredApplications;
92
94 void cleanupRegisteredApplications();
95 };
96 } // namespace context
97} // namespace swift::core
98#endif // SWIFT_CORE_CONTEXT_CONTEXTAPPLICATION_IMPL_H
ContextMode
How to handle a given context.
The class providing facades (the contexts) for all DBus relevant operations.
Definition corefacade.h:57
void callHotkeyActionRemotely(const QString &action, bool argument, const swift::misc::CIdentifier &origin)
Call a hotkey action on a remote process.
swift::misc::CStatusMessage loadSettings()
Load core settings from disk.
void unregisterApplication(const swift::misc::CIdentifier &application)
Unregister application.
swift::misc::CValueCachePacket getAllSettings() const
Get all settings currently in core settings cache.
swift::misc::CStatusMessage saveSettings(const QString &keyPrefix={})
Save core settings to disk.
swift::misc::CIdentifier getApplicationIdentifier() const
Identifier of application, remote side if distributed.
swift::misc::CStatusMessage saveSettingsByKey(const QStringList &keys)
Save core settings to disk.
void registerHotkeyActions(const QStringList &actions, const swift::misc::CIdentifier &origin)
Register hotkey action implemented by another process.
CContextApplication(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime)
Constructor.
void synchronizeLocalSettings()
Update local settings with settings from core.
void changeSettings(const swift::misc::CValueCachePacket &settings, const swift::misc::CIdentifier &origin)
Ratify some settings changed by another process.
QStringList getUnsavedSettingsKeys() const
Get keys of all unsaved settings currently in core settings cache.
swift::misc::CIdentifierList getRegisteredApplications() const
All registered applications.
swift::misc::CIdentifier registerApplication(const swift::misc::CIdentifier &application)
Register application, can also be used for ping.
swift::core::context::CSettingsDictionary getUnsavedSettingsKeysDescribed() const
Get keys and descriptions of all unsaved settings currently in core settings cache.
Custom DBusServer.
Definition dbusserver.h:34
Base class with a member CIdentifier to be inherited by a class which has an identity in the environm...
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.
#define SWIFT_CORE_CONTEXTAPPLICATION_INTERFACENAME
DBus interface for context.
Backend services of the swift project, like dealing with the network or the simulators.
Definition actionbind.cpp:7
Free functions in swift::misc.
Q_CLASSINFO(Name, Value)
Q_OBJECTQ_OBJECT
#define SWIFT_CORE_EXPORT
Export a class or function from the library.