Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
PanelChannelsEditorFactory.hpp
Go to the documentation of this file.
1#ifndef IV_UI_PANELS_EDITOR_PANELCHANNELSEDITORFACTORY_HPP
2#define IV_UI_PANELS_EDITOR_PANELCHANNELSEDITORFACTORY_HPP
3
5#include "core/defines.hpp"
6#include "ui/gui/CDialog.hpp"
7#include "ui/gui/CList.hpp"
8
9#include <memory>
10#include <vector>
11
13{
14
16{
17public:
19 {
21 {
22 Single,
24 };
26
27 bool requiresSelection {false};
28 bool hasClearButton {false};
29
30 // List of channels
32 std::optional<std::shared_ptr<std::vector<std::weak_ptr<iv::channels::AbstractChannel>>>> channels;
33
34 // Initial selection
35 std::optional<iv::types::channelId> initialSelectedChannelId {std::nullopt};
36
37 // Selection callbacks
38 std::optional<std::function<void(std::weak_ptr<iv::channels::AbstractChannel>)>> singleSelectionCallback {
39 std::nullopt};
40 std::optional<std::function<void(std::vector<std::weak_ptr<iv::channels::AbstractChannel>>)>>
43
44 // Filter
45 std::optional<std::function<bool(std::shared_ptr<iv::channels::AbstractChannel>)>> isChannelVisible {
46 std::nullopt};
47
48 // Add functionality to the panel
49 std::string panelTitle {_("Select Channel")};
50 std::optional<std::function<AbstractComponentGUI *(CList *)>> panelAddedFunctionality {std::nullopt};
51 };
52
53 static AbstractComponentGUI *panelSelectChannel(const ChannelSelectionParams &params);
54 static bool runPanelSelectChannel(CDialog *dlgFather, const ChannelSelectionParams &params);
55 static AbstractComponentGUI *buttonSelectChannel(const ChannelSelectionParams &params);
56
58 buttonSelectChannel(std::weak_ptr<iv::channels::AbstractChannel> &channelOut,
59 const std::shared_ptr<std::vector<std::weak_ptr<iv::channels::AbstractChannel>>> &channels);
60
62 std::weak_ptr<iv::channels::AbstractChannel> &channelOut,
63 const std::optional<std::function<bool(std::shared_ptr<iv::channels::AbstractChannel>)>> &filter =
64 std::nullopt);
65};
66
67}// namespace iv::panels::channels
68
69#endif//IV_UI_PANELS_EDITOR_PANELCHANNELSEDITORFACTORY_HPP
Definition AbstractComponentGUI.hpp:30
Definition CDialog.hpp:21
Definition CList.hpp:15
Definition PanelChannelsEditorFactory.hpp:16
static AbstractComponentGUI * panelSelectChannel(const ChannelSelectionParams &params)
Definition PanelChannelsEditorFactory.cpp:277
static AbstractComponentGUI * buttonSelectChannelWithClear(std::weak_ptr< iv::channels::AbstractChannel > &channelOut, const std::optional< std::function< bool(std::shared_ptr< iv::channels::AbstractChannel >)> > &filter=std::nullopt)
Definition PanelChannelsEditorFactory.cpp:559
static AbstractComponentGUI * buttonSelectChannel(const ChannelSelectionParams &params)
Definition PanelChannelsEditorFactory.cpp:474
static bool runPanelSelectChannel(CDialog *dlgFather, const ChannelSelectionParams &params)
Definition PanelChannelsEditorFactory.cpp:465
#define _(string)
Definition defines.hpp:169
Definition PanelChannelTendencyCurvesFactory.cpp:29
std::string panelTitle
Definition PanelChannelsEditorFactory.hpp:49
std::optional< std::function< void(std::weak_ptr< iv::channels::AbstractChannel >)> > singleSelectionCallback
Definition PanelChannelsEditorFactory.hpp:38
bool hasClearButton
Definition PanelChannelsEditorFactory.hpp:28
std::optional< std::function< AbstractComponentGUI *(CList *)> > panelAddedFunctionality
Definition PanelChannelsEditorFactory.hpp:50
bool acceptSelectionWithDoubleClick
Definition PanelChannelsEditorFactory.hpp:42
bool requiresSelection
Definition PanelChannelsEditorFactory.hpp:27
std::optional< std::shared_ptr< std::vector< std::weak_ptr< iv::channels::AbstractChannel > > > > channels
Definition PanelChannelsEditorFactory.hpp:32
std::optional< std::function< bool(std::shared_ptr< iv::channels::AbstractChannel >)> > isChannelVisible
Definition PanelChannelsEditorFactory.hpp:45
std::optional< iv::types::channelId > initialSelectedChannelId
Definition PanelChannelsEditorFactory.hpp:35
eChannelSelectionType selectionType
Definition PanelChannelsEditorFactory.hpp:25
eChannelSelectionType
Definition PanelChannelsEditorFactory.hpp:21
std::optional< std::function< void(std::vector< std::weak_ptr< iv::channels::AbstractChannel > >)> > multipleSelectionCallback
Definition PanelChannelsEditorFactory.hpp:41
bool getChannelsFromStaticController
Definition PanelChannelsEditorFactory.hpp:31