Files
vpn-dns-gateway/demo/tikzrefinery/code/src/ui/tkrMainWindow.h
T
vsun1 27b82c169e
vpn-dns-gateway/pipeline/head This commit looks good
vpn-dns-gateway/pipeline/pr-main This commit looks good
Add frozen TikZRefinery demo baseline and build pipeline
2026-11-25 22:46:33 -05:00

50 lines
1.3 KiB
C++

#pragma once
#include "model/tkrTikzDocument.h"
#include <QMainWindow>
#include <memory>
class QAction;
class QCloseEvent;
class QPlainTextEdit;
namespace TikzRefinery {
class tkrDiagramScene;
class tkrDiagramView;
class tkrEditorController;
class tkrWorkspaceSidebar;
class tkrMainWindow final : public QMainWindow
{
Q_OBJECT
public:
explicit tkrMainWindow(QWidget *pParent = nullptr, const QString &strInitialFilePath = {});
~tkrMainWindow() override;
protected:
void closeEvent(QCloseEvent *pEvent) override;
private:
void openDocument();
bool saveDocument();
bool confirmDiscardOrSave();
void updateDocumentView();
// Reverse member destruction releases the controller before its document.
tkrTikzDocument m_document;
tkrDiagramScene *m_pScene = nullptr; // Owned by this window through QObject parenting.
tkrDiagramView *m_pView = nullptr;
tkrWorkspaceSidebar *m_pSidebar = nullptr; // Owned through the central widget's Qt parent tree.
QPlainTextEdit *m_pSourceView = nullptr;
QAction *m_pSaveAction = nullptr;
QAction *m_pUndoAction = nullptr;
QAction *m_pRedoAction = nullptr;
// No QObject parent: unique_ptr is this controller's single owning mechanism.
std::unique_ptr<tkrEditorController> m_upController;
};
} // namespace TikzRefinery