| 1 | // SPDX-License-Identifier: GPL-3.0-or-latercxx . . $ `<file>/src/core/components/controls/controlmode.h`/ |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "core/components/controls/control.h"cxx . . $ `<file>/src/core/components/controls/control.h`/ |
| 7 | #include <memory> |
| 8 | #include <string> |
| 9 | #include <string_view> |
| 10 | #include <vector> |
| 11 | |
| 12 | /// A control that aggregates other controls, |
| 13 | /// having only one of them active at the same time. |
| 14 | class ControlModecxx . . $ ControlMode# : public Controlcxx . . $ Control# |
| 15 | { |
| 16 | public: |
| 17 | class Importercxx . . $ ControlMode#Importer# : public IControlcxx . . $ IControl#::Importercxx . . $ IControl#Importer# |
| 18 | { |
| 19 | public: |
| 20 | virtual stdcxx . . $ std/::stringcxx . . $ std/string# const &provideModecxx . . $ ControlMode#Importer#provideMode(f4fff0029955a25f).() const = 0; |
| 21 | }; |
| 22 | |
| 23 | class Exportercxx . . $ ControlMode#Exporter# : public IControlcxx . . $ IControl#::Exportercxx . . $ IControl#Exporter# |
| 24 | { |
| 25 | public: |
| 26 | virtual void takeModecxx . . $ ControlMode#Exporter#takeMode(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &mode) = 0; |
| 27 | virtual void takeModescxx . . $ ControlMode#Exporter#takeModes(eb4a68411a16b7e7).(stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#> const &modes) = 0; |
| 28 | }; |
| 29 | |
| 30 | ControlModecxx . . $ ControlMode#ControlMode(f82d4ed52a84f8e1).(stdcxx . . $ std/::string_viewcxx . . $ std/string_view# id, |
| 31 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<IControlcxx . . $ IControl#>> &&controls, |
| 32 | bool active) noexcept; |
| 33 | |
| 34 | void preInitcxx . . $ ControlMode#preInit(151e9138769f295e).(ICommandQueuecxx . . $ ICommandQueue# &ctlCmds) final override; |
| 35 | void postInitcxx . . $ ControlMode#postInit(151e9138769f295e).(ICommandQueuecxx . . $ ICommandQueue# &ctlCmds) final override; |
| 36 | void initcxx . . $ ControlMode#init(49f6e7a06ebc5aa8).() final override; |
| 37 | stdcxx . . $ std/::stringcxx . . $ std/string# const &IDcxx . . $ ControlMode#ID(f4fff0029955a25f).() const final override; |
| 38 | |
| 39 | protected: |
| 40 | void importControlcxx . . $ ControlMode#importControl(4f796e3ecd5dcd94).(IControlcxx . . $ IControl#::Importercxx . . $ IControl#Importer# &i) final override; |
| 41 | void exportControlcxx . . $ ControlMode#exportControl(40299682ab9c8676).(IControlcxx . . $ IControl#::Exportercxx . . $ IControl#Exporter# &e) const final override; |
| 42 | |
| 43 | void cleanControlcxx . . $ ControlMode#cleanControl(151e9138769f295e).(ICommandQueuecxx . . $ ICommandQueue# &ctlCmds) final override; |
| 44 | void syncControlcxx . . $ ControlMode#syncControl(151e9138769f295e).(ICommandQueuecxx . . $ ICommandQueue# &ctlCmds) final override; |
| 45 | |
| 46 | stdcxx . . $ std/::stringcxx . . $ std/string# const &modecxx . . $ ControlMode#mode(f4fff0029955a25f).() const; |
| 47 | void modecxx . . $ ControlMode#mode(9c546c94e5fcce4e).(stdcxx . . $ std/::stringcxx . . $ std/string# const &mode); |
| 48 | |
| 49 | private: |
| 50 | stdcxx . . $ std/::stringcxx . . $ std/string# const id_cxx . . $ ControlMode#id_.; |
| 51 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::unique_ptrcxx . . $ std/unique_ptr#<IControlcxx . . $ IControl#>> const controls_cxx . . $ ControlMode#controls_.; |
| 52 | stdcxx . . $ std/::stringcxx . . $ std/string# mode_cxx . . $ ControlMode#mode_.; |
| 53 | }; |