Loading...
Searching...
No Matches
lib/core/view/Window.hpp
1#pragma once
2
3#include <score/model/Identifier.hpp>
4#include <score/widgets/MarginLess.hpp>
5
6#include <core/document/Document.hpp>
7
8#include <QActionGroup>
9#include <QMainWindow>
10#include <QPair>
11#include <QStackedWidget>
12#include <QString>
13#include <QVBoxLayout>
14
15#include <score_lib_base_export.h>
16
17#include <vector>
18#include <verdigris>
19
20class QCloseEvent;
21class QDockWidget;
22class QEvent;
23class QSplitter;
24class QObject;
25class QTabWidget;
26class QLabel;
27namespace score
28{
29struct PanelStatus;
30class FixedTabWidget;
31class DocumentModel;
32class DocumentView;
33class PanelView;
34class PanelDelegate;
35class Presenter;
36struct ApplicationContext;
40class SCORE_LIB_BASE_EXPORT View final : public QMainWindow
41{
42 W_OBJECT(View)
43public:
44 explicit View(QObject* parent);
45 ~View() override;
46
47 void setPresenter(Presenter*);
48
49 void addDocumentView(score::DocumentView*);
50 void setupPanel(PanelDelegate* v);
51
52 void closeDocument(score::DocumentView* doc);
53 void restoreLayout();
54 void closeEvent(QCloseEvent*) override;
55 void allPanelsAdded();
56
57 void addTopToolbar(QToolBar* b);
58
59public:
60 void activeDocumentChanged(const Id<DocumentModel>& arg_1)
61 E_SIGNAL(SCORE_LIB_BASE_EXPORT, activeDocumentChanged, arg_1)
62 void closeRequested(const Id<DocumentModel>& arg_1)
63 E_SIGNAL(SCORE_LIB_BASE_EXPORT, closeRequested, arg_1)
64
65 void ready() E_SIGNAL(SCORE_LIB_BASE_EXPORT, ready)
66 void sizeChanged(QSize arg_1) E_SIGNAL(SCORE_LIB_BASE_EXPORT, sizeChanged, arg_1)
67
68public:
69 void on_fileNameChanged(DocumentView* d, const QString& newName);
70 W_SLOT(on_fileNameChanged);
71
72 QWidget* centralDocumentWidget{};
73 QSplitter* rightSplitter{};
74 QWidget* topleftToolbar{};
75 FixedTabWidget* leftTabs{};
76 // QTabWidget* rightTabs{};
77 FixedTabWidget* bottomTabs{};
78 QTabWidget* centralTabs{};
79 QWidget* transportBar{};
80
81private:
82 bool event(QEvent* event) override;
83 void changeEvent(QEvent*) override;
84 void resizeEvent(QResizeEvent*) override;
85
86 ossia::hash_map<QWidget*, DocumentView*> m_documents;
87 std::vector<QPair<PanelDelegate*, QWidget*>> m_leftPanels;
88 std::vector<QPair<PanelDelegate*, QWidget*>> m_rightPanels;
89
90 Presenter* m_presenter{};
91 QLabel* m_status{};
92};
93
94}
The id_base_t class.
Definition Identifier.hpp:57
The DocumentView class shows a document.
Definition DocumentView.hpp:19
Definition FixedTabWidget.hpp:18
The PanelDelegate class.
Definition PanelDelegate.hpp:50
The Presenter class.
Definition lib/core/presenter/Presenter.hpp:36
The main display of the application.
Definition lib/core/view/Window.hpp:41
Base toolkit upon which the software is built.
Definition Application.cpp:90