--- /dev/null
+#include "SingleInteractionIntervalModel.hpp"
+
+#include "setting-accessibility.h"
+
+SingleInteractionIntervalModel::SingleInteractionIntervalModel()
+{
+ stateHandle_ = Singleton<VConfInterface>::instance().registerAndGet<bool>(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SGL_IACTION_INT_STATE, defaultState_, [this](auto val) {
+ this->state_ = val;
+ });
+
+ state_.attach([](auto val) {
+ Singleton<VConfInterface>::instance().set(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SGL_IACTION_INT_STATE, val);
+ });
+
+ valueHandle_ = Singleton<VConfInterface>::instance().registerAndGet<double>(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SGL_IACTION_INT_VALUE, defaultValue_, [this](auto val) {
+ this->value_ = val;
+ });
+
+ value_.attach([](auto val) {
+ Singleton<VConfInterface>::instance().set(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SGL_IACTION_INT_VALUE, val);
+ });
+}
\ No newline at end of file
--- /dev/null
+#ifndef SINGLE_INTERACTION_INTERVAL_HPP_
+#define SINGLE_INTERACTION_INTERVAL_HPP_
+
+#include "ObservableProperty.hpp"
+#include "VConf.hpp"
+#include "utils.hpp"
+
+class SingleInteractionIntervalModel
+{
+ public:
+ SingleInteractionIntervalModel();
+ ObservableProperty<bool> state_;
+ ObservableProperty<double> value_;
+
+ const utils::Range<double> range_ = {0.1, 2.5};
+
+ const double step_ = 0.1;
+ const double defaultValue_ = 1.0;
+
+ const bool editable_ = true;
+ const bool defaultState_ = false;
+
+ private:
+ VConfInterface::CallbackHandle stateHandle_;
+ VConfInterface::CallbackHandle valueHandle_;
+};
+
+#endif
\ No newline at end of file
--- /dev/null
+#include "SingleInteractionIntervalPresenter.hpp"
+
+SingleInteractionIntervalPresenter::SingleInteractionIntervalPresenter()
+ : SpinnerPresenterWithToggle("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_SGL_IACTION_INT")
+{
+ state_ = model_.state_.value();
+ state_.attach([this](auto state) {
+ model_.state_ = state;
+ });
+
+ value_ = model_.value_.value();
+ value_.attach([this](auto val) {
+ model_.value_ = val;
+ });
+}
+
+utils::Range<double> SingleInteractionIntervalPresenter::getRange()
+{
+ return model_.range_;
+}
+
+bool SingleInteractionIntervalPresenter::isEditable()
+{
+ return model_.editable_;
+}
+
+double SingleInteractionIntervalPresenter::getStep()
+{
+ return model_.step_;
+}
+
+std::string SingleInteractionIntervalPresenter::getFormat()
+{
+ return "%1.1f seconds";
+}
+
+std::string SingleInteractionIntervalPresenter::getLabel()
+{
+ return "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_SGL_IACTION_INT";
+}
\ No newline at end of file
--- /dev/null
+#ifndef SINGLE_INTERACTION_INTERVAL_PRESENTER_HPP_
+#define SINGLE_INTERACTION_INTERVAL_PRESENTER_HPP_
+
+#include "SingleInteractionIntervalModel.hpp"
+#include "SpinnerPresenterWithToggle.hpp"
+
+class SingleInteractionIntervalPresenter : public SpinnerPresenterWithToggle
+{
+ public:
+ SingleInteractionIntervalPresenter();
+
+ utils::Range<double> getRange() override;
+ double getStep() override;
+ bool isEditable() override;
+ std::string getLabel() override;
+ std::string getFormat() override;
+
+ private:
+ SingleInteractionIntervalModel model_;
+};
+#endif
\ No newline at end of file
#include "AutoMoveIntervalPresenter.hpp"
#include "AutoScanIntervalPresenter.hpp"
#include "AutoTapPresenter.hpp"
+#include "AppContext.hpp"
+#include "AutoScanIntervalPresenter.hpp"
+#include "AutoTapPresenter.hpp"
#include "ManageMenuOptionsPagePresenter.hpp"
#include "NumberOfAutoScanLoopsPresenter.hpp"
#include "PauseOnFirstPresenter.hpp"
#include "PointScanSpeedPresenter.hpp"
#include "SoundPresenter.hpp"
#include "TapDurationPresenter.hpp"
-#include "AutoTapPresenter.hpp"
#include "AutoMoveIntervalPresenter.hpp"
#include "VoicePresenter.hpp"
+#include "SingleInteractionIntervalPresenter.hpp"
+#include "TapDurationPresenter.hpp"
UniversalSwitchSettingsPagePresenter::UniversalSwitchSettingsPagePresenter()
{
- setTitle("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS");
createSwitchesGroup();
createScanningGropu();
createAdditionalSettingsGroup();
: std::string{"IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"},
[this](auto item) {
DEBUG("single interaction interval widget");
+ Singleton<AppContext>::instance().push(std::make_unique<SingleInteractionIntervalPresenter>());
},
ListItem::WidgetType::toggle,
[this](auto item) {