SILICON
Loading...
Searching...
No Matches
projectFileController.hpp
Go to the documentation of this file.
1/*
2 Copyright (c) 2026. Giulio Cocconi
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8 */
9
10#pragma once
11
12#include <functional>
13
14#include <QObject>
15
16class QByteArray;
17class QUndoStack;
18class QWidget;
19class QString;
20
21namespace SILICON::ui {
22
23class EditorWorkspace;
25struct ProjectSession;
26
28class ProjectFileController : public QObject {
29 Q_OBJECT
30
31public:
34 QWidget* dialogParent);
35
36 void newFile();
37 void open();
38 bool save();
39 void confirmSaveIfDirty(std::function<void()> continuation);
40 void resetProjectState();
41 void setFileName(const QString& fileName);
42
43signals:
45
46private:
47 void loadProjectContent(const QString& fileName, const QByteArray& fileContent);
48
52 QUndoStack& undoStack;
53 QWidget* dialogParent;
54};
55
56} // namespace SILICON::ui
Selects and hosts editors while preserving detached document preparation.
void confirmSaveIfDirty(std::function< void()> continuation)
void setFileName(const QString &fileName)
void loadProjectContent(const QString &fileName, const QByteArray &fileContent)
ProjectFileController(ProjectSession &session, EditorWorkspace &workspace, ProjectDocumentController &documents, QUndoStack &undoStack, QWidget *dialogParent)