SILICON
Loading...
Searching...
No Matches
ProjectDocumentController Class Reference

#include <projectDocumentController.hpp>

Inheritance diagram for ProjectDocumentController:
Collaboration diagram for ProjectDocumentController:

Signals

void activeDocumentChanged (const QString &path, SILICON::project::DocumentCategory category)
 Emitted after a document was loaded and made visible.
void projectDocumentsChanged ()
 Emitted when the set of project documents was added to, changed, or removed.

Public Member Functions

 ProjectDocumentController (ProjectSession &session, EditorWorkspace &workspace, ProjectTree &tree, ComponentCatalogOverlay &catalog, QUndoStack &undoStack, QWidget *dialogParent)
const std::string & currentDocumentPath () const noexcept override
bool activateDocument (const std::string &path) override
bool switchToDocument (const std::string &path, bool selectInTree)
void selectDocument (const std::string &path)
void rebuildTree ()
void notifyActiveDocumentActivated ()
 Publishes the active document to observers.
void restoreProjectDocuments (const std::vector< SILICON::project::Document > &documents, const std::string &activePath)
void removeDocument (const std::string &path)
void insertDocument (SILICON::project::Document document, std::optional< std::ptrdiff_t > insertAt, bool activate)
void showArchitectureTabContextMenu (const QPoint &position)
void createCircuit ()
void createCodeFile ()
void createBinaryFile ()
void createArchitecture ()
void importProjectDocument ()
void exportSelectedDocument ()
void renameSelectedDocument ()
void deleteSelectedDocument ()
void convertActiveDocument ()
Public Member Functions inherited from DocumentNavigator
virtual ~DocumentNavigator ()=default

Private Member Functions

void createDocument (SILICON::project::DocumentType type)
void pushCreateDocumentCommand (SILICON::project::Document document, const QString &commandText)
void pushDocumentSnapshotCommand (QString commandText, std::vector< SILICON::project::Document > before, std::string beforeActive, std::vector< SILICON::project::Document > after, std::string afterActive)
void renameArchitecture (const std::string &name)
void deleteArchitecture (const std::string &name)
void deleteArchitectureComponent (const std::string &path)
void removeProjectDocuments (const std::vector< std::string > &paths, const QString &commandText)
void commitDocumentChanges (std::vector< SILICON::project::Document > documents, const std::string &sourcePath, const std::string &activatePath, const QString &commandText, const QString &errorTitle)
void convertActiveDocumentTo (SILICON::project::DocumentType target)
void reportLoadFailure (SILICON::project::DocumentType type, const std::string &reason)
 Reports a rejected document activation to the user.

Private Attributes

ProjectSession & session
EditorWorkspace & workspace
ProjectTree * projectTree
ComponentCatalogOverlay & catalog
QUndoStack * undoStack
QWidget * dialogParent

Detailed Description

Coordinates document activation, editor payloads, and project tree state.

Definition at line 35 of file projectDocumentController.hpp.

Constructor & Destructor Documentation

◆ ProjectDocumentController()

ProjectDocumentController ( ProjectSession & session,
EditorWorkspace & workspace,
ProjectTree & tree,
ComponentCatalogOverlay & catalog,
QUndoStack & undoStack,
QWidget * dialogParent )

Definition at line 32 of file projectDocumentController.cpp.

Member Function Documentation

◆ activateDocument()

bool activateDocument ( const std::string & path)
overridevirtual

Implements DocumentNavigator.

Definition at line 50 of file projectDocumentController.cpp.

◆ activeDocumentChanged

void activeDocumentChanged ( const QString & path,
SILICON::project::DocumentCategory category )
signal

Emitted after a document was loaded and made visible.

Never emitted for a rejected document, so receivers can rely on the editor showing path when they react to it.

Parameters
pathProject path of the active document
categoryEditor category that now owns the document

◆ commitDocumentChanges()

void commitDocumentChanges ( std::vector< SILICON::project::Document > documents,
const std::string & sourcePath,
const std::string & activatePath,
const QString & commandText,
const QString & errorTitle )
private

Definition at line 455 of file projectDocumentActions.cpp.

◆ convertActiveDocument()

void convertActiveDocument ( )

Definition at line 199 of file projectDocumentConversion.cpp.

◆ convertActiveDocumentTo()

void convertActiveDocumentTo ( SILICON::project::DocumentType target)
private

Definition at line 234 of file projectDocumentConversion.cpp.

◆ createArchitecture()

void createArchitecture ( )

Definition at line 47 of file projectArchitectureActions.cpp.

◆ createBinaryFile()

void createBinaryFile ( )

Definition at line 186 of file projectDocumentActions.cpp.

◆ createCircuit()

