Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
StagingDomain.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3#pragma once
4
5#include <QObject>
6#include <QString>
7#include <QtQml/qqmlregistration.h>
8
9#include "phosphorcontrol_export.h"
10
11namespace PhosphorControl {
12
29class PHOSPHORCONTROL_EXPORT StagingDomain : public QObject
30{
31 Q_OBJECT
32 Q_PROPERTY(bool dirty READ isDirty NOTIFY dirtyChanged)
33 QML_NAMED_ELEMENT(StagingDomain)
34 QML_UNCREATABLE("StagingDomain is an abstract base; subclass in C++.")
35
36public:
37 explicit StagingDomain(QObject* parent = nullptr);
38 ~StagingDomain() override;
39
40 // Pure virtual reader — QML accesses it via the `dirty` Q_PROPERTY
41 // (READ binding above) or imperatively as `domain.dirty`. No
42 // Q_INVOKABLE: that would register a duplicate metaobject entry
43 // covering the same getter (the property accessor moc already
44 // generates one). Keep the signal/slot/invokable surface minimal.
45 virtual bool isDirty() const = 0;
46
47public Q_SLOTS:
53 virtual void apply() = 0;
54
58 virtual void discard() = 0;
59
63 virtual void resetToDefaults();
64
65Q_SIGNALS:
89 void applyResult(bool ok, const QString& error);
94 void discardResult(bool ok, const QString& error);
95};
96
97} // namespace PhosphorControl
virtual bool isDirty() const =0
StagingDomain(QObject *parent=nullptr)
virtual void resetToDefaults()
Load factory defaults into the staged area.
virtual void apply()=0
Persist staged changes to the backing store.
void applyResult(bool ok, const QString &error)
Async-completion signal — REQUIRED for use with ApplicationController::applyAllAsync.
void discardResult(bool ok, const QString &error)
Companion to applyResult for discard() — separate signal so the chrome can wire distinct user-visible...
virtual void discard()=0
Drop staged changes; reload from the backing store.
Definition ApplicationController.h:21