score-lib-process/Process/ProcessFactory.hpp
1 #pragma once
2 #include <Process/ProcessMetadata.hpp>
3 #include <Process/TimeValue.hpp>
4 
5 #include <score/model/Identifier.hpp>
6 #include <score/plugins/Interface.hpp>
7 
8 #include <score_lib_process_export.h>
9 
10 class QGraphicsItem;
11 class QObject;
12 struct VisitorVariant;
13 namespace score
14 {
15 struct DocumentContext;
16 class ResizeableItem;
17 }
18 namespace Process
19 {
20 class LayerPresenter;
21 class HeaderDelegate;
22 class FooterDelegate;
23 class LayerView;
24 class MiniLayer;
25 class ProcessModel;
26 struct Preset;
27 struct Context;
28 
34 class SCORE_LIB_PROCESS_EXPORT ProcessModelFactory : public score::InterfaceBase
35 {
36  SCORE_INTERFACE(ProcessModel, "507ae654-f3b8-4aae-afc3-7ab8e1a3a86f")
37 public:
38  ~ProcessModelFactory() override;
39 
40  virtual QString prettyName() const noexcept = 0;
41  virtual QString category() const noexcept = 0;
42  virtual ProcessFlags flags() const noexcept = 0;
43  virtual Descriptor descriptor(QString) const noexcept = 0;
44 
45  virtual QString customConstructionData() const noexcept;
46 
47  virtual Process::ProcessModel* make(
48  const TimeVal& duration, const QString& data, const Id<ProcessModel>& id,
49  const score::DocumentContext& ctx, QObject* parent)
50  = 0;
51 
52  virtual Process::ProcessModel*
53  load(const VisitorVariant&, const score::DocumentContext& ctx, QObject* parent)
54  = 0;
55 };
56 
57 class SCORE_LIB_PROCESS_EXPORT LayerFactory : public score::InterfaceBase
58 {
59  SCORE_INTERFACE(ProcessModel, "aeee61e4-89aa-42ec-aa33-bf4522ed710b")
60 public:
61  static const constexpr bool ui_interface = true;
62  ~LayerFactory() override;
63 
64  virtual std::optional<double> recommendedHeight() const noexcept;
65 
66  virtual Process::LayerPresenter* makeLayerPresenter(
68  QObject* parent) const;
69 
70  virtual Process::LayerView* makeLayerView(
71  const Process::ProcessModel&, const Process::Context& context,
72  QGraphicsItem* parent) const;
73 
74  virtual Process::MiniLayer*
75  makeMiniLayer(const Process::ProcessModel&, QGraphicsItem* parent) const;
76 
77  virtual score::ResizeableItem* makeItem(
78  const Process::ProcessModel&, const Process::Context& ctx,
79  QGraphicsItem* parent) const;
80 
81  virtual bool hasExternalUI(
82  const Process::ProcessModel& proc,
83  const score::DocumentContext& ctx) const noexcept;
84  virtual QWidget* makeExternalUI(
86  QWidget* parent) const;
87 
88  virtual HeaderDelegate* makeHeaderDelegate(
89  const ProcessModel& model, const Process::Context& ctx,
90  QGraphicsItem* parent) const;
91  virtual FooterDelegate*
92  makeFooterDelegate(const ProcessModel& model, const Process::Context& ctx) const;
93 
94  bool matches(const Process::ProcessModel& p) const;
95  virtual bool matches(const UuidKey<Process::ProcessModel>&) const = 0;
96 };
97 }
Definition: HeaderDelegate.hpp:16
Definition: score-lib-process/Process/ProcessFactory.hpp:58
Definition: LayerPresenter.hpp:34
Definition: LayerView.hpp:21
Definition: LayerView.hpp:95
The ProcessFactory class.
Definition: score-lib-process/Process/ProcessFactory.hpp:35
The Process class.
Definition: score-lib-process/Process/Process.hpp:61
The id_base_t class.
Definition: Identifier.hpp:57
Base class for plug-in interfaces.
Definition: Interface.hpp:52
Definition: RectItem.hpp:12
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
ProcessFlags
Various settings for processes.
Definition: ProcessFlags.hpp:17
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Definition: ProcessContext.hpp:12
Definition: score-lib-process/Process/ProcessMetadata.hpp:37
Definition: TimeValue.hpp:21
The VisitorVariant struct.
Definition: VisitorInterface.hpp:26
Definition: ObjectMatches.hpp:6
Definition: DocumentContext.hpp:18