|
SILICON
|
Selects and hosts editors while preserving detached document preparation. More...
#include <editorWorkspace.hpp>
Classes | |
| class | PreparedDocument |
Signals | |
| void | activeEditorChanged () |
| void | historyStateChanged () |
| Emitted when the active editor's undo/redo availability may have changed. | |
| void | editStateChanged () |
| Emitted when the active editor's editing availability may have changed. | |
| void | editorCreated (DocumentEditor *editor) |
Public Member Functions | |
| EditorWorkspace (ProjectSession &session, QWidget *parent=nullptr) | |
| ~EditorWorkspace () override | |
| CircuitEditor & | circuitEditor () |
| DocumentEditor * | activeEditor () const noexcept |
| bool | hasUnsavedChanges () const |
| void | setProjectHistory (QUndoStack *history) noexcept |
| Applies the project-wide history shared by every hosted editor. | |
| EditorEditState | activeEditState () const |
| Which generic editing commands the active editor currently accepts. | |
| bool | canUndoActiveDocument () const |
| bool | canRedoActiveDocument () const |
| void | resetEditorDirtyState () noexcept |
| void | reset () |
| void | undoActiveDocument () |
| void | redoActiveDocument () |
| void | flushActiveDocument () |
| void | copyActiveDocument () |
| void | cutActiveDocument () |
| void | pasteActiveDocument () |
| void | deleteInActiveDocument () |
| void | zoomActiveDocument (bool in) |
| std::shared_ptr< PreparedDocument > | prepareDocument (const SILICON::project::Document &document) |
| void | activateDocument (const PreparedDocument &prepared) |
| void | loadDocument (const SILICON::project::Document &document) |
Private Member Functions | |
| DocumentEditor & | editorFor (SILICON::project::DocumentType type) |
| CodeDocumentEditor & | ensureCodeEditor () |
| BinaryDocumentEditor & | ensureBinaryEditor () |
| ArchitectureDocumentEditor & | ensureArchitectureEditor () |
| EditorNotifications | notifications () |
Private Attributes | |
| ProjectSession & | session |
| QStackedWidget * | stack |
| DocumentEditor * | activeDocumentEditor = nullptr |
| QUndoStack * | projectHistory = nullptr |
| std::unique_ptr< CircuitEditor > | circuit |
| std::unique_ptr< CodeDocumentEditor > | code |
| std::unique_ptr< BinaryDocumentEditor > | binary |
| std::unique_ptr< ArchitectureDocumentEditor > | architecture |
| CallbackScope | callbacks |
Selects and hosts editors while preserving detached document preparation.
Single source of truth for the active editor's action state: editor-local changes arrive through EditorNotifications, and the global clipboard is observed once here, so consumers only ever observe this workspace's signals.
Definition at line 39 of file editorWorkspace.hpp.
|
explicit |
Definition at line 35 of file editorWorkspace.cpp.
|
overridedefault |
| void activateDocument | ( | const PreparedDocument & | prepared | ) |
Definition at line 203 of file editorWorkspace.cpp.
|
inlinenodiscardnoexcept |
Definition at line 48 of file editorWorkspace.hpp.
|
signal |
|
nodiscard |
Which generic editing commands the active editor currently accepts.
Definition at line 130 of file editorWorkspace.cpp.
|
nodiscard |
Definition at line 143 of file editorWorkspace.cpp.
|
nodiscard |
Definition at line 139 of file editorWorkspace.cpp.
| CircuitEditor & circuitEditor | ( | ) |
Definition at line 57 of file editorWorkspace.cpp.
| void copyActiveDocument | ( | ) |
Definition at line 212 of file editorWorkspace.cpp.
| void cutActiveDocument | ( | ) |
Definition at line 217 of file editorWorkspace.cpp.
| void deleteInActiveDocument | ( | ) |
Definition at line 227 of file editorWorkspace.cpp.
|
signal |
|
nodiscardprivate |
Definition at line 94 of file editorWorkspace.cpp.
|
signal |
Emitted when the active editor's editing availability may have changed.
Aggregates the selection-driven and mode-driven changes reported by every hosted editor through EditorNotifications, plus the clipboard changes observed above, so observers never have to subscribe to an individual editor or to the clipboard.
|
private |
Definition at line 84 of file editorWorkspace.cpp.
|
private |
Definition at line 75 of file editorWorkspace.cpp.
|
private |
Definition at line 66 of file editorWorkspace.cpp.
| void flushActiveDocument | ( | ) |
Definition at line 181 of file editorWorkspace.cpp.
|
nodiscard |
Definition at line 134 of file editorWorkspace.cpp.
|
signal |
Emitted when the active editor's undo/redo availability may have changed.
Aggregates the history notifications of every hosted editor, of the project-wide undo stack, and of the architecture tabs, so observers never have to subscribe to an individual editor.
| void loadDocument | ( | const SILICON::project::Document & | document | ) |
Definition at line 232 of file editorWorkspace.cpp.
|
nodiscardprivate |
Definition at line 51 of file editorWorkspace.cpp.
| void pasteActiveDocument | ( | ) |
Definition at line 222 of file editorWorkspace.cpp.
|
nodiscard |
Definition at line 198 of file editorWorkspace.cpp.
| void redoActiveDocument | ( | ) |
Definition at line 176 of file editorWorkspace.cpp.
| void reset | ( | ) |
Definition at line 158 of file editorWorkspace.cpp.
|
noexcept |
Definition at line 147 of file editorWorkspace.cpp.
|
noexcept |
Applies the project-wide history shared by every hosted editor.
Replacing the history re-points every editor and drops the previous stack subscriptions; passing nullptr detaches the editors from any history.
Definition at line 105 of file editorWorkspace.cpp.
| void undoActiveDocument | ( | ) |
Definition at line 171 of file editorWorkspace.cpp.
| void zoomActiveDocument | ( | bool | in | ) |
Definition at line 236 of file editorWorkspace.cpp.
|
private |
Definition at line 114 of file editorWorkspace.hpp.
|
private |
Definition at line 119 of file editorWorkspace.hpp.
|
private |
Definition at line 118 of file editorWorkspace.hpp.
|
private |
Definition at line 120 of file editorWorkspace.hpp.
|
private |
Definition at line 116 of file editorWorkspace.hpp.
|
private |
Definition at line 117 of file editorWorkspace.hpp.
|
private |
Definition at line 115 of file editorWorkspace.hpp.
|
private |
Definition at line 112 of file editorWorkspace.hpp.
|
private |
Definition at line 113 of file editorWorkspace.hpp.