CurveProcessFactory.hpp
1 #pragma once
2 #include <Process/Process.hpp>
3 #include <Process/ProcessFactory.hpp>
4 
5 #include <Curve/CurveStyle.hpp>
6 
8 
9 #include <score_plugin_curve_export.h>
10 
11 namespace Curve
12 {
13 class EditionSettings;
14 template <
15  typename Model_T, typename LayerPresenter_T, typename LayerView_T,
16  typename CurveColors_T, typename HeaderDelegate_T>
18  : public Process::LayerFactory
19  , public StyleInterface
20 {
21 public:
22  virtual ~CurveLayerFactory_T() = default;
23 
24  LayerView_T* makeLayerView(
25  const Process::ProcessModel& viewmodel, const Process::Context& context,
26  QGraphicsItem* parent) const final override
27  {
28  return new LayerView_T{parent};
29  }
30 
31  LayerPresenter_T* makeLayerPresenter(
33  const Process::Context& context, QObject* parent) const final override
34  {
35  return new LayerPresenter_T{
36  m_colors.style(), safe_cast<const Model_T&>(lm), safe_cast<LayerView_T*>(v),
37  context, parent};
38  }
39 
40  UuidKey<Process::ProcessModel> concreteKey() const noexcept override
41  {
43  }
44 
45  bool matches(const UuidKey<Process::ProcessModel>& p) const override
46  {
48  }
49 
50  const Curve::Style& style() const override { return m_colors.style(); }
51 
52  Process::HeaderDelegate* makeHeaderDelegate(
53  const Process::ProcessModel& model, const Process::Context& ctx,
54  QGraphicsItem* parent) const override
55  {
56  return new HeaderDelegate_T{model, ctx};
57  }
58 
59 private:
60  CurveColors_T m_colors{score::Skin::instance()};
61 };
62 }
Definition: CurveProcessFactory.hpp:20
Definition: HeaderDelegate.hpp:16
Definition: score-lib-process/Process/ProcessFactory.hpp:58
Definition: LayerView.hpp:21
The Process class.
Definition: score-lib-process/Process/Process.hpp:61
Utilities and base classes for 1D curves.
Definition: FocusDispatcher.hpp:12
Definition: CurveStyle.hpp:13
Definition: CurveStyle.hpp:40
Static metadata implementation.
Definition: lib/score/tools/Metadata.hpp:36
Definition: ProcessContext.hpp:12
Definition: ObjectMatches.hpp:6