void createCircuit ( )

Definition at line 126 of file projectDocumentActions.cpp.

◆ createCodeFile()

void createCodeFile ( )

Definition at line 131 of file projectDocumentActions.cpp.

◆ createDocument()

void createDocument ( SILICON::project::DocumentType type)
private

Definition at line 241 of file projectDocumentActions.cpp.

◆ currentDocumentPath()

const std::string & currentDocumentPath ( ) const
nodiscardoverridevirtualnoexcept

Implements DocumentNavigator.

Definition at line 45 of file projectDocumentController.cpp.

◆ deleteArchitecture()

void deleteArchitecture ( const std::string & name)
private

Definition at line 173 of file projectArchitectureActions.cpp.

◆ deleteArchitectureComponent()

void deleteArchitectureComponent ( const std::string & path)
private

Definition at line 102 of file projectArchitectureActions.cpp.

◆ deleteSelectedDocument()

void deleteSelectedDocument ( )

Definition at line 385 of file projectDocumentActions.cpp.

◆ exportSelectedDocument()

void exportSelectedDocument ( )

Definition at line 99 of file projectDocumentActions.cpp.

◆ importProjectDocument()

void importProjectDocument ( )

Definition at line 73 of file projectDocumentActions.cpp.

◆ insertDocument()

void insertDocument ( SILICON::project::Document document,
std::optional< std::ptrdiff_t > insertAt,
bool activate )

Definition at line 201 of file projectDocumentController.cpp.

◆ notifyActiveDocumentActivated()

void notifyActiveDocumentActivated ( )

Publishes the active document to observers.

Callers that load a document into the workspace themselves use this to announce the resulting activation.

Definition at line 96 of file projectDocumentController.cpp.

◆ projectDocumentsChanged

void projectDocumentsChanged ( )
signal

Emitted when the set of project documents was added to, changed, or removed.

◆ pushCreateDocumentCommand()

void pushCreateDocumentCommand ( SILICON::project::Document document,
const QString & commandText )
private

Definition at line 55 of file projectDocumentActions.cpp.

◆ pushDocumentSnapshotCommand()

void pushDocumentSnapshotCommand ( QString commandText,
std::vector< SILICON::project::Document > before,
std::string beforeActive,
std::vector< SILICON::project::Document > after,
std::string afterActive )
private

Definition at line 263 of file projectDocumentActions.cpp.

◆ rebuildTree()

void rebuildTree ( )

Definition at line 223 of file projectDocumentController.cpp.

◆ removeDocument()

void removeDocument ( const std::string & path)

Definition at line 182 of file projectDocumentController.cpp.

◆ removeProjectDocuments()

void removeProjectDocuments ( const std::vector< std::string > & paths,
const QString & commandText )
private

Definition at line 334 of file projectDocumentActions.cpp.

◆ renameArchitecture()

void renameArchitecture ( const std::string & name)
private

Definition at line 117 of file projectArchitectureActions.cpp.

◆ renameSelectedDocument()

void renameSelectedDocument ( )

Definition at line 278 of file projectDocumentActions.cpp.

◆ reportLoadFailure()

void reportLoadFailure ( SILICON::project::DocumentType type,
const std::string & reason )
private

Reports a rejected document activation to the user.

Definition at line 110 of file projectDocumentController.cpp.

◆ restoreProjectDocuments()

void restoreProjectDocuments ( const std::vector< SILICON::project::Document > & documents,
const std::string & activePath )

Definition at line 64 of file projectDocumentController.cpp.

◆ selectDocument()

void selectDocument ( const std::string & path)

Definition at line 105 of file projectDocumentController.cpp.

◆ showArchitectureTabContextMenu()

void showArchitectureTabContextMenu ( const QPoint & position)

Definition at line 74 of file projectArchitectureActions.cpp.

◆ switchToDocument()

bool switchToDocument ( const std::string & path,
bool selectInTree )

Definition at line 120 of file projectDocumentController.cpp.

Member Data Documentation

◆ catalog

ComponentCatalogOverlay& catalog
private

Definition at line 116 of file projectDocumentController.hpp.

◆ dialogParent

QWidget* dialogParent
private

Definition at line 118 of file projectDocumentController.hpp.

◆ projectTree

ProjectTree* projectTree
private

Definition at line 115 of file projectDocumentController.hpp.

◆ session

ProjectSession& session
private

Definition at line 113 of file projectDocumentController.hpp.

◆ undoStack

QUndoStack* undoStack
private

Definition at line 117 of file projectDocumentController.hpp.

◆ workspace

EditorWorkspace& workspace
private

Definition at line 114 of file projectDocumentController.hpp.


The documentation for this class was generated from the following files: