Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
IConfigStore.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include "VirtualScreen.h"
7#include "phosphorscreenscore_export.h"
8
9#include <QHash>
10#include <QObject>
11#include <QString>
12
13namespace Phosphor::Screens {
14
36class PHOSPHORSCREENSCORE_EXPORT IConfigStore : public QObject
37{
38 Q_OBJECT
39public:
40 explicit IConfigStore(QObject* parent = nullptr)
41 : QObject(parent)
42 {
43 }
44 ~IConfigStore() override = default;
45
50 virtual QHash<QString, VirtualScreenConfig> loadAll() const = 0;
51
56 virtual VirtualScreenConfig get(const QString& physicalScreenId) const = 0;
57
63 virtual bool save(const QString& physicalScreenId, const VirtualScreenConfig& config) = 0;
64
77 virtual bool remove(const QString& physicalScreenId) = 0;
78
79Q_SIGNALS:
85 void changed();
86};
87
88} // namespace Phosphor::Screens
Pluggable persistence for virtual-screen configurations.
Definition IConfigStore.h:37
~IConfigStore() override=default
virtual VirtualScreenConfig get(const QString &physicalScreenId) const =0
Single-key read for callers that only need one entry (e.g.
virtual QHash< QString, VirtualScreenConfig > loadAll() const =0
Snapshot every persisted virtual-screen config, keyed by physical screen ID.
void changed()
Some entry in the store has changed (via this interface or by an external writer — KCM,...
virtual bool save(const QString &physicalScreenId, const VirtualScreenConfig &config)=0
Persist config for physicalScreenId.
virtual bool remove(const QString &physicalScreenId)=0
Drop the entry for physicalScreenId.
IConfigStore(QObject *parent=nullptr)
Definition IConfigStore.h:40
Definition IWindowTrackingService.h:26
Configuration for how a physical screen is subdivided into virtual screens.
Definition VirtualScreen.h:124