};
UniversalSwitchSettingsPage::UniversalSwitchSettingsPage(SettingAccessibility *ad)
+ : context_(ad)
{
- retm_if(ad == NULL, "Input parameter is NULL");
- ad->md.naviframe_it = NULL;
- Evas_Object *genlist = elm_genlist_add(ad->md.getNaviframe()->getObject());
- retm_if(genlist == NULL, "Cannot set genlist object as content of layout");
-
- elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
- elm_object_style_set(genlist, "dialogue");
-
- getVconfSettings(ad);
- createSwitchesGroup(ad, genlist);
- createScanningGroup(ad, genlist);
- createAdditionalSettingsGroup(ad, genlist);
- createFeedbackGroup(ad, genlist);
- createManageGroup(ad, genlist);
-
- Elm_Object_Item *navi_it = elm_naviframe_item_push(ad->md.getNaviframe()->getObject(), _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS"), NULL, NULL, genlist, NULL);
- ad->universal_switch_settings_item = navi_it;
- elm_naviframe_item_pop_cb_set(navi_it, naviframPopCb, ad);
+ context_->md.naviframe_it = NULL;
+ genlist_ = elm_genlist_add(context_->md.getNaviframe()->getObject());
+ retm_if(genlist_ == NULL, "Cannot set genlist object as content of layout");
+
+ elm_genlist_mode_set(genlist_, ELM_LIST_COMPRESS);
+ elm_object_style_set(genlist_, "dialogue");
+
+ getVconfSettings();
+ createSwitchesGroup();
+ createScanningGroup();
+ createAdditionalSettingsGroup();
+ createFeedbackGroup();
+ createManageGroup();
+
+ Elm_Object_Item *navi_it = elm_naviframe_item_push(context_->md.getNaviframe()->getObject(), _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS"), NULL, NULL, genlist_, NULL);
+ elm_naviframe_item_pop_cb_set(navi_it, naviframPopCb, context_);
elm_object_item_domain_text_translatable_set(navi_it, PACKAGE, EINA_TRUE);
- Evas_Object *back_btn = WidgetFactory::createButton(ad->md.getNaviframe()->getObject(), {}, WidgetFactory::BACK_BUTTON_ARROW_STYLE, backCb, ad);
- elm_layout_content_set(ad->md.getNaviframe()->getObject(), "prev_btn", back_btn);
+ Evas_Object *back_btn = WidgetFactory::createButton(context_->md.getNaviframe()->getObject(), {}, WidgetFactory::BACK_BUTTON_ARROW_STYLE, backCb, context_);
+ elm_layout_content_set(context_->md.getNaviframe()->getObject(), "prev_btn", back_btn);
}
-void UniversalSwitchSettingsPage::createManageGroup(SettingAccessibility *ad, Evas_Object *genlist)
+void UniversalSwitchSettingsPage::createManageGroup()
{
- addMenuItem(ad, genlist, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE"),
+ addMenuItem(_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE"),
_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE_SUB"), manageOptionsCb, false, false, NULL);
}
-void UniversalSwitchSettingsPage::createFeedbackGroup(SettingAccessibility *ad, Evas_Object *genlist)
+void UniversalSwitchSettingsPage::createFeedbackGroup()
{
const char *str = "Undefined";
- createGendialTitleItem(genlist, &itc_group_item, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK");
+ createGendialTitleItem(genlist_, &itc_group_item, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK");
for (auto i = 0u; i < CURSOR_COLORS_COUNT; i++)
- if (_cursor_color[i].id == ad->us_configuration.cursor_color) {
+ if (_cursor_color[i].id == context_->us_configuration.cursor_color) {
str = _cursor_color[i].key;
break;
}
- ad->universal_switch_feedback_cursor_cl = addMenuItem(ad, genlist, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_CURSOR_CL"),
- str, cursorColorCb, false, false, NULL);
+ universal_switch_feedback_cursor_cl = addMenuItem(_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_CURSOR_CL"),
+ str, cursorColorCb, false, false, NULL);
- str = getBoleanText(ad->us_configuration.feedback_sound_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON"),
+ str = getBoleanText(context_->us_configuration.feedback_sound_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON"),
_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- ad->universal_switch_feedback_sound = addMenuItem(ad, genlist, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_SOUND"),
- str, feedbackSoundCb, true, ad->us_configuration.feedback_sound_state, feedbackSoundCheckboxCb);
- int vconf_ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_SOUND_STATE, syncSoundFeedbackWithVconf, ad->universal_switch_feedback_sound);
+ universal_switch_feedback_sound = addMenuItem(_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_SOUND"),
+ str, feedbackSoundCb, true, context_->us_configuration.feedback_sound_state, feedbackSoundCheckboxCb);
+ universal_switch_feedback_sound->userdata = this;
+ int vconf_ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_SOUND_STATE, syncSoundFeedbackWithVconf, universal_switch_feedback_sound);
if (vconf_ret)
SETTING_TRACE_ERROR("FAIL: vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_SOUND_STATE)");
- str = getBoleanText(ad->us_configuration.feedback_voice_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON"),
+ str = getBoleanText(context_->us_configuration.feedback_voice_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON"),
_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- ad->universal_switch_feedback_voice = addMenuItem(ad, genlist, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_VOICE"),
- str, feedbackVoiceCb, true, ad->us_configuration.feedback_voice_state, feedbackVoiceCheckboxCb);
- vconf_ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_STATE, syncVoiceFeedbackWithVconf, ad->universal_switch_feedback_voice);
+ universal_switch_feedback_voice = addMenuItem(_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_VOICE"),
+ str, feedbackVoiceCb, true, context_->us_configuration.feedback_voice_state, feedbackVoiceCheckboxCb);
+ universal_switch_feedback_voice->userdata = this;
+ vconf_ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_STATE, syncVoiceFeedbackWithVconf, universal_switch_feedback_voice);
if (vconf_ret)
SETTING_TRACE_ERROR("FAIL: vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_STATE)");
}
-void UniversalSwitchSettingsPage::createAdditionalSettingsGroup(SettingAccessibility *ad, Evas_Object *genlist)
+void UniversalSwitchSettingsPage::createAdditionalSettingsGroup()
{
std::string str;
- createGendialTitleItem(genlist, &itc_group_item, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS");
+ createGendialTitleItem(genlist_, &itc_group_item, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS");
- str = getValueUnitText(NULL, &ad->us_configuration.pause_on_first_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.pause_on_first_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- ad->universal_switch_pause_on_first = addMenuItem(ad, genlist, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_PAUSE_ON_FIRST"),
- str.c_str(), pauseOnFirstCb, true, ad->us_configuration.pause_on_first_state, pauseOnFirstCheckboxCb);
+ str = getValueUnitText(NULL, &context_->us_configuration.pause_on_first_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !context_->us_configuration.pause_on_first_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ universal_switch_pause_on_first = addMenuItem(_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_PAUSE_ON_FIRST"),
+ str, pauseOnFirstCb, true, context_->us_configuration.pause_on_first_state, pauseOnFirstCheckboxCb);
- if (ad->universal_switch_pause_on_first)
- elm_object_item_disabled_set(ad->universal_switch_pause_on_first->item, (Eina_Bool)!ad->us_configuration.auto_scan);
+ universal_switch_pause_on_first->userdata = this;
+ elm_object_item_disabled_set(universal_switch_pause_on_first->item, (Eina_Bool)!context_->us_configuration.auto_scan);
- str = getValueUnitText(NULL, &ad->us_configuration.tap_duration_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.tap_duration_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- ad->universal_switch_tap_duration = addMenuItem(ad, genlist, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_TAP_DURATION"),
- str.c_str(), tapDurationCb, true, ad->us_configuration.tap_duration_state, tapDurationCheckboxCb);
+ str = getValueUnitText(NULL, &context_->us_configuration.tap_duration_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !context_->us_configuration.tap_duration_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ universal_switch_tap_duration = addMenuItem(_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_TAP_DURATION"),
+ str, tapDurationCb, true, context_->us_configuration.tap_duration_state, tapDurationCheckboxCb);
+ universal_switch_tap_duration->userdata = this;
- str = getValueUnitText(NULL, &ad->us_configuration.sgl_iaction_int_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.sgl_iaction_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- ad->universal_switch_sgl_iaction_int = addMenuItem(ad, genlist, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_SGL_IACTION_INT"),
- str.c_str(), sglInactionIntervalCb, true, ad->us_configuration.sgl_iaction_int_state, sglInactionIntervalCheckboxCb);
+ str = getValueUnitText(NULL, &context_->us_configuration.sgl_iaction_int_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !context_->us_configuration.sgl_iaction_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ universal_switch_sgl_iaction_int = addMenuItem(_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_SGL_IACTION_INT"),
+ str, sglInactionIntervalCb, true, context_->us_configuration.sgl_iaction_int_state, sglInactionIntervalCheckboxCb);
+ universal_switch_sgl_iaction_int->userdata = this;
- str = getValueUnitText(NULL, &ad->us_configuration.auto_tap_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.auto_tap_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- ad->universal_switch_auto_tap = addMenuItem(ad, genlist, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_TAP"),
- str.c_str(), autoTapCb, true, ad->us_configuration.auto_tap_state, autoTapCheckboxCb);
+ str = getValueUnitText(NULL, &context_->us_configuration.auto_tap_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !context_->us_configuration.auto_tap_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ universal_switch_auto_tap = addMenuItem(_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_TAP"),
+ str, autoTapCb, true, context_->us_configuration.auto_tap_state, autoTapCheckboxCb);
+ universal_switch_auto_tap->userdata = this;
- str = getValueUnitText(NULL, &ad->us_configuration.auto_move_int_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.auto_move_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- ad->universal_switch_auto_move_int = addMenuItem(ad, genlist, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_MOVE_INT"),
- str.c_str(), autoMoveIntervalCb, true, ad->us_configuration.auto_move_int_state, autoMoveIntervalCheckboxCb);
+ str = getValueUnitText(NULL, &context_->us_configuration.auto_move_int_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !context_->us_configuration.auto_move_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ universal_switch_auto_move_int = addMenuItem(_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_MOVE_INT"),
+ str, autoMoveIntervalCb, true, context_->us_configuration.auto_move_int_state, autoMoveIntervalCheckboxCb);
+ universal_switch_auto_move_int->userdata = this;
- if (ad->universal_switch_auto_move_int)
- elm_object_item_disabled_set(ad->universal_switch_auto_move_int->item, (Eina_Bool)ad->us_configuration.auto_scan);
+ if (universal_switch_auto_move_int)
+ elm_object_item_disabled_set(universal_switch_auto_move_int->item, (Eina_Bool)context_->us_configuration.auto_scan);
- addMenuItem(ad, genlist, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_TAP_KBD"),
- _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_TAP_KBD_SUB"), autoTapKBDMenuItemSelected, true, ad->us_configuration.auto_tap_kbd_state, autoTapKbdCheckboxCb);
+ addMenuItem(_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_TAP_KBD"),
+ _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_TAP_KBD_SUB"), autoTapKBDMenuItemSelected, true, context_->us_configuration.auto_tap_kbd_state, autoTapKbdCheckboxCb);
}
void UniversalSwitchSettingsPage::autoTapKBDMenuItemSelected(void *data, Evas_Object *obj, void *event_info)
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_TAP_KBD_STATE, (bool *)&list_item->chk_status, NULL, NULL);
}
-void UniversalSwitchSettingsPage::createScanningGroup(SettingAccessibility *ad, Evas_Object *genlist)
+void UniversalSwitchSettingsPage::createScanningGroup()
{
std::string str;
- retm_if(ad == NULL, "Input argument is NULL");
+ createGendialTitleItem(genlist_, &itc_group_item, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING");
- createGendialTitleItem(genlist, &itc_group_item, "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING");
-
- GenGroupItemData *item = addMenuItem(ad, genlist, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_AUTO_SCAN"), NULL, onAutoScanItemSelection, true, ad->us_configuration.auto_scan, autoScanCheckboxCb);
+ GenGroupItemData *item = addMenuItem(_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_AUTO_SCAN"), {}, onAutoScanItemSelection, true, context_->us_configuration.auto_scan, autoScanCheckboxCb);
+ item->userdata = this;
int vconf_ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_SCAN_ENABLED, syncAutoScanWithVconf, item);
if (vconf_ret)
SETTING_TRACE_ERROR("FAIL: vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_SCAN_ENABLED)");
- str = getValueUnitText(NULL, &ad->us_configuration.auto_scan_interval, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"), false, NULL);
- ad->universal_switch_auto_scan_int = addMenuItem(ad, genlist, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_AUTO_SCAN_INT"), str.c_str(), autoScanIntervalCb, false, false, NULL);
+ str = getValueUnitText(NULL, &context_->us_configuration.auto_scan_interval, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"), false, NULL);
+ universal_switch_auto_scan_int = addMenuItem(_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_AUTO_SCAN_INT"), str, autoScanIntervalCb, false, false, NULL);
- if (ad->universal_switch_auto_scan_int)
- elm_object_item_disabled_set(ad->universal_switch_auto_scan_int->item, (Eina_Bool)!ad->us_configuration.auto_scan);
+ elm_object_item_disabled_set(universal_switch_auto_scan_int->item, (Eina_Bool)!context_->us_configuration.auto_scan);
- str = getValueUnitText(&ad->us_configuration.auto_scan_num, NULL, NULL, false, NULL);
- ad->universal_switch_scans_num = addMenuItem(ad, genlist, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_NUM_OF_SCANS"), str.c_str(), scanNumberCb, false, false, NULL);
+ str = getValueUnitText(&context_->us_configuration.auto_scan_num, NULL, NULL, false, NULL);
+ universal_switch_scans_num = addMenuItem(_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_NUM_OF_SCANS"), str, scanNumberCb, false, false, NULL);
- if (ad->universal_switch_scans_num)
- elm_object_item_disabled_set(ad->universal_switch_scans_num->item, (Eina_Bool)!ad->us_configuration.auto_scan);
+ elm_object_item_disabled_set(universal_switch_scans_num->item, (Eina_Bool)!context_->us_configuration.auto_scan);
- str = getScanMethodText(ad->us_configuration.scan_method);
- ad->universal_switch_scan_method = addMenuItem(ad, genlist, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_METHOD"), str.c_str(), scanMethodCb, false, false, NULL);
+ str = getScanMethodText(context_->us_configuration.scan_method);
+ universal_switch_scan_method = addMenuItem(_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_METHOD"), str, scanMethodCb, false, false, NULL);
- str = getScanDirectionText(ad->us_configuration.scan_dir);
- ad->universal_switch_scan_dir = addMenuItem(ad, genlist, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_DIR"), str.c_str(), scanDirectionCb, false, false, NULL);
+ str = getScanDirectionText(context_->us_configuration.scan_dir);
+ universal_switch_scan_dir = addMenuItem(_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_DIR"), str, scanDirectionCb, false, false, NULL);
- str = getValueUnitText(&ad->us_configuration.scan_pt_speed, NULL, NULL, false, NULL);
- ad->universal_switch_scan_speed = addMenuItem(ad, genlist, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_PT_SPEED"), str.c_str(), scanSpeedCb, false, false, NULL);
+ str = getValueUnitText(&context_->us_configuration.scan_pt_speed, NULL, NULL, false, NULL);
+ universal_switch_scan_speed = addMenuItem(_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_PT_SPEED"), str, scanSpeedCb, false, false, NULL);
}
-void UniversalSwitchSettingsPage::createSwitchesGroup(SettingAccessibility *ad, Evas_Object *genlist)
+void UniversalSwitchSettingsPage::createSwitchesGroup()
{
- retm_if(ad == NULL, "Input argument is NULL");
-
- ad->universal_switch_settings_switches = addMenuItem(ad, genlist, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SWITCHES"), NULL, switchesClickCb, false, false, NULL);
- updateSwitchesCount(ad);
+ universal_switch_settings_switches = addMenuItem(_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SWITCHES"), {}, switchesClickCb, false, false, NULL);
+ updateSwitchesCount(this);
}
void UniversalSwitchSettingsPage::setCtxPopupPosition(SettingAccessibility *ad, Evas_Object *ctxpopup)
evas_object_move(ctxpopup, -1, y + h);
}
-Evas_Object *UniversalSwitchSettingsPage::createCtxPopup(SettingAccessibility *ad)
+Evas_Object *UniversalSwitchSettingsPage::createCtxPopup()
{
- Evas_Object *ctxpopup = NULL;
- retvm_if(ad == NULL, NULL, "Input parameter is NULL");
-
- ctxpopup = elm_ctxpopup_add(ad->md.getNaviframe()->getObject());
+ Evas_Object *ctxpopup = elm_ctxpopup_add(context_->md.getNaviframe()->getObject());
elm_ctxpopup_auto_hide_disabled_set(ctxpopup, EINA_TRUE);
- evas_object_data_set(ctxpopup, CTXPOPUP_DATA_AD, (void *)ad);
+ evas_object_data_set(ctxpopup, CTXPOPUP_DATA_AD, this);
eext_object_event_callback_add(ctxpopup, EEXT_CALLBACK_BACK, ctxPopupDelCb, NULL);
evas_object_smart_callback_add(ctxpopup, "dismissed", ctxPopupDelCb, NULL);
return ss.str();
}
-GenGroupItemData *UniversalSwitchSettingsPage::addMenuItem(SettingAccessibility *ad, Evas_Object *genlist, const char *main_text, const char *sub_text,
+GenGroupItemData *UniversalSwitchSettingsPage::addMenuItem(const std::string &main_text, const std::string &sub_text,
SettingCallback item_cb, bool chk, bool chk_state, SettingCallback chk_cb)
{
- retvm_if(ad == NULL, NULL, "Input argument is NULL");
- retvm_if(genlist == NULL, NULL, "Input genlist argument is NULL");
auto item_type = SwallowType::INVALID;
- GenGroupItemData *item;
if (chk)
item_type = SwallowType::ICON_RADIO;
- item = createGendialGroupItem(genlist, &ad->itc_multiline_sub,
- item_cb, ad,
- item_type, (int)chk_state,
- main_text,
- sub_text ? sub_text : std::string{},
- chk_cb);
+ GenGroupItemData *item = createGendialGroupItem(genlist_, &context_->itc_multiline_sub,
+ item_cb, this,
+ item_type, (int)chk_state,
+ main_text,
+ sub_text,
+ chk_cb);
if (item)
- item->userdata = ad;
+ item->userdata = context_;
return item;
}
-void UniversalSwitchSettingsPage::getVconfSettings(SettingAccessibility *ad)
+void UniversalSwitchSettingsPage::getVconfSettings()
{
- retm_if(ad == NULL, "Input argument is NULL");
-
/* Defaults setting */
- ad->us_configuration.auto_scan = DEFAULT_AUTO_SCAN;
- ad->us_configuration.auto_scan_interval = DEFAULT_AUTO_SCAN_INTERVAL;
- ad->us_configuration.auto_scan_num = DEFAULT_AUTO_SCAN_NUMBER;
- ad->us_configuration.scan_method = DEFAULT_SCAN_METHOD;
- ad->us_configuration.scan_dir = DEFAULT_SCAN_DIR;
- ad->us_configuration.scan_pt_speed = DEFAULT_SCAN_PT_SPEED;
- ad->us_configuration.pause_on_first_state = DEFAULT_PAUSE_ON_FIRST_STATE;
- ad->us_configuration.pause_on_first_value = DEFAULT_PAUSE_ON_FIRST_VALUE;
- ad->us_configuration.tap_duration_state = DEFAULT_TAP_DURATION_STATE;
- ad->us_configuration.tap_duration_value = DEFAULT_TAP_DURATION_VALUE;
- ad->us_configuration.sgl_iaction_int_state = DEFAULT_SGL_IACTION_INT_STATE;
- ad->us_configuration.sgl_iaction_int_value = DEFAULT_SGL_IACTION_INT_VALUE;
- ad->us_configuration.auto_tap_state = DEFAULT_AUTO_TAP_STATE;
- ad->us_configuration.auto_tap_value = DEFAULT_AUTO_TAP_VALUE;
- ad->us_configuration.auto_move_int_state = DEFAULT_AUTO_MOVE_INT_STATE;
- ad->us_configuration.auto_move_int_value = DEFAULT_AUTO_MOVE_INT_VALUE;
- ad->us_configuration.auto_tap_kbd_state = DEFAULT_AUTO_TAP_KBD_STATE;
- ad->us_configuration.cursor_color = DEFAULT_FEEDBACK_CURSOR_COLOR;
- ad->us_configuration.feedback_sound_state = DEFAULT_FEEDBACK_SOUND_STATE;
- ad->us_configuration.feedback_sound_volume = DEFAULT_FEEDBACK_SOUND_VOLUME;
- ad->us_configuration.feedback_voice_state = DEFAULT_FEEDBACK_VOICE_STATE;
- ad->us_configuration.feedback_voice_speech_rate = DEFAULT_FEEDBACK_VOICE_SPEECH_RATE;
- ad->us_configuration.feedback_voice_speech_volume = DEFAULT_FEEDBACK_VOICE_SPEECH_VOLUME;
+ context_->us_configuration.auto_scan = DEFAULT_AUTO_SCAN;
+ context_->us_configuration.auto_scan_interval = DEFAULT_AUTO_SCAN_INTERVAL;
+ context_->us_configuration.auto_scan_num = DEFAULT_AUTO_SCAN_NUMBER;
+ context_->us_configuration.scan_method = DEFAULT_SCAN_METHOD;
+ context_->us_configuration.scan_dir = DEFAULT_SCAN_DIR;
+ context_->us_configuration.scan_pt_speed = DEFAULT_SCAN_PT_SPEED;
+ context_->us_configuration.pause_on_first_state = DEFAULT_PAUSE_ON_FIRST_STATE;
+ context_->us_configuration.pause_on_first_value = DEFAULT_PAUSE_ON_FIRST_VALUE;
+ context_->us_configuration.tap_duration_state = DEFAULT_TAP_DURATION_STATE;
+ context_->us_configuration.tap_duration_value = DEFAULT_TAP_DURATION_VALUE;
+ context_->us_configuration.sgl_iaction_int_state = DEFAULT_SGL_IACTION_INT_STATE;
+ context_->us_configuration.sgl_iaction_int_value = DEFAULT_SGL_IACTION_INT_VALUE;
+ context_->us_configuration.auto_tap_state = DEFAULT_AUTO_TAP_STATE;
+ context_->us_configuration.auto_tap_value = DEFAULT_AUTO_TAP_VALUE;
+ context_->us_configuration.auto_move_int_state = DEFAULT_AUTO_MOVE_INT_STATE;
+ context_->us_configuration.auto_move_int_value = DEFAULT_AUTO_MOVE_INT_VALUE;
+ context_->us_configuration.auto_tap_kbd_state = DEFAULT_AUTO_TAP_KBD_STATE;
+ context_->us_configuration.cursor_color = DEFAULT_FEEDBACK_CURSOR_COLOR;
+ context_->us_configuration.feedback_sound_state = DEFAULT_FEEDBACK_SOUND_STATE;
+ context_->us_configuration.feedback_sound_volume = DEFAULT_FEEDBACK_SOUND_VOLUME;
+ context_->us_configuration.feedback_voice_state = DEFAULT_FEEDBACK_VOICE_STATE;
+ context_->us_configuration.feedback_voice_speech_rate = DEFAULT_FEEDBACK_VOICE_SPEECH_RATE;
+ context_->us_configuration.feedback_voice_speech_volume = DEFAULT_FEEDBACK_VOICE_SPEECH_VOLUME;
for (auto ii = 0u; ii < UniversalSwitchConfiguration::MANAGE_OPTIONS_COUNT; ++ii)
- ad->us_configuration.manage_options_state[ii] = DEFAULT_MANAGE_OPTIONS_VALUE;
-
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_SCAN_ENABLED, &ad->us_configuration.auto_scan, NULL, NULL);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_SCAN_INT, NULL, NULL, &ad->us_configuration.auto_scan_interval);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_NUM_OF_SCANS, NULL, &ad->us_configuration.auto_scan_num, NULL);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SCAN_METHOD, NULL, (int *)&ad->us_configuration.scan_method, NULL);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SCAN_DIR_VERTICAL, NULL, (int *)&ad->us_configuration.scan_dir, NULL);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SCAN_PT_SPEED, NULL, &ad->us_configuration.scan_pt_speed, NULL);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_PAUSE_ON_FIRST_STATE, &ad->us_configuration.pause_on_first_state, NULL, NULL);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_PAUSE_ON_FIRST_VALUE, NULL, NULL, &ad->us_configuration.pause_on_first_value);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_TAP_DURATION_STATE, &ad->us_configuration.tap_duration_state, NULL, NULL);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_TAP_DURATION_VALUE, NULL, NULL, &ad->us_configuration.tap_duration_value);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SGL_IACTION_INT_STATE, &ad->us_configuration.sgl_iaction_int_state, NULL, NULL);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SGL_IACTION_INT_VALUE, NULL, NULL, &ad->us_configuration.sgl_iaction_int_value);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_TAP_STATE, &ad->us_configuration.auto_tap_state, NULL, NULL);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_TAP_VALUE, NULL, NULL, &ad->us_configuration.auto_tap_value);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_MOVE_INT_STATE, &ad->us_configuration.auto_move_int_state, NULL, NULL);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_MOVE_INT_VALUE, NULL, NULL, &ad->us_configuration.auto_move_int_value);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_TAP_KBD_STATE, &ad->us_configuration.auto_tap_kbd_state, NULL, NULL);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_CURSOR_COLOR, NULL, &ad->us_configuration.cursor_color, NULL);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_STATE, &ad->us_configuration.feedback_voice_state, NULL, NULL);
- getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_SOUND_STATE, &ad->us_configuration.feedback_sound_state, NULL, NULL);
- ad->us_configuration.feedback_sound_volume = getAndConvertVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_SOUND_VOLUME);
- ad->us_configuration.feedback_voice_speech_rate = getAndConvertVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_SPEECH_RATE);
- ad->us_configuration.feedback_voice_speech_volume = getAndConvertVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_SPEECH_VOLUME);
+ context_->us_configuration.manage_options_state[ii] = DEFAULT_MANAGE_OPTIONS_VALUE;
+
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_SCAN_ENABLED, &context_->us_configuration.auto_scan, NULL, NULL);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_SCAN_INT, NULL, NULL, &context_->us_configuration.auto_scan_interval);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_NUM_OF_SCANS, NULL, &context_->us_configuration.auto_scan_num, NULL);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SCAN_METHOD, NULL, (int *)&context_->us_configuration.scan_method, NULL);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SCAN_DIR_VERTICAL, NULL, (int *)&context_->us_configuration.scan_dir, NULL);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SCAN_PT_SPEED, NULL, &context_->us_configuration.scan_pt_speed, NULL);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_PAUSE_ON_FIRST_STATE, &context_->us_configuration.pause_on_first_state, NULL, NULL);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_PAUSE_ON_FIRST_VALUE, NULL, NULL, &context_->us_configuration.pause_on_first_value);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_TAP_DURATION_STATE, &context_->us_configuration.tap_duration_state, NULL, NULL);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_TAP_DURATION_VALUE, NULL, NULL, &context_->us_configuration.tap_duration_value);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SGL_IACTION_INT_STATE, &context_->us_configuration.sgl_iaction_int_state, NULL, NULL);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SGL_IACTION_INT_VALUE, NULL, NULL, &context_->us_configuration.sgl_iaction_int_value);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_TAP_STATE, &context_->us_configuration.auto_tap_state, NULL, NULL);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_TAP_VALUE, NULL, NULL, &context_->us_configuration.auto_tap_value);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_MOVE_INT_STATE, &context_->us_configuration.auto_move_int_state, NULL, NULL);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_MOVE_INT_VALUE, NULL, NULL, &context_->us_configuration.auto_move_int_value);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_TAP_KBD_STATE, &context_->us_configuration.auto_tap_kbd_state, NULL, NULL);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_CURSOR_COLOR, NULL, &context_->us_configuration.cursor_color, NULL);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_STATE, &context_->us_configuration.feedback_voice_state, NULL, NULL);
+ getVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_SOUND_STATE, &context_->us_configuration.feedback_sound_state, NULL, NULL);
+ context_->us_configuration.feedback_sound_volume = getAndConvertVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_SOUND_VOLUME);
+ context_->us_configuration.feedback_voice_speech_rate = getAndConvertVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_SPEECH_RATE);
+ context_->us_configuration.feedback_voice_speech_volume = getAndConvertVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_SPEECH_VOLUME);
for (auto ii = 0u; ii < UniversalSwitchConfiguration::MANAGE_OPTIONS_COUNT; ++ii)
- getVconfValue(_manage_options_key_array[ii], &ad->us_configuration.manage_options_state[ii], NULL, NULL);
+ getVconfValue(_manage_options_key_array[ii], &context_->us_configuration.manage_options_state[ii], NULL, NULL);
}
int UniversalSwitchSettingsPage::getAndConvertVconfValue(const char *key)
return (ret == VCONF_OK);
}
-void UniversalSwitchSettingsPage::updateSwitchesCount(SettingAccessibility *ad)
+void UniversalSwitchSettingsPage::updateSwitchesCount(void *data)
{
- retm_if(ad == NULL, "Input argument is NULL");
- int switch_count = setting_accessibility_universal_switch_dbus_config_get_switch_count(&ad->config);
+ retm_if(data == NULL, "Input argument is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
- ad->universal_switch_settings_switches->sub_desc = getValueUnitText(&switch_count, NULL, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SWITCHES"), false, NULL);
+ int switch_count = setting_accessibility_universal_switch_dbus_config_get_switch_count(&self->context_->config);
- elm_genlist_item_update(ad->universal_switch_settings_switches->item);
+ self->universal_switch_settings_switches->sub_desc = getValueUnitText(&switch_count, NULL, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SWITCHES"), false, NULL);
+
+ elm_genlist_item_update(self->universal_switch_settings_switches->item);
}
void UniversalSwitchSettingsPage::manageOptionsCb(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility *>(data);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
- retm_if(ad == NULL, "Data argument is NULL");
- ad->setValuePage_ = std::make_unique<SetValuePage>(ad, ValueEditorType::SWITCHES, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE"));
+ self->setValuePage_ = std::make_unique<SetValuePage>(self->context_, ValueEditorType::SWITCHES, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE"));
for (auto i = 0u; i < utils::lenOf(_manage_options); ++i)
- SetValuePage::addSwitchItem(ad, _manage_options[i].first.c_str(),
+ SetValuePage::addSwitchItem(self->context_, _manage_options[i].first.c_str(),
(i == UniversalSwitchConfiguration::MANAGE_OPTIONS_COUNT - 1) ? "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE_CONTEXTUAL_MENU_DESC" : NULL,
static_cast<int>(_manage_options[i].second),
- ad->us_configuration.manage_options_state[i],
+ self->context_->us_configuration.manage_options_state[i],
manageOptionsItemSelected);
- SetValuePage::addSwitchItemChangedCb(ad, manageOptionsCheckboxCb);
+ SetValuePage::addSwitchItemChangedCb(self->context_, manageOptionsCheckboxCb);
}
void UniversalSwitchSettingsPage::manageOptionsItemSelected(void *data, Evas_Object *obj, void *event_info)
void UniversalSwitchSettingsPage::feedbackVoiceCb(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility *>(data);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
- retm_if(ad == NULL, "Data argument is NULL");
- ad->setValuePage_ = std::make_unique<SetValuePage>(ad, ValueEditorType::LIST_SWITCH, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_VOICE"));
- SetValuePage::setSwitch(ad, ad->us_configuration.feedback_voice_state);
- SetValuePage::setDescription(ad, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_FEEDBACK_VOICE"));
- SetValuePage::addSwitchChangedCb(ad, feedbackVoiceSwitchChangedCb);
- int vconf_ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_STATE, SetValuePage::syncPageWithVconf, ad);
+ self->setValuePage_ = std::make_unique<SetValuePage>(self->context_, ValueEditorType::LIST_SWITCH, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_VOICE"));
+ SetValuePage::setSwitch(self->context_, self->context_->us_configuration.feedback_voice_state);
+ SetValuePage::setDescription(self->context_, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_FEEDBACK_VOICE"));
+ SetValuePage::addSwitchChangedCb(self->context_, feedbackVoiceSwitchChangedCb, self);
+ int vconf_ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_STATE, SetValuePage::syncPageWithVconf, self->context_);
if (vconf_ret)
SETTING_TRACE_ERROR("FAIL: vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_STATE)");
- std::string str = std::to_string(ad->us_configuration.feedback_voice_speech_rate) + "%";
- ad->universal_switch_feedback_voice_speech_rate = SetValuePage::addRadioListItem(ad,
+ std::string str = std::to_string(self->context_->us_configuration.feedback_voice_speech_rate) + "%";
+ self->universal_switch_feedback_voice_speech_rate = SetValuePage::addRadioListItem(self->context_,
_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_VOICE_SPEECH_RATE"), str.c_str(), static_cast<int>(VoiceFeedbackAttribute::SPEECH_RATE));
- str = std::to_string(ad->us_configuration.feedback_voice_speech_volume) + "%";
- ad->universal_switch_feedback_voice_speech_volume = SetValuePage::addRadioListItem(ad,
+ str = std::to_string(self->context_->us_configuration.feedback_voice_speech_volume) + "%";
+ self->universal_switch_feedback_voice_speech_volume = SetValuePage::addRadioListItem(self->context_,
_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_VOICE_SPEECH_VOLUME"), str.c_str(), static_cast<int>(VoiceFeedbackAttribute::VOLUME));
- SetValuePage::addListItemOptionsRequestCb(ad, feedbackVoiceItemOptionsRequestCb);
+ SetValuePage::addListItemOptionsRequestCb(self->context_, feedbackVoiceItemOptionsRequestCb, self);
}
-void UniversalSwitchSettingsPage::feedbackVoiceItemOptionsRequestCb(SettingAccessibility *ad, int option_id)
+void UniversalSwitchSettingsPage::feedbackVoiceItemOptionsRequestCb(void *data, int option_id)
{
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
+
char *page_title = NULL;
int sel_value = 0;
auto feedbackType = static_cast<VoiceFeedbackAttribute>(option_id);
changeRadioItemCb cb;
if (feedbackType == VoiceFeedbackAttribute::SPEECH_RATE) {
page_title = _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_VOICE_SPEECH_RATE");
- sel_value = ad->us_configuration.feedback_voice_speech_rate;
+ sel_value = self->context_->us_configuration.feedback_voice_speech_rate;
cb = feedbackVoiceSpeechRateChangedCb;
} else if (feedbackType == VoiceFeedbackAttribute::VOLUME) {
page_title = _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_VOICE_SPEECH_VOLUME");
- sel_value = ad->us_configuration.feedback_voice_speech_volume;
+ sel_value = self->context_->us_configuration.feedback_voice_speech_volume;
cb = feedbackVoiceSpeechVolumeChangedCb;
} else {
SETTING_TRACE_END;
return;
}
- ad->setValuePage_ = std::make_unique<SetValuePage>(ad, ValueEditorType::RADIOS, page_title);
- SetValuePage::addRadioItemChangedCb(ad, cb);
- elm_naviframe_item_pop_cb_set(elm_naviframe_top_item_get(ad->md.getNaviframe()->getObject()), NULL, NULL);
+ self->setValuePage_ = std::make_unique<SetValuePage>(self->context_, ValueEditorType::RADIOS, page_title);
+ SetValuePage::addRadioItemChangedCb(self->context_, cb, self);
+ elm_naviframe_item_pop_cb_set(elm_naviframe_top_item_get(self->context_->md.getNaviframe()->getObject()), NULL, NULL);
int i;
for (i = 0; i < MEDIA_LEVEL_COUNT; i++)
- SetValuePage::addRadioItem(ad, _media_level[i].key, i, _media_level[i].id == sel_value);
+ SetValuePage::addRadioItem(self->context_, _media_level[i].key, i, _media_level[i].id == sel_value);
}
-void UniversalSwitchSettingsPage::feedbackVoiceSpeechVolumeChangedCb(SettingAccessibility *ad, int item_id)
+void UniversalSwitchSettingsPage::feedbackVoiceSpeechVolumeChangedCb(void *data, int item_id)
{
- retm_if(ad == NULL, "Data argument is NULL");
+ retm_if(data == NULL, "Data argument is NULL");
retm_if(item_id < 0 || item_id >= MEDIA_LEVEL_COUNT, "Invalid item_id");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
- ad->us_configuration.feedback_voice_speech_volume = _media_level[item_id].id;
+ self->context_->us_configuration.feedback_voice_speech_volume = _media_level[item_id].id;
double media_level = _media_level[item_id].id / 100.0;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_SPEECH_VOLUME, NULL, NULL, &media_level);
- ad->universal_switch_feedback_voice_speech_volume->sub_desc = _media_level[item_id].key ? _media_level[item_id].key : std::string{};
- elm_genlist_item_update(ad->universal_switch_feedback_voice_speech_volume->item);
+ self->universal_switch_feedback_voice_speech_volume->sub_desc = _media_level[item_id].key ? _media_level[item_id].key : std::string{};
+ elm_genlist_item_update(self->universal_switch_feedback_voice_speech_volume->item);
}
-void UniversalSwitchSettingsPage::feedbackVoiceSpeechRateChangedCb(SettingAccessibility *ad, int item_id)
+void UniversalSwitchSettingsPage::feedbackVoiceSpeechRateChangedCb(void *data, int item_id)
{
- retm_if(ad == NULL, "Data argument is NULL");
+ retm_if(data == NULL, "Data argument is NULL");
retm_if(item_id < 0 || item_id >= MEDIA_LEVEL_COUNT, "Invalid item_id");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
- ad->us_configuration.feedback_voice_speech_rate = _media_level[item_id].id;
+ self->context_->us_configuration.feedback_voice_speech_rate = _media_level[item_id].id;
double media_level = _media_level[item_id].id / 100.0;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_SPEECH_RATE, NULL, NULL, &media_level);
- ad->universal_switch_feedback_voice_speech_rate->sub_desc = _media_level[item_id].key ? _media_level[item_id].key : std::string{};
- elm_genlist_item_update(ad->universal_switch_feedback_voice_speech_rate->item);
+ self->universal_switch_feedback_voice_speech_rate->sub_desc = _media_level[item_id].key ? _media_level[item_id].key : std::string{};
+ elm_genlist_item_update(self->universal_switch_feedback_voice_speech_rate->item);
}
-void UniversalSwitchSettingsPage::feedbackVoiceSwitchChangedCb(SettingAccessibility *ad, bool state)
+void UniversalSwitchSettingsPage::feedbackVoiceSwitchChangedCb(void *data, bool state)
{
const char *str = NULL;
- retm_if(ad == NULL, "Data argument is NULL");
+ retm_if(data == NULL, "Data argument is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
- ad->us_configuration.feedback_voice_state = state;
+ self->context_->us_configuration.feedback_voice_state = state;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_STATE, &state, NULL, NULL);
- if (ad->us_configuration.feedback_voice_state)
+ if (self->context_->us_configuration.feedback_voice_state)
str = _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON");
else
str = _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
- ad->universal_switch_feedback_voice->chk_status = state;
- elm_check_state_set(ad->universal_switch_feedback_voice->eo_check, state);
- ad->universal_switch_feedback_voice->sub_desc = str ? str : std::string{};
- elm_genlist_item_update(ad->universal_switch_feedback_voice->item);
+ self->universal_switch_feedback_voice->chk_status = state;
+ elm_check_state_set(self->universal_switch_feedback_voice->eo_check, state);
+ self->universal_switch_feedback_voice->sub_desc = str ? str : std::string{};
+ elm_genlist_item_update(self->universal_switch_feedback_voice->item);
}
void UniversalSwitchSettingsPage::feedbackVoiceCheckboxCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
auto list_item = static_cast<GenGroupItemData *>(data);
- auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(list_item->userdata);
list_item->chk_status = elm_check_state_get(obj);
- if (ad) {
- ad->us_configuration.feedback_voice_state = list_item->chk_status;
+ if (self->context_) {
+ self->context_->us_configuration.feedback_voice_state = list_item->chk_status;
- const char *str = getBoleanText(ad->us_configuration.feedback_voice_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON"),
+ const char *str = getBoleanText(self->context_->us_configuration.feedback_voice_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON"),
_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- ad->universal_switch_feedback_voice->sub_desc = str ? str : std::string{};
- elm_genlist_item_update(ad->universal_switch_feedback_voice->item);
+ self->universal_switch_feedback_voice->sub_desc = str ? str : std::string{};
+ elm_genlist_item_update(self->universal_switch_feedback_voice->item);
}
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_STATE, (bool *)&list_item->chk_status, NULL, NULL);
void UniversalSwitchSettingsPage::feedbackSoundCb(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility *>(data);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
- retm_if(ad == NULL, "Data argument is NULL");
- std::string str = std::to_string(ad->us_configuration.feedback_sound_volume) + "%";
+ std::string str = std::to_string(self->context_->us_configuration.feedback_sound_volume) + "%";
- ad->setValuePage_ = std::make_unique<SetValuePage>(ad, ValueEditorType::LIST_SWITCH, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_SOUND"));
- SetValuePage::setSwitch(ad, ad->us_configuration.feedback_sound_state);
- SetValuePage::setDescription(ad, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_FEEDBACK_SOUND"));
- SetValuePage::addSwitchChangedCb(ad, feedbackSoundSwitchChangedCb);
- ad->universal_switch_feedback_sound_volume = SetValuePage::addRadioListItem(ad,
+ self->setValuePage_ = std::make_unique<SetValuePage>(self->context_, ValueEditorType::LIST_SWITCH, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_SOUND"));
+ SetValuePage::setSwitch(self->context_, self->context_->us_configuration.feedback_sound_state);
+ SetValuePage::setDescription(self->context_, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_FEEDBACK_SOUND"));
+ SetValuePage::addSwitchChangedCb(self->context_, feedbackSoundSwitchChangedCb, self);
+ self->universal_switch_feedback_sound_volume = SetValuePage::addRadioListItem(self->context_,
_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_SOUND_VOLUME"), str.c_str(), 0);
- SetValuePage::addListItemOptionsRequestCb(ad, feedbackSoundItemOptionsRequestCb);
- int vconf_ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_SOUND_STATE, SetValuePage::syncPageWithVconf, ad);
+ SetValuePage::addListItemOptionsRequestCb(self->context_, feedbackSoundItemOptionsRequestCb, self);
+ int vconf_ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_SOUND_STATE, SetValuePage::syncPageWithVconf, self->context_);
if (vconf_ret)
SETTING_TRACE_ERROR("FAIL: vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_SOUND_STATE)");
}
-void UniversalSwitchSettingsPage::feedbackSoundItemOptionsRequestCb(SettingAccessibility *ad, int option_id)
+void UniversalSwitchSettingsPage::feedbackSoundItemOptionsRequestCb(void *data, int option_id)
{
- ad->setValuePage_ = std::make_unique<SetValuePage>(ad, ValueEditorType::RADIOS, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_SOUND_VOLUME"));
- SetValuePage::addRadioItemChangedCb(ad, feedbackSoundVolumeChangedCb);
- elm_naviframe_item_pop_cb_set(elm_naviframe_top_item_get(ad->md.getNaviframe()->getObject()), NULL, NULL);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
+ self->setValuePage_ = std::make_unique<SetValuePage>(self->context_, ValueEditorType::RADIOS, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_SOUND_VOLUME"));
+ SetValuePage::addRadioItemChangedCb(self->context_, feedbackSoundVolumeChangedCb, self);
+ elm_naviframe_item_pop_cb_set(elm_naviframe_top_item_get(self->context_->md.getNaviframe()->getObject()), NULL, NULL);
int i;
for (i = 0; i < MEDIA_LEVEL_COUNT; i++)
- SetValuePage::addRadioItem(ad, _media_level[i].key, i, _media_level[i].id == ad->us_configuration.feedback_sound_volume);
+ SetValuePage::addRadioItem(self->context_, _media_level[i].key, i, _media_level[i].id == self->context_->us_configuration.feedback_sound_volume);
}
-void UniversalSwitchSettingsPage::feedbackSoundVolumeChangedCb(SettingAccessibility *ad, int item_id)
+void UniversalSwitchSettingsPage::feedbackSoundVolumeChangedCb(void *data, int item_id)
{
- retm_if(ad == NULL, "Data argument is NULL");
+ retm_if(data == NULL, "Data argument is NULL");
retm_if(item_id < 0 || item_id >= MEDIA_LEVEL_COUNT, "Invalid item_id");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
- ad->us_configuration.feedback_sound_volume = _media_level[item_id].id;
+ self->context_->us_configuration.feedback_sound_volume = _media_level[item_id].id;
double media_level = _media_level[item_id].id / 100.0;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_SOUND_VOLUME, NULL, NULL, &media_level);
- ad->universal_switch_feedback_sound_volume->sub_desc = _media_level[item_id].key ? _media_level[item_id].key : std::string{};
- elm_genlist_item_update(ad->universal_switch_feedback_sound_volume->item);
+ self->universal_switch_feedback_sound_volume->sub_desc = _media_level[item_id].key ? _media_level[item_id].key : std::string{};
+ elm_genlist_item_update(self->universal_switch_feedback_sound_volume->item);
}
-void UniversalSwitchSettingsPage::feedbackSoundSwitchChangedCb(SettingAccessibility *ad, bool state)
+void UniversalSwitchSettingsPage::feedbackSoundSwitchChangedCb(void *data, bool state)
{
+ retm_if(data == NULL, "Data argument is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
const char *str = NULL;
- retm_if(ad == NULL, "Data argument is NULL");
- ad->us_configuration.feedback_sound_state = state;
+ self->context_->us_configuration.feedback_sound_state = state;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_SOUND_STATE, &state, NULL, NULL);
- if (ad->us_configuration.feedback_sound_state)
+ if (self->context_->us_configuration.feedback_sound_state)
str = _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON");
else
str = _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF");
- ad->universal_switch_feedback_sound->chk_status = state;
- elm_check_state_set(ad->universal_switch_feedback_sound->eo_check, state);
- ad->universal_switch_feedback_sound->sub_desc = str ? str : std::string{};
- elm_genlist_item_update(ad->universal_switch_feedback_sound->item);
+ self->universal_switch_feedback_sound->chk_status = state;
+ elm_check_state_set(self->universal_switch_feedback_sound->eo_check, state);
+ self->universal_switch_feedback_sound->sub_desc = str ? str : std::string{};
+ elm_genlist_item_update(self->universal_switch_feedback_sound->item);
}
void UniversalSwitchSettingsPage::feedbackSoundCheckboxCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
auto list_item = static_cast<GenGroupItemData *>(data);
- auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(list_item->userdata);
list_item->chk_status = elm_check_state_get(obj);
- if (ad) {
- ad->us_configuration.feedback_sound_state = list_item->chk_status;
+ if (self) {
+ self->context_->us_configuration.feedback_sound_state = list_item->chk_status;
- const char *str = getBoleanText(ad->us_configuration.feedback_sound_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON"),
+ const char *str = getBoleanText(self->context_->us_configuration.feedback_sound_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON"),
_("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- ad->universal_switch_feedback_sound->sub_desc = str ? str : std::string{};
- elm_genlist_item_update(ad->universal_switch_feedback_sound->item);
+ self->universal_switch_feedback_sound->sub_desc = str ? str : std::string{};
+ elm_genlist_item_update(self->universal_switch_feedback_sound->item);
}
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_SOUND_STATE, (bool *)&list_item->chk_status, NULL, NULL);
void UniversalSwitchSettingsPage::cursorColorCb(void *data, Evas_Object *obj, void *event_info)
{
- int i;
- auto ad = static_cast<SettingAccessibility *>(data);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
- retm_if(ad == NULL, "Data argument is NULL");
- ad->setValuePage_ = std::make_unique<SetValuePage>(ad, ValueEditorType::RADIOS, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_CURSOR_CL"));
- SetValuePage::addRadioItemChangedCb(ad, cursorColorListItemChangedCb);
- elm_naviframe_item_pop_cb_set(elm_naviframe_top_item_get(ad->md.getNaviframe()->getObject()), NULL, NULL);
+ self->setValuePage_ = std::make_unique<SetValuePage>(self->context_, ValueEditorType::RADIOS, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_CURSOR_CL"));
+ SetValuePage::addRadioItemChangedCb(self->context_, cursorColorListItemChangedCb, self);
+ elm_naviframe_item_pop_cb_set(elm_naviframe_top_item_get(self->context_->md.getNaviframe()->getObject()), NULL, NULL);
- for (i = 0; i < CURSOR_COLORS_COUNT; i++)
- SetValuePage::addRadioItem(ad, _cursor_color[i].key, i, _cursor_color[i].id == ad->us_configuration.cursor_color);
+ for (auto i = 0u; i < CURSOR_COLORS_COUNT; i++)
+ SetValuePage::addRadioItem(self->context_, _cursor_color[i].key, i, _cursor_color[i].id == self->context_->us_configuration.cursor_color);
}
-void UniversalSwitchSettingsPage::cursorColorListItemChangedCb(SettingAccessibility *ad, int item_id)
+void UniversalSwitchSettingsPage::cursorColorListItemChangedCb(void *data, int item_id)
{
- retm_if(ad == NULL, "Data argument is NULL");
+ retm_if(data == NULL, "Data argument is NULL");
retm_if(item_id < 0 || item_id >= CURSOR_COLORS_COUNT, "Invalid cursor color id");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
- ad->us_configuration.cursor_color = _cursor_color[item_id].id;
- updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_CURSOR_COLOR, NULL, &ad->us_configuration.cursor_color, NULL);
+ self->context_->us_configuration.cursor_color = _cursor_color[item_id].id;
+ updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_CURSOR_COLOR, NULL, &self->context_->us_configuration.cursor_color, NULL);
- ad->universal_switch_feedback_cursor_cl->sub_desc = _cursor_color[item_id].key ? _cursor_color[item_id].key : std::string{};
- elm_genlist_item_update(ad->universal_switch_feedback_cursor_cl->item);
+ self->universal_switch_feedback_cursor_cl->sub_desc = _cursor_color[item_id].key ? _cursor_color[item_id].key : std::string{};
+ elm_genlist_item_update(self->universal_switch_feedback_cursor_cl->item);
}
void UniversalSwitchSettingsPage::autoTapKbdCheckboxCb(void *data, Evas_Object *obj, void *event_info)
void UniversalSwitchSettingsPage::autoMoveIntervalCb(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility *>(data);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
- retm_if(ad == NULL, "Data argument is NULL");
- ad->setValuePage_ = std::make_unique<SetValuePage>(ad, ValueEditorType::NUMERIC_SWITCH, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_MOVE_INT"));
- SetValuePage::setSwitch(ad, ad->us_configuration.auto_move_int_state);
- SetValuePage::addValueChangedCb(ad, autoMoveIntervalValueChangedCb);
- SetValuePage::addSwitchChangedCb(ad, autoMoveIntervalSwitchChangedCb);
- SetValuePage::setDescription(ad, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_AUTO_MOVE_INT"));
- SetValuePage::setRange(ad, RANGE_MIN_AUTO_MOVE_INT, RANGE_MAX_AUTO_MOVE_INT, STEP_AUTO_MOVE_INT);
- SetValuePage::setValue(ad, ad->us_configuration.auto_move_int_value, "seconds");
+ self->setValuePage_ = std::make_unique<SetValuePage>(self->context_, ValueEditorType::NUMERIC_SWITCH, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_MOVE_INT"));
+ SetValuePage::setSwitch(self->context_, self->context_->us_configuration.auto_move_int_state);
+ SetValuePage::addValueChangedCb(self->context_, autoMoveIntervalValueChangedCb, self);
+ SetValuePage::addSwitchChangedCb(self->context_, autoMoveIntervalSwitchChangedCb, self);
+ SetValuePage::setDescription(self->context_, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_AUTO_MOVE_INT"));
+ SetValuePage::setRange(self->context_, RANGE_MIN_AUTO_MOVE_INT, RANGE_MAX_AUTO_MOVE_INT, STEP_AUTO_MOVE_INT);
+ SetValuePage::setValue(self->context_, self->context_->us_configuration.auto_move_int_value, "seconds");
}
-void UniversalSwitchSettingsPage::autoMoveIntervalSwitchChangedCb(SettingAccessibility *ad, bool state)
+void UniversalSwitchSettingsPage::autoMoveIntervalSwitchChangedCb(void *data, bool state)
{
- retm_if(ad == NULL, "Data argument is NULL");
+ retm_if(data == NULL, "Data argument is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
- ad->us_configuration.auto_move_int_state = state;
+ self->context_->us_configuration.auto_move_int_state = state;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_MOVE_INT_STATE, &state, NULL, NULL);
- ad->universal_switch_auto_move_int->chk_status = state;
- elm_check_state_set(ad->universal_switch_auto_move_int->eo_check, state);
- ad->universal_switch_auto_move_int->sub_desc = getValueUnitText(NULL, &ad->us_configuration.auto_move_int_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.auto_move_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- elm_genlist_item_update(ad->universal_switch_auto_move_int->item);
+ self->universal_switch_auto_move_int->chk_status = state;
+ elm_check_state_set(self->universal_switch_auto_move_int->eo_check, state);
+ self->universal_switch_auto_move_int->sub_desc = getValueUnitText(NULL, &self->context_->us_configuration.auto_move_int_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !self->context_->us_configuration.auto_move_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ elm_genlist_item_update(self->universal_switch_auto_move_int->item);
}
void UniversalSwitchSettingsPage::autoTapCb(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility *>(data);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
- retm_if(ad == NULL, "Data argument is NULL");
- ad->setValuePage_ = std::make_unique<SetValuePage>(ad, ValueEditorType::NUMERIC_SWITCH, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_TAP"));
- SetValuePage::setSwitch(ad, ad->us_configuration.auto_tap_state);
- SetValuePage::addValueChangedCb(ad, autoTapValueChangedCb);
- SetValuePage::addSwitchChangedCb(ad, autoTapSwitchChangedCb);
- SetValuePage::setDescription(ad, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_AUTO_TAP"));
- SetValuePage::setRange(ad, RANGE_MIN_AUTO_TAP, RANGE_MAX_AUTO_TAP, STEP_AUTO_TAP);
- SetValuePage::setValue(ad, ad->us_configuration.auto_tap_value, "seconds");
+ self->setValuePage_ = std::make_unique<SetValuePage>(self->context_, ValueEditorType::NUMERIC_SWITCH, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_TAP"));
+ SetValuePage::setSwitch(self->context_, self->context_->us_configuration.auto_tap_state);
+ SetValuePage::addValueChangedCb(self->context_, autoTapValueChangedCb, self);
+ SetValuePage::addSwitchChangedCb(self->context_, autoTapSwitchChangedCb, self);
+ SetValuePage::setDescription(self->context_, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_AUTO_TAP"));
+ SetValuePage::setRange(self->context_, RANGE_MIN_AUTO_TAP, RANGE_MAX_AUTO_TAP, STEP_AUTO_TAP);
+ SetValuePage::setValue(self->context_, self->context_->us_configuration.auto_tap_value, "seconds");
}
-void UniversalSwitchSettingsPage::autoTapSwitchChangedCb(SettingAccessibility *ad, bool state)
+void UniversalSwitchSettingsPage::autoTapSwitchChangedCb(void *data, bool state)
{
- retm_if(ad == NULL, "Data argument is NULL");
+ retm_if(data == NULL, "Data argument is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
- ad->us_configuration.auto_tap_state = state;
+ self->context_->us_configuration.auto_tap_state = state;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_TAP_STATE, &state, NULL, NULL);
- ad->universal_switch_auto_tap->chk_status = state;
- elm_check_state_set(ad->universal_switch_auto_tap->eo_check, state);
- ad->universal_switch_auto_tap->sub_desc = getValueUnitText(NULL, &ad->us_configuration.auto_tap_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.auto_tap_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- elm_genlist_item_update(ad->universal_switch_auto_tap->item);
+ self->universal_switch_auto_tap->chk_status = state;
+ elm_check_state_set(self->universal_switch_auto_tap->eo_check, state);
+ self->universal_switch_auto_tap->sub_desc = getValueUnitText(NULL, &self->context_->us_configuration.auto_tap_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !self->context_->us_configuration.auto_tap_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ elm_genlist_item_update(self->universal_switch_auto_tap->item);
}
-void UniversalSwitchSettingsPage::autoTapValueChangedCb(SettingAccessibility *ad, double value)
+void UniversalSwitchSettingsPage::autoTapValueChangedCb(void *data, double value)
{
- retm_if(ad == NULL, "Data argument is NULL");
+ retm_if(data == NULL, "Data argument is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
- ad->us_configuration.auto_tap_value = value;
+ self->context_->us_configuration.auto_tap_value = value;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_TAP_VALUE, NULL, NULL, &value);
- ad->universal_switch_auto_tap->sub_desc = getValueUnitText(NULL, &ad->us_configuration.auto_tap_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.auto_tap_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- elm_genlist_item_update(ad->universal_switch_auto_tap->item);
+ self->universal_switch_auto_tap->sub_desc = getValueUnitText(NULL, &self->context_->us_configuration.auto_tap_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !self->context_->us_configuration.auto_tap_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ elm_genlist_item_update(self->universal_switch_auto_tap->item);
}
void UniversalSwitchSettingsPage::autoTapCheckboxCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
auto list_item = static_cast<GenGroupItemData *>(data);
- auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
- retm_if(ad == NULL, "View data parameter is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(list_item->userdata);
list_item->chk_status = elm_check_state_get(obj);
- ad->us_configuration.auto_tap_state = list_item->chk_status;
+ self->context_->us_configuration.auto_tap_state = list_item->chk_status;
- ad->universal_switch_auto_tap->sub_desc = getValueUnitText(NULL, &ad->us_configuration.auto_tap_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.auto_tap_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- elm_genlist_item_update(ad->universal_switch_auto_tap->item);
+ self->universal_switch_auto_tap->sub_desc = getValueUnitText(NULL, &self->context_->us_configuration.auto_tap_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !self->context_->us_configuration.auto_tap_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ elm_genlist_item_update(self->universal_switch_auto_tap->item);
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_TAP_STATE, (bool *)&list_item->chk_status, NULL, NULL);
}
void UniversalSwitchSettingsPage::sglInactionIntervalCb(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility *>(data);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
- retm_if(ad == NULL, "Data argument is NULL");
- ad->setValuePage_ = std::make_unique<SetValuePage>(ad, ValueEditorType::NUMERIC_SWITCH, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_SGL_IACTION_INT"));
- SetValuePage::setSwitch(ad, ad->us_configuration.sgl_iaction_int_state);
- SetValuePage::addValueChangedCb(ad, sglInactionIntervalValueChangedCb);
- SetValuePage::addSwitchChangedCb(ad, sglInactionIntervalSwitchChangedCb);
- SetValuePage::setDescription(ad, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_SGL_IACTION_INT"));
- SetValuePage::setRange(ad, RANGE_MIN_SGL_IACTION_INT, RANGE_MAX_SGL_IACTION_INT, STEP_SGL_IACTION_INT);
- SetValuePage::setValue(ad, ad->us_configuration.sgl_iaction_int_value, "seconds");
+ self->setValuePage_ = std::make_unique<SetValuePage>(self->context_, ValueEditorType::NUMERIC_SWITCH, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_SGL_IACTION_INT"));
+ SetValuePage::setSwitch(self->context_, self->context_->us_configuration.sgl_iaction_int_state);
+ SetValuePage::addValueChangedCb(self->context_, sglInactionIntervalValueChangedCb, self);
+ SetValuePage::addSwitchChangedCb(self->context_, sglInactionIntervalSwitchChangedCb, self);
+ SetValuePage::setDescription(self->context_, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_SGL_IACTION_INT"));
+ SetValuePage::setRange(self->context_, RANGE_MIN_SGL_IACTION_INT, RANGE_MAX_SGL_IACTION_INT, STEP_SGL_IACTION_INT);
+ SetValuePage::setValue(self->context_, self->context_->us_configuration.sgl_iaction_int_value, "seconds");
}
-void UniversalSwitchSettingsPage::sglInactionIntervalSwitchChangedCb(SettingAccessibility *ad, bool state)
+void UniversalSwitchSettingsPage::sglInactionIntervalSwitchChangedCb(void *data, bool state)
{
- retm_if(ad == NULL, "Data argument is NULL");
+ retm_if(data == NULL, "Data argument is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
- ad->us_configuration.sgl_iaction_int_state = state;
+ self->context_->us_configuration.sgl_iaction_int_state = state;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SGL_IACTION_INT_STATE, &state, NULL, NULL);
- ad->universal_switch_sgl_iaction_int->chk_status = state;
- elm_check_state_set(ad->universal_switch_sgl_iaction_int->eo_check, state);
- ad->universal_switch_sgl_iaction_int->sub_desc = getValueUnitText(NULL, &ad->us_configuration.sgl_iaction_int_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.sgl_iaction_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- elm_genlist_item_update(ad->universal_switch_sgl_iaction_int->item);
+ self->universal_switch_sgl_iaction_int->chk_status = state;
+ elm_check_state_set(self->universal_switch_sgl_iaction_int->eo_check, state);
+ self->universal_switch_sgl_iaction_int->sub_desc = getValueUnitText(NULL, &self->context_->us_configuration.sgl_iaction_int_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !self->context_->us_configuration.sgl_iaction_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ elm_genlist_item_update(self->universal_switch_sgl_iaction_int->item);
}
-void UniversalSwitchSettingsPage::sglInactionIntervalValueChangedCb(SettingAccessibility *ad, double value)
+void UniversalSwitchSettingsPage::sglInactionIntervalValueChangedCb(void *data, double value)
{
- retm_if(ad == NULL, "Data argument is NULL");
+ retm_if(data == NULL, "Data argument is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
- ad->us_configuration.sgl_iaction_int_value = value;
+ self->context_->us_configuration.sgl_iaction_int_value = value;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SGL_IACTION_INT_VALUE, NULL, NULL, &value);
- ad->universal_switch_sgl_iaction_int->sub_desc = getValueUnitText(NULL, &ad->us_configuration.sgl_iaction_int_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.sgl_iaction_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- elm_genlist_item_update(ad->universal_switch_sgl_iaction_int->item);
+ self->universal_switch_sgl_iaction_int->sub_desc = getValueUnitText(NULL, &self->context_->us_configuration.sgl_iaction_int_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !self->context_->us_configuration.sgl_iaction_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ elm_genlist_item_update(self->universal_switch_sgl_iaction_int->item);
}
void UniversalSwitchSettingsPage::sglInactionIntervalCheckboxCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
auto list_item = static_cast<GenGroupItemData *>(data);
- auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
- retm_if(ad == NULL, "View data parameter is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(list_item->userdata);
list_item->chk_status = elm_check_state_get(obj);
- ad->us_configuration.sgl_iaction_int_state = list_item->chk_status;
+ self->context_->us_configuration.sgl_iaction_int_state = list_item->chk_status;
- ad->universal_switch_sgl_iaction_int->sub_desc = getValueUnitText(NULL, &ad->us_configuration.sgl_iaction_int_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.sgl_iaction_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- elm_genlist_item_update(ad->universal_switch_sgl_iaction_int->item);
+ self->universal_switch_sgl_iaction_int->sub_desc = getValueUnitText(NULL, &self->context_->us_configuration.sgl_iaction_int_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !self->context_->us_configuration.sgl_iaction_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ elm_genlist_item_update(self->universal_switch_sgl_iaction_int->item);
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SGL_IACTION_INT_STATE, (bool *)&list_item->chk_status, NULL, NULL);
}
void UniversalSwitchSettingsPage::tapDurationCb(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility *>(data);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
- retm_if(ad == NULL, "Data argument is NULL");
- ad->setValuePage_ = std::make_unique<SetValuePage>(ad, ValueEditorType::NUMERIC_SWITCH, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_TAP_DURATION"));
- SetValuePage::setSwitch(ad, ad->us_configuration.tap_duration_state);
- SetValuePage::addValueChangedCb(ad, tapDurationValueChangedCb);
- SetValuePage::addSwitchChangedCb(ad, tapDurationSwitchChangedCb);
- SetValuePage::setDescription(ad, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_TAP_DURATION"));
- SetValuePage::setRange(ad, RANGE_MIN_TAP_DURATION, RANGE_MAX_TAP_DURATION, STEP_TAP_DURATION);
- SetValuePage::setValue(ad, ad->us_configuration.tap_duration_value, "seconds");
+ self->setValuePage_ = std::make_unique<SetValuePage>(self->context_, ValueEditorType::NUMERIC_SWITCH, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_TAP_DURATION"));
+ SetValuePage::setSwitch(self->context_, self->context_->us_configuration.tap_duration_state);
+ SetValuePage::addValueChangedCb(self->context_, tapDurationValueChangedCb, self);
+ SetValuePage::addSwitchChangedCb(self->context_, tapDurationSwitchChangedCb, self);
+ SetValuePage::setDescription(self->context_, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_TAP_DURATION"));
+ SetValuePage::setRange(self->context_, RANGE_MIN_TAP_DURATION, RANGE_MAX_TAP_DURATION, STEP_TAP_DURATION);
+ SetValuePage::setValue(self->context_, self->context_->us_configuration.tap_duration_value, "seconds");
}
-void UniversalSwitchSettingsPage::tapDurationSwitchChangedCb(SettingAccessibility *ad, bool state)
+void UniversalSwitchSettingsPage::tapDurationSwitchChangedCb(void *data, bool state)
{
- retm_if(ad == NULL, "Data argument is NULL");
+ retm_if(data == NULL, "Data argument is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
- ad->us_configuration.tap_duration_state = state;
+ self->context_->us_configuration.tap_duration_state = state;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_TAP_DURATION_STATE, &state, NULL, NULL);
- ad->universal_switch_tap_duration->chk_status = state;
- elm_check_state_set(ad->universal_switch_tap_duration->eo_check, state);
- ad->universal_switch_tap_duration->sub_desc = getValueUnitText(NULL, &ad->us_configuration.tap_duration_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.tap_duration_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- elm_genlist_item_update(ad->universal_switch_tap_duration->item);
+ self->universal_switch_tap_duration->chk_status = state;
+ elm_check_state_set(self->universal_switch_tap_duration->eo_check, state);
+ self->universal_switch_tap_duration->sub_desc = getValueUnitText(NULL, &self->context_->us_configuration.tap_duration_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !self->context_->us_configuration.tap_duration_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ elm_genlist_item_update(self->universal_switch_tap_duration->item);
}
-void UniversalSwitchSettingsPage::tapDurationValueChangedCb(SettingAccessibility *ad, double value)
+void UniversalSwitchSettingsPage::tapDurationValueChangedCb(void *data, double value)
{
- retm_if(ad == NULL, "Data argument is NULL");
+ retm_if(data == NULL, "Data argument is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
- ad->us_configuration.tap_duration_value = value;
+ self->context_->us_configuration.tap_duration_value = value;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_TAP_DURATION_VALUE, NULL, NULL, &value);
- ad->universal_switch_tap_duration->sub_desc = getValueUnitText(NULL, &ad->us_configuration.tap_duration_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.tap_duration_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- elm_genlist_item_update(ad->universal_switch_tap_duration->item);
+ self->universal_switch_tap_duration->sub_desc = getValueUnitText(NULL, &self->context_->us_configuration.tap_duration_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !self->context_->us_configuration.tap_duration_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ elm_genlist_item_update(self->universal_switch_tap_duration->item);
}
void UniversalSwitchSettingsPage::tapDurationCheckboxCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
auto list_item = static_cast<GenGroupItemData *>(data);
- auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
- retm_if(ad == NULL, "View data parameter is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(list_item->userdata);
list_item->chk_status = elm_check_state_get(obj);
- ad->us_configuration.tap_duration_state = list_item->chk_status;
+ self->context_->us_configuration.tap_duration_state = list_item->chk_status;
- ad->universal_switch_tap_duration->sub_desc = getValueUnitText(NULL, &ad->us_configuration.tap_duration_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.tap_duration_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- elm_genlist_item_update(ad->universal_switch_tap_duration->item);
+ self->universal_switch_tap_duration->sub_desc = getValueUnitText(NULL, &self->context_->us_configuration.tap_duration_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !self->context_->us_configuration.tap_duration_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ elm_genlist_item_update(self->universal_switch_tap_duration->item);
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_TAP_DURATION_STATE, (bool *)&list_item->chk_status, NULL, NULL);
}
void UniversalSwitchSettingsPage::pauseOnFirstCb(void *data, Evas_Object *obj, void *event_info)
{
char str[512] = {0,};
- auto ad = static_cast<SettingAccessibility *>(data);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
- retm_if(ad == NULL, "Data argument is NULL");
- auto ret = snprintf(str, sizeof(str), _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_PAUSE_ON_FIRST"), ad->us_configuration.auto_scan_interval, ad->us_configuration.auto_scan_interval + ad->us_configuration.pause_on_first_value);
+ auto ret = snprintf(str, sizeof(str), _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_PAUSE_ON_FIRST"), self->context_->us_configuration.auto_scan_interval, self->context_->us_configuration.auto_scan_interval + self->context_->us_configuration.pause_on_first_value);
if (ret > 511) {
SETTING_TRACE_ERROR("snprintf failed");
return;
}
- ad->setValuePage_ = std::make_unique<SetValuePage>(ad, ValueEditorType::NUMERIC_SWITCH, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_PAUSE_ON_FIRST"));
- SetValuePage::setSwitch(ad, ad->us_configuration.pause_on_first_state);
- SetValuePage::addValueChangedCb(ad, pauseOnFirstValueChangedCb);
- SetValuePage::addSwitchChangedCb(ad, pauseOnFirstSwitchChangedCb);
- SetValuePage::setDescription(ad, str);
- SetValuePage::setRange(ad, RANGE_MIN_PAUSE_ON_FIRST, RANGE_MAX_PAUSE_ON_FIRST, STEP_PAUSE_ON_FIRST);
- SetValuePage::setValue(ad, ad->us_configuration.pause_on_first_value, "seconds");
+ self->setValuePage_ = std::make_unique<SetValuePage>(self->context_, ValueEditorType::NUMERIC_SWITCH, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_PAUSE_ON_FIRST"));
+ SetValuePage::setSwitch(self->context_, self->context_->us_configuration.pause_on_first_state);
+ SetValuePage::addValueChangedCb(self->context_, pauseOnFirstValueChangedCb, self);
+ SetValuePage::addSwitchChangedCb(self->context_, pauseOnFirstSwitchChangedCb, self);
+ SetValuePage::setDescription(self->context_, str);
+ SetValuePage::setRange(self->context_, RANGE_MIN_PAUSE_ON_FIRST, RANGE_MAX_PAUSE_ON_FIRST, STEP_PAUSE_ON_FIRST);
+ SetValuePage::setValue(self->context_, self->context_->us_configuration.pause_on_first_value, "seconds");
}
-void UniversalSwitchSettingsPage::pauseOnFirstSwitchChangedCb(SettingAccessibility *ad, bool state)
+void UniversalSwitchSettingsPage::pauseOnFirstSwitchChangedCb(void *data, bool state)
{
- retm_if(ad == NULL, "Data argument is NULL");
+ retm_if(data == NULL, "Data argument is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
- ad->us_configuration.pause_on_first_state = state;
+ self->context_->us_configuration.pause_on_first_state = state;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_PAUSE_ON_FIRST_STATE, &state, NULL, NULL);
- ad->universal_switch_pause_on_first->chk_status = state;
- elm_check_state_set(ad->universal_switch_pause_on_first->eo_check, state);
- ad->universal_switch_pause_on_first->sub_desc = getValueUnitText(NULL, &ad->us_configuration.pause_on_first_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.pause_on_first_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- elm_genlist_item_update(ad->universal_switch_pause_on_first->item);
+ self->universal_switch_pause_on_first->chk_status = state;
+ elm_check_state_set(self->universal_switch_pause_on_first->eo_check, state);
+ self->universal_switch_pause_on_first->sub_desc = getValueUnitText(NULL, &self->context_->us_configuration.pause_on_first_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !self->context_->us_configuration.pause_on_first_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ elm_genlist_item_update(self->universal_switch_pause_on_first->item);
}
-void UniversalSwitchSettingsPage::pauseOnFirstValueChangedCb(SettingAccessibility *ad, double value)
+void UniversalSwitchSettingsPage::pauseOnFirstValueChangedCb(void *data, double value)
{
- retm_if(ad == NULL, "Data argument is NULL");
+ retm_if(data == NULL, "Data argument is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
- ad->us_configuration.pause_on_first_value = value;
+ self->context_->us_configuration.pause_on_first_value = value;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_PAUSE_ON_FIRST_VALUE, NULL, NULL, &value);
- ad->universal_switch_pause_on_first->sub_desc = getValueUnitText(NULL, &ad->us_configuration.pause_on_first_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.pause_on_first_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- elm_genlist_item_update(ad->universal_switch_pause_on_first->item);
+ self->universal_switch_pause_on_first->sub_desc = getValueUnitText(NULL, &self->context_->us_configuration.pause_on_first_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !self->context_->us_configuration.pause_on_first_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ elm_genlist_item_update(self->universal_switch_pause_on_first->item);
}
void UniversalSwitchSettingsPage::pauseOnFirstCheckboxCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
auto list_item = static_cast<GenGroupItemData *>(data);
- auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
- retm_if(ad == NULL, "View data parameter is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(list_item->userdata);
list_item->chk_status = elm_check_state_get(obj);
- ad->us_configuration.pause_on_first_state = list_item->chk_status;
+ self->context_->us_configuration.pause_on_first_state = list_item->chk_status;
- ad->universal_switch_pause_on_first->sub_desc = getValueUnitText(NULL, &ad->us_configuration.pause_on_first_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.pause_on_first_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- elm_genlist_item_update(ad->universal_switch_pause_on_first->item);
+ self->universal_switch_pause_on_first->sub_desc = getValueUnitText(NULL, &self->context_->us_configuration.pause_on_first_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !self->context_->us_configuration.pause_on_first_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ elm_genlist_item_update(self->universal_switch_pause_on_first->item);
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_PAUSE_ON_FIRST_STATE, (bool *)&list_item->chk_status, NULL, NULL);
}
void UniversalSwitchSettingsPage::scanSpeedCb(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility *>(data);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
- retm_if(ad == NULL, "Data argument is NULL");
- ad->setValuePage_ = std::make_unique<SetValuePage>(ad, ValueEditorType::NUMERIC, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_PT_SPEED"));
- SetValuePage::addValueChangedCb(ad, scanSpeedChangedCb);
- SetValuePage::setDescription(ad, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_SCAN_SPEED"));
- SetValuePage::setRange(ad, RANGE_MIN_SCAN_SPEED, RANGE_MAX_SCAN_SPEED, STEP_SCAN_SPEED);
- SetValuePage::setValue(ad, ad->us_configuration.scan_pt_speed, "");
+ self->setValuePage_ = std::make_unique<SetValuePage>(self->context_, ValueEditorType::NUMERIC, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_PT_SPEED"));
+ SetValuePage::addValueChangedCb(self->context_, scanSpeedChangedCb, self);
+ SetValuePage::setDescription(self->context_, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_SCAN_SPEED"));
+ SetValuePage::setRange(self->context_, RANGE_MIN_SCAN_SPEED, RANGE_MAX_SCAN_SPEED, STEP_SCAN_SPEED);
+ SetValuePage::setValue(self->context_, self->context_->us_configuration.scan_pt_speed, "");
}
-void UniversalSwitchSettingsPage::scanSpeedChangedCb(SettingAccessibility *ad, double value)
+void UniversalSwitchSettingsPage::scanSpeedChangedCb(void *data, double value)
{
+ retm_if(data == NULL, "Data argument is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
int int_value = (int)value;
- retm_if(ad == NULL, "Data argument is NULL");
- ad->us_configuration.scan_pt_speed = (int)value;
+ self->context_->us_configuration.scan_pt_speed = (int)value;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SCAN_PT_SPEED, NULL, &int_value, NULL);
- ad->universal_switch_scan_speed->sub_desc = getValueUnitText(&int_value, NULL, NULL, false, NULL);
- elm_genlist_item_update(ad->universal_switch_scan_speed->item);
+ self->universal_switch_scan_speed->sub_desc = getValueUnitText(&int_value, NULL, NULL, false, NULL);
+ elm_genlist_item_update(self->universal_switch_scan_speed->item);
}
void UniversalSwitchSettingsPage::scanDirectionCb(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *ctxpopup;
- auto ad = static_cast<SettingAccessibility *>(data);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
- retm_if(ad == NULL, "Data argument is NULL");
- ctxpopup = createCtxPopup(ad);
+ ctxpopup = self->createCtxPopup();
elm_ctxpopup_item_append(ctxpopup, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_DIR_TB"), NULL, ScanDirectionCtxPopupCb, (void *)ScanDirection::TO_BOTTOM);
elm_ctxpopup_item_append(ctxpopup, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_DIR_BT"), NULL, ScanDirectionCtxPopupCb, (void *)ScanDirection::TO_TOP);
- setCtxPopupPosition(ad, ctxpopup);
+ setCtxPopupPosition(self->context_, ctxpopup);
evas_object_show(ctxpopup);
}
void UniversalSwitchSettingsPage::scanMethodCb(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *ctxpopup;
- auto ad = static_cast<SettingAccessibility *>(data);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
- retm_if(ad == NULL, "Data argument is NULL");
- ctxpopup = createCtxPopup(ad);
+ ctxpopup = self->createCtxPopup();
elm_ctxpopup_item_append(ctxpopup, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_METHOD_POINT"), NULL, ScanMethodCtxPopupCb, (void *)ScanMethod::POINT);
elm_ctxpopup_item_append(ctxpopup, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_METHOD_ROW"), NULL, ScanMethodCtxPopupCb, (void *)ScanMethod::ROW);
- setCtxPopupPosition(ad, ctxpopup);
+ setCtxPopupPosition(self->context_, ctxpopup);
evas_object_show(ctxpopup);
}
void UniversalSwitchSettingsPage::scanNumberCb(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility *>(data);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
- retm_if(ad == NULL, "Data argument is NULL");
- ad->setValuePage_ = std::make_unique<SetValuePage>(ad, ValueEditorType::NUMERIC, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_NUM_OF_SCANS"));
- SetValuePage::addValueChangedCb(ad, scanNumberChangedCb);
- SetValuePage::setDescription(ad, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_NUM_OF_SCANS"));
- SetValuePage::setRange(ad, RANGE_MIN_SCANS_NUM, RANGE_MAX_SCANS_NUM, STEP_SCANS_NUM);
- SetValuePage::setValue(ad, ad->us_configuration.auto_scan_num, "times");
+ self->setValuePage_ = std::make_unique<SetValuePage>(self->context_, ValueEditorType::NUMERIC, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_NUM_OF_SCANS"));
+ SetValuePage::addValueChangedCb(self->context_, scanNumberChangedCb, self);
+ SetValuePage::setDescription(self->context_, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_NUM_OF_SCANS"));
+ SetValuePage::setRange(self->context_, RANGE_MIN_SCANS_NUM, RANGE_MAX_SCANS_NUM, STEP_SCANS_NUM);
+ SetValuePage::setValue(self->context_, self->context_->us_configuration.auto_scan_num, "times");
}
-void UniversalSwitchSettingsPage::scanNumberChangedCb(SettingAccessibility *ad, double value)
+void UniversalSwitchSettingsPage::scanNumberChangedCb(void *data, double value)
{
+ retm_if(data == NULL, "Data argument is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
int int_value = (int)value;
- retm_if(ad == NULL, "Data argument is NULL");
- ad->us_configuration.auto_scan_num = (int)value;
+ self->context_->us_configuration.auto_scan_num = (int)value;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_NUM_OF_SCANS, NULL, &int_value, NULL);
- ad->universal_switch_scans_num->sub_desc = getValueUnitText(&int_value, NULL, NULL, false, NULL);
- elm_genlist_item_update(ad->universal_switch_scans_num->item);
+ self->universal_switch_scans_num->sub_desc = getValueUnitText(&int_value, NULL, NULL, false, NULL);
+ elm_genlist_item_update(self->universal_switch_scans_num->item);
}
void UniversalSwitchSettingsPage::autoScanIntervalCb(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility *>(data);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
- retm_if(ad == NULL, "Data argument is NULL");
- ad->setValuePage_ = std::make_unique<SetValuePage>(ad, ValueEditorType::NUMERIC, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_AUTO_SCAN_INT"));
- SetValuePage::addValueChangedCb(ad, autoScanIntervalChangedCb);
- SetValuePage::setDescription(ad, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_AUTO_SCAN_INT"));
- SetValuePage::setRange(ad, RANGE_MIN_AUTO_SCAN_INTERVAL, RANGE_MAX_AUTO_SCAN_INTERVAL, STEP_AUTO_SCAN_INTERVAL);
- SetValuePage::setValue(ad, ad->us_configuration.auto_scan_interval, "seconds");
+ self->setValuePage_ = std::make_unique<SetValuePage>(self->context_, ValueEditorType::NUMERIC, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_AUTO_SCAN_INT"));
+ SetValuePage::addValueChangedCb(self->context_, autoScanIntervalChangedCb, self);
+ SetValuePage::setDescription(self->context_, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SET_VALUE_DESC_AUTO_SCAN_INT"));
+ SetValuePage::setRange(self->context_, RANGE_MIN_AUTO_SCAN_INTERVAL, RANGE_MAX_AUTO_SCAN_INTERVAL, STEP_AUTO_SCAN_INTERVAL);
+ SetValuePage::setValue(self->context_, self->context_->us_configuration.auto_scan_interval, "seconds");
}
-void UniversalSwitchSettingsPage::autoScanIntervalChangedCb(SettingAccessibility *ad, double value)
+void UniversalSwitchSettingsPage::autoScanIntervalChangedCb(void *data, double value)
{
- retm_if(ad == NULL, "Data argument is NULL");
+ retm_if(data == NULL, "Data argument is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
- ad->us_configuration.auto_scan_interval = value;
+ self->context_->us_configuration.auto_scan_interval = value;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_SCAN_INT, NULL, NULL, &value);
- ad->universal_switch_auto_scan_int->sub_desc = getValueUnitText(NULL, &value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"), false, NULL);
- elm_genlist_item_update(ad->universal_switch_auto_scan_int->item);
+ self->universal_switch_auto_scan_int->sub_desc = getValueUnitText(NULL, &value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"), false, NULL);
+ elm_genlist_item_update(self->universal_switch_auto_scan_int->item);
}
void UniversalSwitchSettingsPage::ScanDirectionCtxPopupCb(void *data, Evas_Object *obj, void *event_info)
{
ScanDirection scan_dir = (ScanDirection)reinterpret_cast<long>(data); //TODO change way the argument is being passed
- auto ad = static_cast<SettingAccessibility *>(evas_object_data_get(obj, CTXPOPUP_DATA_AD));
- retm_if(ad == NULL, "ctxpopup data is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(evas_object_data_get(obj, CTXPOPUP_DATA_AD));
+ retm_if(self == NULL, "ctxpopup data is NULL");
if (updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SCAN_DIR_VERTICAL, NULL, (int *)&scan_dir, NULL)) {
if (!updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SCAN_DIR_HORIZONTAL, NULL, (int *)&scan_dir, NULL))
SETTING_TRACE_ERROR("Only one of vconf keys was successfully set. The scanner may malfunction");
- ad->us_configuration.scan_dir = scan_dir;
- ad->universal_switch_scan_dir->sub_desc = getScanDirectionText(scan_dir);
- elm_genlist_item_update(ad->universal_switch_scan_dir->item);
+ self->context_->us_configuration.scan_dir = scan_dir;
+ self->universal_switch_scan_dir->sub_desc = getScanDirectionText(scan_dir);
+ elm_genlist_item_update(self->universal_switch_scan_dir->item);
}
ctxPopupDelCb(NULL, obj, event_info);
void UniversalSwitchSettingsPage::ScanMethodCtxPopupCb(void *data, Evas_Object *obj, void *event_info)
{
ScanMethod scan_method = (ScanMethod)reinterpret_cast<long>(data);//TODO change way the argument is being passed
- auto ad = static_cast<SettingAccessibility *>(evas_object_data_get(obj, CTXPOPUP_DATA_AD));
- retm_if(ad == NULL, "ctxpopup data is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(evas_object_data_get(obj, CTXPOPUP_DATA_AD));
+ retm_if(self == NULL, "ctxpopup data is NULL");
if (updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SCAN_METHOD, NULL, (int *)&scan_method, NULL)) {
- ad->us_configuration.scan_method = scan_method;
- ad->universal_switch_scan_method->sub_desc = getScanMethodText(scan_method);
- elm_genlist_item_update(ad->universal_switch_scan_method->item);
+ self->context_->us_configuration.scan_method = scan_method;
+ self->universal_switch_scan_method->sub_desc = getScanMethodText(scan_method);
+ elm_genlist_item_update(self->universal_switch_scan_method->item);
}
ctxPopupDelCb(NULL, obj, event_info);
{
retm_if(data == NULL, "Data parameter is NULL");
auto list_item = static_cast<GenGroupItemData *>(data);
- auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
- retm_if(ad == NULL, "View data parameter is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(list_item->userdata);
list_item->chk_status = elm_check_state_get(obj);
- ad->us_configuration.auto_scan = list_item->chk_status;
+ self->context_->us_configuration.auto_scan = list_item->chk_status;
- elm_object_item_disabled_set(ad->universal_switch_auto_scan_int->item, (Eina_Bool)!ad->us_configuration.auto_scan);
- elm_object_item_disabled_set(ad->universal_switch_scans_num->item, (Eina_Bool)!ad->us_configuration.auto_scan);
- elm_object_item_disabled_set(ad->universal_switch_pause_on_first->item, (Eina_Bool)!ad->us_configuration.auto_scan);
- elm_object_item_disabled_set(ad->universal_switch_auto_move_int->item, (Eina_Bool)ad->us_configuration.auto_scan);
+ elm_object_item_disabled_set(self->universal_switch_auto_scan_int->item, (Eina_Bool)!self->context_->us_configuration.auto_scan);
+ elm_object_item_disabled_set(self->universal_switch_scans_num->item, (Eina_Bool)!self->context_->us_configuration.auto_scan);
+ elm_object_item_disabled_set(self->universal_switch_pause_on_first->item, (Eina_Bool)!self->context_->us_configuration.auto_scan);
+ elm_object_item_disabled_set(self->universal_switch_auto_move_int->item, (Eina_Bool)self->context_->us_configuration.auto_scan);
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_SCAN_ENABLED, (bool *)&list_item->chk_status, NULL, NULL);
}
void UniversalSwitchSettingsPage::switchesClickCb(void *data, Evas_Object *obj, void *event_info)
{
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
- retm_if(data == NULL, "Data argument is NULL");
- auto ad = static_cast<SettingAccessibility *>(data);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
- ad->switchesPage_ = std::make_unique<SwitchesPage>(ad);
- SwitchesPage::attachCallback(ad, updateSwitchesCount);
+ self->switchesPage_ = std::make_unique<SwitchesPage>(self->context_);
+ SwitchesPage::attachCallback(self->context_, updateSwitchesCount, self);
}
void UniversalSwitchSettingsPage::ctxPopupDelCb(void *data, Evas_Object *obj, void *event_info)
{
- evas_object_data_del(obj, CTXPOPUP_DATA_AD);
evas_object_hide(obj);
evas_object_del(obj);
}
{
auto ad = static_cast<SettingAccessibility *>(data);
retv_if(ad == NULL, EINA_TRUE);
- ad->universal_switch_settings_item = NULL;
vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_SCAN_ENABLED, syncAutoScanWithVconf);
vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_SOUND_STATE, syncSoundFeedbackWithVconf);
vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_STATE, syncVoiceFeedbackWithVconf);
{
retm_if(data == NULL, "Data parameter is NULL");
auto list_item = static_cast<GenGroupItemData *>(data);
- auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
- retm_if(ad == NULL, "View data parameter is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(list_item->userdata);
list_item->chk_status = elm_check_state_get(obj);
- ad->us_configuration.auto_move_int_state = list_item->chk_status;
+ self->context_->us_configuration.auto_move_int_state = list_item->chk_status;
- ad->universal_switch_auto_move_int->sub_desc = getValueUnitText(NULL, &ad->us_configuration.auto_move_int_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.auto_move_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- elm_genlist_item_update(ad->universal_switch_auto_move_int->item);
+ self->universal_switch_auto_move_int->sub_desc = getValueUnitText(NULL, &self->context_->us_configuration.auto_move_int_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !self->context_->us_configuration.auto_move_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ elm_genlist_item_update(self->universal_switch_auto_move_int->item);
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_MOVE_INT_STATE, (bool *)&list_item->chk_status, NULL, NULL);
}
-void UniversalSwitchSettingsPage::autoMoveIntervalValueChangedCb(SettingAccessibility *ad, double value)
+void UniversalSwitchSettingsPage::autoMoveIntervalValueChangedCb(void *data, double value)
{
- retm_if(ad == NULL, "Data argument is NULL");
+ retm_if(data == NULL, "Data argument is NULL");
+ auto self = static_cast<UniversalSwitchSettingsPage *>(data);
- ad->us_configuration.auto_move_int_value = value;
+ self->context_->us_configuration.auto_move_int_value = value;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_MOVE_INT_VALUE, NULL, NULL, &value);
- ad->universal_switch_auto_move_int->sub_desc = getValueUnitText(NULL, &ad->us_configuration.auto_move_int_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
- !ad->us_configuration.auto_move_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
- elm_genlist_item_update(ad->universal_switch_auto_move_int->item);
+ self->universal_switch_auto_move_int->sub_desc = getValueUnitText(NULL, &self->context_->us_configuration.auto_move_int_value, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_SECONDS"),
+ !self->context_->us_configuration.auto_move_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ elm_genlist_item_update(self->universal_switch_auto_move_int->item);
}
void UniversalSwitchSettingsPage::onAutoScanItemSelection(void *data, Evas_Object *obj, void *event_info)
setting_retm_if(list_item == NULL, "Data parameter is NULL");
setting_update_gl_item_chk_status(list_item, list_item->chk_status ? 0 : 1);
- auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
- ad->us_configuration.auto_scan = list_item->chk_status;
- elm_object_item_disabled_set(ad->universal_switch_auto_scan_int->item, (Eina_Bool)!ad->us_configuration.auto_scan);
- elm_object_item_disabled_set(ad->universal_switch_scans_num->item, (Eina_Bool)!ad->us_configuration.auto_scan);
- elm_object_item_disabled_set(ad->universal_switch_pause_on_first->item, (Eina_Bool)!ad->us_configuration.auto_scan);
- elm_object_item_disabled_set(ad->universal_switch_auto_move_int->item, (Eina_Bool)ad->us_configuration.auto_scan);
+ auto self = static_cast<UniversalSwitchSettingsPage *>(list_item->userdata);
+ self->context_->us_configuration.auto_scan = list_item->chk_status;
+ elm_object_item_disabled_set(self->universal_switch_auto_scan_int->item, (Eina_Bool)!self->context_->us_configuration.auto_scan);
+ elm_object_item_disabled_set(self->universal_switch_scans_num->item, (Eina_Bool)!self->context_->us_configuration.auto_scan);
+ elm_object_item_disabled_set(self->universal_switch_pause_on_first->item, (Eina_Bool)!self->context_->us_configuration.auto_scan);
+ elm_object_item_disabled_set(self->universal_switch_auto_move_int->item, (Eina_Bool)self->context_->us_configuration.auto_scan);
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_SCAN_ENABLED, (bool *)&list_item->chk_status, NULL, NULL);
}