Maki
Formally verified low-code orchestration
Loading...
Searching...
No Matches
capability_call_selector.h
1
2#pragma once
3
4#include <QString>
5#include <QStringList>
6#include <QWidget>
7#include <memory>
8
9#include "control_widget.h"
10
11class QComboBox;
12class QLabel;
13class QPushButton;
14class QStackedWidget;
15class QWheelEvent;
16class QTextBrowser;
17
18class StyledFrame;
20class NodeSaveInfo;
21
22namespace oclero::qlementine
23{
24class Label;
25}
26
27namespace maki
28{
29class SelectorWidget;
30}
31
32class CapabilityCallSelector : public maki::ControlWidget
33{
34 Q_OBJECT
35
36public:
37 static CapabilityCallSelector* create(const QString& nodeId, QWidget* parent = nullptr);
38 explicit CapabilityCallSelector(const QString& nodeId, QWidget* parent = nullptr);
39
40 void start() override;
41 void buildLibraries(const QVector<std::shared_ptr<NodeSaveInfo>>& nodes);
42
43 QPushButton* confirmButton() const;
44 maki::SelectorWidget* eventSelector() const;
45
46 void setTouring() override;
47
48signals:
49 void accepted(const QStringList& selected);
50 void changedTabs(const int index);
51 void eventSelected(const QString& eventName);
52
53protected:
54 void wheelEvent(QWheelEvent* event) override;
55
56private:
57 QStackedWidget* mStack = nullptr;
58 StyledFrame* mContent = nullptr;
59
60 oclero::qlementine::Label* mCapabilityLabel = nullptr;
61 maki::SelectorWidget* mEventCombo = nullptr;
62 QPushButton* mConfirmButton = nullptr;
63
64 std::shared_ptr<NodeSaveInfo> mSelectedCapability;
65 const QString mNodeId;
66 QTextBrowser* mEventInfo;
67
68 void updateTab(const int tab);
69 void selectCapability(const QString& instanceId, const QString& capabilityType);
70 void confirmSelection();
71 void showCapabilityPage();
72
73 QString libraryFromId(const QString& id) const;
74 LibraryContainer* getLibrary(const QString& id);
75};
A custom QGraphicsView for managing a library of nodes.
Definition library_container.h:12
Represents a node that can be saved and loaded.
Definition node_info.h:16
Definition frame.h:10
A widget for selecting one value from a list of options.
Definition widget_factory.h:451
Contains UI helper widgets and layout grouping utilities used by MAKI.
Definition macros.h:9