--- /dev/null
+#include "NumberOfAutoScanLoopsModel.hpp"
+#include "Singleton.hpp"
+#include "UniversalSwitchConstants.hpp"
+
+NumberOfAutoScanLoopsModel::NumberOfAutoScanLoopsModel()
+{
+ valueHandle_ = Singleton<VConfInterface>::instance().registerAndGet<int>(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_NUM_OF_SCANS, defaultValue_, [this](auto val) {
+ this->value_ = val;
+ });
+
+ value_.attach([](auto val) {
+ Singleton<VConfInterface>::instance().set(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_NUM_OF_SCANS, val);
+ });
+}
--- /dev/null
+#ifndef NUMBER_OF_AUTO_SCAN_LOOPS_MODEL_HPP_
+#define NUMBER_OF_AUTO_SCAN_LOOPS_MODEL_HPP_
+
+#include "ObservableProperty.hpp"
+#include "VConf.hpp"
+#include "utils.hpp"
+#include "UniversalSwitchConstants.hpp"
+
+class NumberOfAutoScanLoopsModel
+{
+ public:
+ NumberOfAutoScanLoopsModel();
+ ObservableProperty<int> value_;
+
+ const utils::Range<double> range_ = {RANGE_MIN_SCANS_NUM, RANGE_MAX_SCANS_NUM};
+ const double step_ = STEP_SCANS_NUM;
+ const double defaultValue_ = DEFAULT_AUTO_SCAN_NUMBER;
+ const bool editable_ = true;
+
+ private:
+ VConfInterface::CallbackHandle valueHandle_;
+
+};
+
+#endif
--- /dev/null
+#include "NumberOfAutoScanLoopsPresenter.hpp"
+
+NumberOfAutoScanLoopsPresenter::NumberOfAutoScanLoopsPresenter()
+ : SpinnerPresenter("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_NUM_OF_SCANS")
+{
+ value_ = model_.value_.value();
+ value_.attach([this](auto val) {
+ model_.value_ = val;
+ });
+
+
+}
+
+utils::Range<double> NumberOfAutoScanLoopsPresenter::getRange()
+{
+ return model_.range_;
+}
+
+bool NumberOfAutoScanLoopsPresenter::isEditable()
+{
+ return model_.editable_;
+}
+
+double NumberOfAutoScanLoopsPresenter::getStep()
+{
+ return model_.step_;
+}
+
+std::string NumberOfAutoScanLoopsPresenter::getFormat()
+{
+ return "%d times";
+}
+
+std::string NumberOfAutoScanLoopsPresenter::getLabel()
+{
+ return "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_NUM_OF_SCANS";
+}
--- /dev/null
+#ifndef NUMBER_OF_AUTO_SCAN_LOOPS_PRESENTER_HPP_
+#define NUMBER_OF_AUTO_SCAN_LOOPS_PRESENTER_HPP_
+
+#include "NumberOfAutoScanLoopsModel.hpp"
+#include "SpinnerPresenter.hpp"
+
+class NumberOfAutoScanLoopsPresenter : public SpinnerPresenter
+{
+ public:
+ NumberOfAutoScanLoopsPresenter();
+
+ utils::Range<double> getRange();
+ bool isEditable();
+ double getStep();
+ std::string getFormat();
+ std::string getLabel();
+
+ private:
+ NumberOfAutoScanLoopsModel model_;
+};
+
+#endif
#include "AutoTapPresenter.hpp"
#include "AutoMoveIntervalPresenter.hpp"
#include "VoicePresenter.hpp"
+#include "NumberOfAutoScanLoopsPresenter.hpp"
UniversalSwitchSettingsPagePresenter::UniversalSwitchSettingsPagePresenter()
{
std::to_string(model_.autoScanLoopsNumber_.value()),
[this](auto item) {
DEBUG("Scan num");
+ Singleton<AppContext>::instance().push(std::make_unique<NumberOfAutoScanLoopsPresenter>());
}));
item = items.back().get();
model_.autoScanLoopsNumber_.attach([item](auto value) {
return "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_CURSOR_CL_GRAY";
return "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_UNDEFINED";
-}
\ No newline at end of file
+}
#define DEFAULT_FEEDBACK_VOICE_SPEECH_RATE 0.5
#define DEFAULT_FEEDBACK_VOICE_SPEECH_VOLUME 0.5
+#define RANGE_MIN_SCANS_NUM 1
+#define RANGE_MAX_SCANS_NUM 10
+
+#define STEP_SCANS_NUM 1
+
#define BUS "org.tizen.UniversalSwitch"
#define PATH "/org/tizen/UniversalSwitch"
#define IFACE "org.tizen.UniversalSwitch"
-#endif
\ No newline at end of file
+#endif