FOSSredder 0.5.0
Loading...
Searching...
No Matches
WorkspaceStore.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <QObject>
9#include <QString>
10
14
15namespace ui {
16
19
23class WorkspaceStore : public QObject {
24 Q_OBJECT
25
26public:
31 explicit WorkspaceStore(QObject* parent = nullptr);
32
40
46
51 void
53
59 return snapshot_;
60 }
61
66 QString currentPath() const;
67
72 int dataRevision() const noexcept {
73 return dataRevision_;
74 }
75
76signals:
78
79private:
80 friend class WorkspaceCommands;
81 friend class WorkspaceSelectors;
82
87 core::ports::workspace::IWorkspaceWriter* writer() const noexcept {
88 return writer_;
89 }
90
95 core::ports::workspace::IWorkspaceReader* reader() const noexcept {
96 return reader_;
97 }
98
102 void bumpDataRevision();
103
107 int dataRevision_ = 0;
108};
109
110} // namespace ui
Read-side workspace boundary that exposes immutable snapshots.
Write-side workspace boundary that accepts typed command models.
Immutable workspace read-model snapshot exposed through workspace ports.
Write-side workspace boundary for persistence, CRUD, drafts, and logs.
Maps UI intent to core workspace writer commands.
Projects workspace store data into QML-facing read models.
WorkspaceStore(QObject *parent=nullptr)
Creates an empty workspace store.
void setWorkspacePorts(core::ports::workspace::IWorkspaceWriter *writer, core::ports::workspace::IWorkspaceReader *reader)
Binds core workspace ports used by workspace roles.
void applyDeletionImpact(const core::ports::workspace::DeletionImpact &impact)
Applies deletion side effects to the stored snapshot.
void dataRevisionChanged()
friend class WorkspaceSelectors
int dataRevision() const noexcept
Returns the current data revision.
const core::ports::workspace::WorkspaceSnapshot & snapshot() const noexcept
Returns the current snapshot.
friend class WorkspaceCommands
QString currentPath() const
Returns the current workspace path.
void loadFromState(const core::ports::workspace::WorkspaceSnapshot &snapshot)
Loads a fresh workspace snapshot.