2 #include <score/document/DocumentContext.hpp>
3 #include <score/locking/ObjectLocker.hpp>
4 #include <score/selection/FocusManager.hpp>
5 #include <score/selection/SelectionStack.hpp>
7 #include <core/command/CommandStack.hpp>
8 #include <core/document/DocumentBackups.hpp>
9 #include <core/document/DocumentMetadata.hpp>
11 #include <ossia/detail/json.hpp>
24 class DocumentBackupManager;
26 #include <score/model/Identifier.hpp>
28 #include <score_lib_base_export.h>
32 using JsonWriter = ossia::json_writer;
34 class DocumentDelegateFactory;
36 class DocumentPresenter;
50 class SCORE_LIB_BASE_EXPORT
Document final :
public QObject
59 void blockAllSignals();
66 CommandStack& commandStack() noexcept {
return m_commandStack; }
68 SelectionStack& selectionStack() noexcept {
return m_selectionStack; }
70 FocusManager& focusManager() noexcept {
return m_focus; }
72 ObjectLocker& locker() noexcept {
return m_objectLocker; }
85 QByteArray saveDocumentModelAsByteArray();
88 QByteArray saveAsByteArray();
94 return m_virgin && !m_commandStack.canUndo() && !m_commandStack.canRedo();
110 QWidget* parentview, QObject* parent);
118 const QString& name,
const QByteArray& data, SerializationIdentifier format,
124 QWidget* parentview, QObject* parent);
128 const QString& fileName,
const QByteArray& data, SerializationIdentifier format,
139 QTimer m_documentCoarseUpdateTimer;
144 DocumentModel* m_model{};
145 DocumentView* m_view{};
146 DocumentPresenter* m_presenter{};
148 DocumentBackupManager* m_backupMgr{};
150 DocumentContext m_context;
152 std::optional<score::RestorableDocument> m_initialData{};
153 bool m_virgin{
false};
160 Q_DECLARE_METATYPE(rapidjson::Value*)
Definition: JSONVisitor.hpp:52
The OngoingCommandDispatcher class.
Definition: OngoingCommandDispatcher.hpp:27
The id_base_t class.
Definition: Identifier.hpp:57
A small abstraction layer over the score::CommandStack.
Definition: CommandStackFacade.hpp:20
Definition: CommandStack.hpp:26
Handles document backup to allow restoring if there is a crash.
Definition: DocumentBackupManager.hpp:36
Methods to set-up documents.
Definition: DocumentBuilder.hpp:27
Used to provide custom document types.
Definition: DocumentDelegateFactory.hpp:26
The Document class is the central part of the software.
Definition: Document.hpp:51
bool virgin() const
Definition: Document.hpp:92
Model part of a document.
Definition: DocumentModel.hpp:29
Interface between the DocumentModel and the DocumentView.
Definition: DocumentPresenter.hpp:20
The DocumentView class shows a document.
Definition: DocumentView.hpp:19
The ObjectLocker class.
Definition: ObjectLocker.hpp:21
The SelectionStack class.
Definition: SelectionStack.hpp:24
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Definition: DocumentContext.hpp:18
Definition: FocusManager.hpp:9
Definition: DocumentBackups.hpp:14