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 
20 class QCloseEvent;
21 class QDockWidget;
22 class QEvent;
23 class QSplitter;
24 class QObject;
25 class QTabWidget;
26 class QLabel;
27 namespace score
28 {
29 struct PanelStatus;
30 class FixedTabWidget;
31 class DocumentModel;
32 class DocumentView;
33 class PanelView;
34 class PanelDelegate;
35 class Presenter;
36 struct ApplicationContext;
40 class SCORE_LIB_BASE_EXPORT View final : public QMainWindow
41 {
42  W_OBJECT(View)
43 public:
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 
59 public:
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 
68 public:
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 
81 private:
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 }
Definition: ConsolePanel.hpp:36
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