ProcessWidget.hpp
1 #pragma once
2 #include <Process/Preset.hpp>
3 
4 #include <Library/LibraryInterface.hpp>
5 #include <Library/PresetListView.hpp>
6 #include <Library/ProcessTreeView.hpp>
7 
8 #include <score/tools/std/Optional.hpp>
9 
10 #include <QSplitter>
11 #include <QTreeView>
12 
13 #include <score_plugin_library_export.h>
14 namespace score
15 {
16 struct GUIApplicationContext;
17 }
18 namespace Process
19 {
20 class ApplicationPlugin;
21 }
22 namespace Library
23 {
24 class ProcessesItemModel;
25 class PresetItemModel;
26 
28  : public QObject
30 {
31  SCORE_CONCRETE("7fc3a366-7792-489f-aca9-79d9f6d4415d")
32 
33 public:
34  QSet<QString> acceptedFiles() const noexcept override;
35  QSet<QString> acceptedMimeTypes() const noexcept override;
36 
37  void setup(Library::ProcessesItemModel& model, const score::GUIApplicationContext& ctx)
38  override;
39 
40  void addPath(std::string_view path) override;
41 
42  bool onDrop(const QMimeData& mime, int row, int column, const QDir& parent) override;
43 
44 private:
45  Process::ApplicationPlugin* presetLib{};
46  const Process::ProcessFactoryList* processes{};
47 };
48 
49 class SCORE_PLUGIN_LIBRARY_EXPORT ProcessWidget : public QWidget
50 {
51 public:
52  ProcessWidget(const score::GUIApplicationContext& ctx, QWidget* parent);
53  ~ProcessWidget();
54 
55  ProcessesItemModel& processModel() const noexcept { return *m_processModel; }
56  PresetItemModel& presetModel() const noexcept { return *m_presetModel; }
57 
58  const ProcessTreeView& processView() const noexcept { return m_tv; }
59  ProcessTreeView& processView() noexcept { return m_tv; }
60 
61  const PresetListView& presetView() const noexcept { return m_lv; }
62  PresetListView& presetView() noexcept { return m_lv; }
63 
64 private:
65  ProcessesItemModel* m_processModel{};
66  PresetItemModel* m_presetModel{};
67  ProcessTreeView m_tv;
68  PresetListView m_lv;
69 
70  QWidget m_preview;
71  QWidget* m_previewChild{};
72 };
73 }
Definition: LibraryInterface.hpp:22
Definition: PresetItemModel.hpp:16
Definition: ProcessWidget.hpp:30
Definition: PresetListView.hpp:13
Definition: ProcessTreeView.hpp:14
Definition: ProcessWidget.hpp:50
Definition: ProcessesItemModel.hpp:45
Definition: score-lib-process/Process/ApplicationPlugin.hpp:13
Definition: ProcessList.hpp:10
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Specializes ApplicationContext with the QMainWindow.
Definition: GUIApplicationContext.hpp:15