--- /dev/null
+#include "AutoMoveIntervalModel.hpp"
+
+#include "UniversalSwitchConstants.hpp"
+
+AutoMoveIntervalModel::AutoMoveIntervalModel()
+{
+ stateHandle_ = Singleton<VConfInterface>::instance().registerAndGet<bool>(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_MOVE_INT_STATE, defaultState_, [this](auto val) {
+ this->state_ = val;
+ });
+
+ state_.attach([](auto val) {
+ Singleton<VConfInterface>::instance().set(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_MOVE_INT_STATE, val);
+ });
+
+ valueHandle_ = Singleton<VConfInterface>::instance().registerAndGet<double>(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_MOVE_INT_VALUE, defaultValue_, [this](auto val) {
+ this->value_ = val;
+ });
+
+ value_.attach([](auto val) {
+ Singleton<VConfInterface>::instance().set(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_MOVE_INT_VALUE, val);
+ });
+}
\ No newline at end of file
--- /dev/null
+#ifndef AUTO_MOVE_INTERVAL_MODEL_HPP_
+#define AUTO_MOVE_INTERVAL_MODEL_HPP_
+
+#include "ObservableProperty.hpp"
+#include "VConf.hpp"
+#include "utils.hpp"
+
+class AutoMoveIntervalModel
+{
+ public:
+ AutoMoveIntervalModel();
+ ObservableProperty<bool> state_;
+ ObservableProperty<double> value_;
+
+ const utils::Range<double> range_ = {0.1, 5.0};
+
+ 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 "AutoMoveIntervalPresenter.hpp"
+
+AutoMoveIntervalPresenter::AutoMoveIntervalPresenter()
+ : SpinnerPresenterWithToggle("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_MOVE_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> AutoMoveIntervalPresenter::getRange()
+{
+ return model_.range_;
+}
+
+bool AutoMoveIntervalPresenter::isEditable()
+{
+ return model_.editable_;
+}
+
+double AutoMoveIntervalPresenter::getStep()
+{
+ return model_.step_;
+}
+
+std::string AutoMoveIntervalPresenter::getFormat()
+{
+ return "%1.1f seconds";
+}
+
+std::string AutoMoveIntervalPresenter::getLabel()
+{
+ return "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_MOVE_INT";
+}
\ No newline at end of file
--- /dev/null
+#ifndef AUTO_MOVE_INTERVAL_PRESENTER_HPP_
+#define AUTO_MOVE_INTERVAL_PRESENTER_HPP_
+
+#include "SpinnerPresenterWithToggle.hpp"
+#include "AutoMoveIntervalModel.hpp"
+
+class AutoMoveIntervalPresenter : public SpinnerPresenterWithToggle
+{
+ public:
+ AutoMoveIntervalPresenter();
+
+ utils::Range<double> getRange() override;
+ double getStep() override;
+ bool isEditable() override;
+ std::string getLabel() override;
+ std::string getFormat() override;
+
+ private:
+ AutoMoveIntervalModel model_;
+};
+#endif
\ No newline at end of file
#include "PauseOnFirstPresenter.hpp"
#include "TapDurationPresenter.hpp"
#include "AutoTapPresenter.hpp"
+#include "AutoMoveIntervalPresenter.hpp"
UniversalSwitchSettingsPagePresenter::UniversalSwitchSettingsPagePresenter()
{
: std::string{"IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"},
[this](auto item) {
DEBUG("auto move widget");
+ Singleton<AppContext>::instance().push(std::make_unique<AutoMoveIntervalPresenter>());
},
ListItem::WidgetType::toggle,
[this](auto item) {