DocumentPluginBase.hpp
1 #pragma once
2 #include <score/document/DocumentContext.hpp>
3 #include <score/model/IdentifiedObject.hpp>
4 #include <score/plugins/SerializableInterface.hpp>
6 
7 #include <QString>
8 
9 #include <vector>
10 
11 class QWidget;
12 namespace score
13 {
14 class Document;
15 }
16 
17 // TODO DocumentPlugin -> system
18 namespace score
19 {
23 class SCORE_LIB_BASE_EXPORT DocumentPlugin : public QObject
24 {
25  W_OBJECT(DocumentPlugin)
26 public:
27  DocumentPlugin(const score::DocumentContext&, const QString& name, QObject* parent);
28 
29  virtual ~DocumentPlugin();
30 
31  const score::DocumentContext& context() const { return m_context; }
32 
33  template <typename Impl>
34  explicit DocumentPlugin(const score::DocumentContext& ctx, Impl& vis, QObject* parent)
35  : QObject{parent}
36  , m_context{ctx}
37  {
38  }
39 
40  virtual void on_documentClosing();
41 
42 protected:
43  const score::DocumentContext& m_context;
44 };
45 
47 }
Reimplement to instantiate document plug-ins.
Definition: DocumentPluginCreator.hpp:25
Extend a document with custom data and systems.
Definition: DocumentPluginBase.hpp:24
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Definition: DocumentContext.hpp:18