AddressSettingsWidget.hpp
1 #pragma once
2 
3 #include <Device/Address/AddressSettings.hpp>
4 
5 #include <score/widgets/TextLabel.hpp>
6 
7 #include <QComboBox>
8 #include <QLabel>
9 #include <QWidget>
10 
11 #include <score_plugin_deviceexplorer_export.h>
12 
13 #include <verdigris>
14 class QComboBox;
15 class QCheckBox;
16 class QLineEdit;
17 class QPushButton;
18 class QLabel;
19 class QFormLayout;
20 
21 namespace State
22 {
23 class UnitWidget;
24 }
25 namespace Explorer
26 {
27 class SCORE_PLUGIN_DEVICEEXPLORER_EXPORT AddressSettingsWidget : public QWidget
28 {
29 public:
30  struct no_widgets_t
31  {
32  };
33  explicit AddressSettingsWidget(QWidget* parent = nullptr);
34  explicit AddressSettingsWidget(no_widgets_t, QWidget* parent = nullptr);
35 
36  virtual ~AddressSettingsWidget();
37 
38  virtual Device::AddressSettings getSettings() const = 0;
39  virtual Device::AddressSettings getDefaultSettings() const = 0;
40  virtual void setSettings(const Device::AddressSettings& settings) = 0;
41  virtual void setCanEditProperties(bool) = 0;
42 
43 protected:
44  Device::AddressSettings getCommonSettings() const;
45  void setCommonSettings(const Device::AddressSettings&);
46 
47  QFormLayout* m_layout{};
48 
49  QComboBox* m_ioTypeCBox{};
50  QComboBox* m_clipModeCBox{};
51  QCheckBox* m_repetition{};
52  QComboBox* m_tagsEdit{};
53  QPushButton* m_addTagButton{};
54  QLineEdit* m_description{};
55  State::UnitWidget* m_unit{};
56  bool m_none_type{false};
57 };
58 
59 class AccessModeComboBox final : public QComboBox
60 {
61  W_OBJECT(AccessModeComboBox)
62 public:
63  AccessModeComboBox(QWidget* parent);
64  virtual ~AccessModeComboBox();
65 
66  ossia::access_mode get() const;
67  void set(ossia::access_mode t);
68 
69 public:
70  void changed(ossia::access_mode arg_1)
71  E_SIGNAL(SCORE_PLUGIN_DEVICEEXPLORER_EXPORT, changed, arg_1);
72 };
73 
74 class BoundingModeComboBox final : public QComboBox
75 {
76  W_OBJECT(BoundingModeComboBox)
77 public:
78  BoundingModeComboBox(QWidget* parent);
79  virtual ~BoundingModeComboBox();
80 
81  ossia::bounding_mode get() const;
82  void set(ossia::bounding_mode t);
83 
84 public:
85  void changed(ossia::bounding_mode arg_1)
86  E_SIGNAL(SCORE_PLUGIN_DEVICEEXPLORER_EXPORT, changed, arg_1);
87 };
88 
89 inline QLabel* makeLabel(QString text, QWidget* parent)
90 {
91  auto label = new TextLabel{std::move(text), parent};
92  label->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
93  return label;
94 }
95 }
Definition: AddressSettingsWidget.hpp:60
Definition: AddressSettingsWidget.hpp:28
Definition: AddressSettingsWidget.hpp:75
Definition: UnitWidget.hpp:22
Definition: TextLabel.hpp:6
Utilities for OSSIA data structures.
Definition: DeviceInterface.hpp:33
Definition: AddressSettings.hpp:49
Definition: AddressSettingsWidget.hpp:31