#include <string>
-namespace {
+namespace
+{
const std::string LAUNCHER_NAMES[3] = {
"IDS_ST_BODY_ACCESSIBILITY",
"IDS_ST_MBODY_SCREEN_READER_HTTS",
AccessibilityLauncherPage::AccessibilityLauncherPage(SettingAccessibility *ad)
{
- auto items = new ItemWrapper[utils::lenOf(LAUNCHER_NAMES)];
+ auto items = new ItemWrapper[utils::lenOf(LAUNCHER_NAMES)];
retm_if(items == NULL, "new failed");
for (auto i = 0u; i < utils::lenOf(LAUNCHER_NAMES); ++i)
}
item = createGendialGroupItem(
- genlist, &itc_1text_1icon, onMouseUpGendialListCb, items, SwallowType::ICON_RADIO, state,
- state ? "IDS_ACCS_ACCESSIBILITY_LAUNCHER_ON" : "IDS_ACCS_ACCESSIBILITY_LAUNCHER_OFF",
- {}, checkboxCb);
+ genlist, &itc_1text_1icon, onMouseUpGendialListCb, items, SwallowType::ICON_RADIO, state,
+ state ? "IDS_ACCS_ACCESSIBILITY_LAUNCHER_ON" : "IDS_ACCS_ACCESSIBILITY_LAUNCHER_OFF",
+ {}, checkboxCb);
if (item)
item->userdata = items;
item = createGendialGroupItem(
- genlist, &ad->itc_multiline_sub,
- NULL, ad, SwallowType::INVALID, 0,
- {},
- "IDS_ACCS_ACCESSIBILITY_LAUNCHER_COMMENT",
- NULL);
+ genlist, &ad->itc_multiline_sub,
+ NULL, ad, SwallowType::INVALID, 0,
+ {},
+ "IDS_ACCS_ACCESSIBILITY_LAUNCHER_COMMENT",
+ NULL);
if (item) {
elm_genlist_item_select_mode_set(item->item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
}
for (auto i = 0u; i < utils::lenOf(LAUNCHER_NAMES); i++) {
GenGroupItemData *item = createGendialGroupItem(
- genlist, &itc_1text_1icon,
- onItemSelectedCb, ad, SwallowType::ICON_RADIO, vconf_state & (1 << i),
- items[i].name,
- {}, onCheckboxChangeCb);
+ genlist, &itc_1text_1icon,
+ onItemSelectedCb, ad, SwallowType::ICON_RADIO, vconf_state & (1 << i),
+ items[i].name,
+ {}, onCheckboxChangeCb);
if (item) {
item->userdata = items;
Eina_Bool AccessibilityLauncherPage::onNaviframePopCb(void *data, Elm_Object_Item *it)
{
retv_if(data == NULL, EINA_TRUE);
- auto items = static_cast<ItemWrapper*>(data);
+ auto items = static_cast<ItemWrapper *>(data);
delete[] items;
return EINA_TRUE;
void AccessibilityLauncherPage::onBackButtonCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data argument is NULL");
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_naviframe_item_pop(ad->md.getNaviframe());
}
void AccessibilityLauncherPage::onCheckboxChangeCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Input parameter is NULL");
- auto list_item = static_cast<GenGroupItemData*>(data);
+ auto list_item = static_cast<GenGroupItemData *>(data);
list_item->chk_status = !list_item->chk_status;
- updateVconf(static_cast<ItemWrapper*>(list_item->userdata));
+ updateVconf(static_cast<ItemWrapper *>(list_item->userdata));
}
void AccessibilityLauncherPage::onItemSelectedCb(void *data, Evas_Object *obj, void *event_info)
retm_if(event_info == NULL, "Invalid argument: event_info is NULL");
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
elm_genlist_item_selected_set(item, EINA_FALSE);
- auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+ auto list_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
setting_update_gl_item_chk_status(list_item, list_item->chk_status ? 0 : 1);
- updateVconf(static_cast<ItemWrapper*>(list_item->userdata));
+ updateVconf(static_cast<ItemWrapper *>(list_item->userdata));
}
void AccessibilityLauncherPage::updateName(GenGroupItemData *item)
retm_if(list_item == NULL, "Data parameter is NULL");
updateName(list_item);
vconf_set_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_ACCESSIBILITY_LAUNCHER_STATE, list_item->chk_status);
- auto items = static_cast<ItemWrapper*>(list_item->userdata);
+ auto items = static_cast<ItemWrapper *>(list_item->userdata);
for (auto i = 0u; i < utils::lenOf(LAUNCHER_NAMES); i++)
elm_object_item_disabled_set(items[i].item->item, list_item->chk_status ? EINA_FALSE : EINA_TRUE);
}
void AccessibilityLauncherPage::checkboxCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
- auto list_item = static_cast<GenGroupItemData*>(data);
+ auto list_item = static_cast<GenGroupItemData *>(data);
list_item->chk_status = !list_item->chk_status;
updateMainSwitch(list_item);
}
retm_if(data == NULL, "Invalid argument: data is NULL");
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
elm_genlist_item_selected_set(item, EINA_FALSE);
- auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+ auto list_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
setting_update_gl_item_chk_status(list_item, list_item->chk_status ? 0 : 1);
updateMainSwitch(list_item);
}
#include <Elementary.h>
#include "GenGroupItemData.hpp"
-struct ItemWrapper{
+struct ItemWrapper {
std::string name;
GenGroupItemData *item;
};
class AccessibilityLauncherPage
{
public:
- AccessibilityLauncherPage(SettingAccessibility *ad);
+ AccessibilityLauncherPage(SettingAccessibility *ad);
private:
static Eina_Bool onNaviframePopCb(void *data, Elm_Object_Item *it);
ad->us_configuration.accessories_switch_added_cb = cb;
}
-Evas_Object* AccessoriesSwitchesPage::createEntry(Evas_Object *parent, const char *part_name)
+Evas_Object *AccessoriesSwitchesPage::createEntry(Evas_Object *parent, const char *part_name)
{
Evas_Object *entry = elm_entry_add(parent);
evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
{
retm_if(user_data == NULL, "Input argument is NULL");
retm_if(switch_id == NULL, "switch_id is NULL");
- auto ad = static_cast<SettingAccessibility*>(user_data);
+ auto ad = static_cast<SettingAccessibility *>(user_data);
for (auto &it : ad->config.configuration_items) {
if (strlen(switch_id) == it->switch_id.size() && strncmp(switch_id, it->switch_id.c_str(), strlen(switch_id)) == 0) {
ad->us_configuration.switch_id = switch_id;
ad->settingPopup_ = std::make_unique<SettingPopup>(ad, ad->md.getNaviframe(),
- "IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH", std::string{},
- popupResponseCb, 0,
- true,
- true,
- std::vector<std::string>{"IDS_ACCS_UNIVERSAL_SWITCH_CANCEL", "IDS_ACCS_UNIVERSAL_SWITCH_SAVE"});
+ "IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH", std::string{},
+ popupResponseCb, 0,
+ true,
+ true,
+ std::vector<std::string> {"IDS_ACCS_UNIVERSAL_SWITCH_CANCEL", "IDS_ACCS_UNIVERSAL_SWITCH_SAVE"});
Evas_Object *layout = createLayout(ad->settingPopup_->getObject(), EDJ_ACCESSORY_POPUP, GRP_ACCESSORY_POPUP);
void AccessoriesSwitchesPage::alreadyMappedSwitchPopup(SettingAccessibility *ad)
{
ad->settingPopup_ = std::make_unique<SettingPopup>(ad, ad->md.getNaviframe(),
- "IDS_ACCS_UNIVERSAL_SWITCH_UNABLE_TO_ADD", std::string{},
- okResponseCb, 0,
- true,
- true,
- std::vector<std::string>{"IDS_ACCS_UNIVERSAL_SWITCH_OK"});
+ "IDS_ACCS_UNIVERSAL_SWITCH_UNABLE_TO_ADD", std::string{},
+ okResponseCb, 0,
+ true,
+ true,
+ std::vector<std::string> {"IDS_ACCS_UNIVERSAL_SWITCH_OK"});
Evas_Object *layout = createLayout(ad->popup, EDJ_ACCESSORY_POPUP, GRP_ACCESSORY_POPUP);
void AccessoriesSwitchesPage::okResponseCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
renewCaptureSwitchCb(ad, NULL);
void AccessoriesSwitchesPage::popupResponseCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
auto response_type = get_popup_btn_response_type(obj);
if (response_type == PopupBtnResponse::OK) {
ad->entry = NULL;
}
-void AccessoriesSwitchesPage::accessorySwitchActionCb(SettingAccessibility *ad, const std::string& action, void *user_data)
+void AccessoriesSwitchesPage::accessorySwitchActionCb(SettingAccessibility *ad, const std::string &action, void *user_data)
{
retm_if(user_data == NULL, "User data parameter is NULL");
Eina_Bool AccessoriesSwitchesPage::renewCaptureSwitchCb(void *data, Elm_Object_Item *it)
{
retv_if(data == NULL, EINA_TRUE);
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
setting_accessibility_universal_switch_dbus_config_captureSwitch(&ad->config, ACCESSIBILITY_UNIVERSAL_SWITCH_ACCESSORIES_SWITCH_PROVIDER, -1, captureSwitchCb, ad);
Eina_Bool AccessoriesSwitchesPage::naviframPopCb(void *data, Elm_Object_Item *it)
{
retv_if(data == NULL, EINA_TRUE);
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
setting_accessibility_universal_switch_dbus_config_cancelCaptureSwitch(&ad->config);
ad->us_configuration.switch_id = {};
void AccessoriesSwitchesPage::backCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data argument is NULL");
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_naviframe_item_pop(ad->md.getNaviframe());
}
static void attachActionCallback(SettingAccessibility *ad, UniversalSwitchUpdateCb cb);
private:
- static Evas_Object* createEntry(Evas_Object *parent, const char *part_name);
+ static Evas_Object *createEntry(Evas_Object *parent, const char *part_name);
static Evas_Object *createLayout(Evas_Object *parent, const char *edj_file, const char *group);
static void captureSwitchCb(void *user_data, const char *switch_id);
static void alreadyMappedSwitchPopup(SettingAccessibility *ad);
static void okResponseCb(void *data, Evas_Object *obj, void *event_info);
static void popupResponseCb(void *data, Evas_Object *obj, void *event_info);
- static void accessorySwitchActionCb(SettingAccessibility *ad, const std::string& action, void *user_data);
+ static void accessorySwitchActionCb(SettingAccessibility *ad, const std::string &action, void *user_data);
static Eina_Bool renewCaptureSwitchCb(void *data, Elm_Object_Item *it);
static Eina_Bool naviframPopCb(void *data, Elm_Object_Item *it);
static void backCb(void *data, Evas_Object *obj, void *event_info);
class ActionPage
{
public:
- using switch_action_cb = void (*)(SettingAccessibility *ad, const std::string& action, void *user_data); //TODO probably to remove
+ using switch_action_cb = void (*)(SettingAccessibility *ad, const std::string &action, void *user_data); //TODO probably to remove
ActionPage(SettingAccessibility *ad);
static void attachCallback(SettingAccessibility *ad, switch_action_cb cb, void *user_data);
for (auto &it : ad->config.switch_providers) {
auto item = createGendialGroupItem(
- genlist, &ad->itc_multiline_sub,
- onSwitchAddition, &it->info->id,
- SwallowType::INVALID, 0,
- it->info->name,
- it->info->description,
- NULL);
+ genlist, &ad->itc_multiline_sub,
+ onSwitchAddition, &it->info->id,
+ SwallowType::INVALID, 0,
+ it->info->name,
+ it->info->description,
+ NULL);
if (item) {
item->userdata = ad;
CameraSwitchesPage::attachActionCallback(ad, cb);
}
-void AddSwitchPage::disableScreenSwitchProviderIfSwitchMapped(const std::vector<UniversalSwitchConfigurationItem*>& configuration_items, UniversalSwitchSwitchProvider *switch_provider, Elm_Object_Item *item)
+void AddSwitchPage::disableScreenSwitchProviderIfSwitchMapped(const std::vector<UniversalSwitchConfigurationItem *> &configuration_items, UniversalSwitchSwitchProvider *switch_provider, Elm_Object_Item *item)
{
retm_if(switch_provider == NULL, "Input parameter is NULL");
retm_if(item == NULL, "Input parameter is NULL");
disableAlreadyMappedSwitch(configuration_items, ACCESSIBILITY_UNIVERSAL_SWITCH_SCREEN_SWITCH_ID, item);
}
-void AddSwitchPage::disableAlreadyMappedSwitch(const std::vector<UniversalSwitchConfigurationItem*> &configuration_items, const std::string& switch_id, Elm_Object_Item *item)
+void AddSwitchPage::disableAlreadyMappedSwitch(const std::vector<UniversalSwitchConfigurationItem *> &configuration_items, const std::string &switch_id, Elm_Object_Item *item)
{
retm_if(item == NULL, "Input parameter is NULL");
{
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
elm_genlist_item_selected_set(item, EINA_FALSE);
- auto settings_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
- auto ad = static_cast<SettingAccessibility*>(settings_item->userdata);
+ auto settings_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
+ auto ad = static_cast<SettingAccessibility *>(settings_item->userdata);
retm_if(ad == NULL, "Input argument is NULL");
- auto providerId = *static_cast<std::string*>(data);
+ auto providerId = *static_cast<std::string *>(data);
showSwitchesPage(ad, providerId.c_str());
}
-void AddSwitchPage::showSwitchesPage(SettingAccessibility *ad, const char * providerId)
+void AddSwitchPage::showSwitchesPage(SettingAccessibility *ad, const char *providerId)
{
SETTING_TRACE_DEBUG("Create add switch page for %s", providerId);
void AddSwitchPage::backCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data argument is NULL");
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_naviframe_item_pop(ad->md.getNaviframe());
}
Eina_Bool AddSwitchPage::onNaviframePopCb(void *data, Elm_Object_Item *it)
{
retv_if(data == NULL, EINA_TRUE);
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
ad->us_configuration.screen_switch_added_cb = NULL;
ad->us_configuration.camera_switch_added_cb = NULL;
public:
AddSwitchPage(SettingAccessibility *ad);
static void attachCallbackOnSwitchAttach(SettingAccessibility *ad, UniversalSwitchUpdateCb cb); //TODO: rename
- static void disableAlreadyMappedSwitch(const std::vector<UniversalSwitchConfigurationItem*> &configuration_items, const std::string& switch_id, Elm_Object_Item *item);
+ static void disableAlreadyMappedSwitch(const std::vector<UniversalSwitchConfigurationItem *> &configuration_items, const std::string &switch_id, Elm_Object_Item *item);
private:
- static void disableScreenSwitchProviderIfSwitchMapped(const std::vector<UniversalSwitchConfigurationItem*>& configuration_items, UniversalSwitchSwitchProvider *switch_provider, Elm_Object_Item *item);
+ static void disableScreenSwitchProviderIfSwitchMapped(const std::vector<UniversalSwitchConfigurationItem *> &configuration_items, UniversalSwitchSwitchProvider *switch_provider, Elm_Object_Item *item);
static void onSwitchAddition(void *data, Evas_Object *obj, void *event_info);
- static void showSwitchesPage(SettingAccessibility *ad, const char * providerId);
+ static void showSwitchesPage(SettingAccessibility *ad, const char *providerId);
static void backCb(void *data, Evas_Object *obj, void *event_info);
static Eina_Bool onNaviframePopCb(void *data, Elm_Object_Item *it);
};
elm_genlist_clear(genlist);
universal_switch_camera_comment = createGendialGroupItem(
- genlist, &ad->itc_multiline_sub,
- NULL, ad, SwallowType::INVALID, 0,
- {},
- "IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH_CAMERA_COMMENT",
- NULL);
+ genlist, &ad->itc_multiline_sub,
+ NULL, ad, SwallowType::INVALID, 0,
+ {},
+ "IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH_CAMERA_COMMENT",
+ NULL);
if (!universal_switch_camera_comment)
return;
auto switches = setting_accessibility_universal_switch_dbus_config_get_switches(&ad->config, ACCESSIBILITY_UNIVERSAL_SWITCH_CAMERA_SWITCH_PROVIDER);
for (auto &it : switches) {
auto item = createGendialGroupItem(genlist, &ad->itc_multiline_sub, addSwitchCb, it,
- SwallowType::INVALID, 0,
- it->name,
- it->description,
- NULL);
+ SwallowType::INVALID, 0,
+ it->name,
+ it->description,
+ NULL);
if (item) {
item->userdata = ad;
{
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
elm_genlist_item_selected_set(item, EINA_FALSE);
- auto settings_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
- auto ad = static_cast<SettingAccessibility*>(settings_item->userdata);
+ auto settings_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
+ auto ad = static_cast<SettingAccessibility *>(settings_item->userdata);
retm_if(ad == NULL, "Input argument is NULL");
- auto camera_switch = static_cast<UniversalSwitchInfoType*>(data);
+ auto camera_switch = static_cast<UniversalSwitchInfoType *>(data);
createActionPage(ad, camera_switch);
}
-void CameraSwitchesPage::createActionPage(SettingAccessibility *ad, UniversalSwitchInfoType * camera_switch)
+void CameraSwitchesPage::createActionPage(SettingAccessibility *ad, UniversalSwitchInfoType *camera_switch)
{
retm_if(ad == NULL, "Data argument is NULL");
ActionPage::attachCallback(ad, switchActionCb, camera_switch);
}
-void CameraSwitchesPage::switchActionCb(SettingAccessibility *ad, const std::string& action, void *user_data)
+void CameraSwitchesPage::switchActionCb(SettingAccessibility *ad, const std::string &action, void *user_data)
{
retm_if(user_data == NULL, "User data parameter is NULL");
- auto camera_switch = static_cast<UniversalSwitchInfoType*>(user_data);
+ auto camera_switch = static_cast<UniversalSwitchInfoType *>(user_data);
if (ad->us_configuration.camera_switch_added_cb)
ad->us_configuration.camera_switch_added_cb(ad, camera_switch->id, action, camera_switch->name);
void CameraSwitchesPage::backCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data argument is NULL");
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_naviframe_item_pop(ad->md.getNaviframe());
}
private:
static void addSwitchCb(void *data, Evas_Object *obj, void *event_info);
- static void createActionPage(SettingAccessibility *ad, UniversalSwitchInfoType * camera_switch);
- static void switchActionCb(SettingAccessibility *ad, const std::string& action, void *user_data);
+ static void createActionPage(SettingAccessibility *ad, UniversalSwitchInfoType *camera_switch);
+ static void switchActionCb(SettingAccessibility *ad, const std::string &action, void *user_data);
static void backCb(void *data, Evas_Object *obj, void *event_info);
GenGroupItemData *universal_switch_camera_comment = nullptr;
* 1. split into smaller, more specialized classes
* 2. maybe add methods
*/
-class GenGroupItemData {
+class GenGroupItemData
+{
public:
void **pBack = nullptr;
Evas_Object *window = nullptr;
void *userdata = nullptr; /**< just a reference, do not need release. */
- /* popup */
- Evas_Object *notify = nullptr; /**< act as any popup to show user any message */
+ /* popup */
+ Evas_Object *notify = nullptr; /**< act as any popup to show user any message */
/*record itc style for all genlist item with check/radio/toggle */
std::string itc;
evas_object_show(genlist);
}
-Evas_Object* MainData::getWindow() const
+Evas_Object *MainData::getWindow() const
{
- return window;
+ return window;
}
-Evas_Object* MainData::getNaviframe() const
+Evas_Object *MainData::getNaviframe() const
{
- return naviframe;
+ return naviframe;
}
-Evas_Object* MainData::getGenlist() const
+Evas_Object *MainData::getGenlist() const
{
- return genlist;
+ return genlist;
}
int MainData::initViewWithoutGenlist(const std::string &name)
__gl_realized_cb(data, obj, event_info);
setting_retm_if(event_info == NULL, "invalid parameter: event_info is NULL");
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- auto item_data = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+ auto item_data = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
ret_if(!item_data);
}
void MainData::softkeyBackClickCb(void *data, Evas_Object *obj, void *event_inf)
{
- auto naviframe = static_cast<Evas_Object*>(data);
+ auto naviframe = static_cast<Evas_Object *>(data);
ret_if(!naviframe);
elm_naviframe_item_pop(naviframe);
}
MainData() = default;
int initApp(const std::string &name);
void initView(const std::string &name);
- Evas_Object* getWindow() const;
- Evas_Object* getNaviframe() const;
- Evas_Object* getGenlist() const;
+ Evas_Object *getWindow() const;
+ Evas_Object *getNaviframe() const;
+ Evas_Object *getGenlist() const;
void addBackButton(Elm_Naviframe_Item_Pop_Cb view_pop_cb, void *ad) const;
- Elm_Object_Item *naviframe_it;
+ Elm_Object_Item *naviframe_it;
private:
int initViewWithoutGenlist(const std::string &name);
void addRotateSupport();
- void prepareViewList();
+ void prepareViewList();
void createMainWindow(const std::string &name);
static void onAllGenlistRealizedCb(void *data, Evas_Object *obj, void *event_info);
static void softkeyBackClickCb(void *data, Evas_Object *obj, void *event_inf);
- Evas *evas;
- Evas_Object *window;
- Evas_Object *conform;
- Evas_Object *naviframe;
- Evas_Object *layout;
- Evas_Object *genlist;
+ Evas *evas;
+ Evas_Object *window;
+ Evas_Object *conform;
+ Evas_Object *naviframe;
+ Evas_Object *layout;
+ Evas_Object *genlist;
};
#endif
{
retm_if(ad == NULL, "Input parameter is NULL");
- ad->us_configuration.switch_removed_cb = cb;
+ ad->us_configuration.switch_removed_cb = cb;
}
void RemoveSwitchPage::onDeleteButtonClicked(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
retm_if(ad == NULL, "Input parameter is NULL");
retm_if(ad->set_value_layout.getGenlist() == NULL, "No genlist provided");
void RemoveSwitchPage::onAllButtonsClicked(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
retm_if(ad == NULL, "Input parameter is NULL");
retm_if(ad->set_value_layout.getGenlist() == NULL, "No genlist provided");
Elm_Object_Item *item = elm_genlist_first_item_get(ad->set_value_layout.getGenlist());
while (item != NULL) {
- auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+ auto list_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
setting_update_gl_item_chk_status(list_item, !all_selected);
item = elm_genlist_item_next_get(item);
}
} else if (ad->switches_to_remove_counter > 0) {
title = std::to_string(ad->switches_to_remove_counter);
} else {
- title = TranslatedString{"IDS_ACCS_SELECT_ITEMS"}.str();
+ title = TranslatedString{"IDS_ACCS_SELECT_ITEMS"} .str();
}
elm_object_disabled_set(ad->remove_switches_popup_button, ad->switches_to_remove_counter ? EINA_FALSE : EINA_TRUE);
elm_layout_text_set(ad->md.getNaviframe(), "default", title.c_str());
int vconf_val;
int vconf_ret = vconf_get_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_INTERACTION_SERVICE, &vconf_val);
retm_if(vconf_ret != 0,
- "Failed to get vconf bool value VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_INTERACTION_SERVICE. Error: %d", vconf_ret);
+ "Failed to get vconf bool value VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_INTERACTION_SERVICE. Error: %d", vconf_ret);
elm_object_part_text_set(ad->popup, "title,text", _("IDS_ACCS_UNIVERSAL_SWITCH_DELETE_SWITCHES"));
- if (vconf_val && ad->switches_to_remove_counter == (int)elm_genlist_items_count(ad->set_value_layout.getGenlist())) {
+ if (vconf_val && ad->switches_to_remove_counter == (int)elm_genlist_items_count(ad->set_value_layout.getGenlist())) {
elm_object_text_set(ad->popup, _("IDS_ACCS_UNIVERSAL_SWITCH_DELETE_ALL_SWITCHES_DESC"));
} else {
- auto s = std::to_string(ad->switches_to_remove_counter) + " " + TranslatedString{"IDS_ACCS_UNIVERSAL_SWITCH_DELETE_SWITCHES_DESC"}.str();
+ auto s = std::to_string(ad->switches_to_remove_counter) + " " + TranslatedString{"IDS_ACCS_UNIVERSAL_SWITCH_DELETE_SWITCHES_DESC"} .str();
elm_object_text_set(ad->popup, s.c_str());
}
void RemoveSwitchPage::onRemoveSelectedSwitches(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
bool disable_universal_switch = (ad->switches_to_remove_counter == (int)elm_genlist_items_count(ad->set_value_layout.getGenlist()));
Elm_Object_Item *item = elm_genlist_last_item_get(ad->set_value_layout.getGenlist());
while (item != NULL) {
- auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+ auto list_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
item = elm_genlist_item_prev_get(item);
if (list_item->chk_status)
removeSwitch(ad, list_item->chk_id);
ScreenReaderPage::ScreenReaderPage(SettingAccessibility *data)
{
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
Evas_Object *genlist = elm_genlist_add(ad->md.getNaviframe());
retm_if(genlist == NULL, "Cannot set genlist object as content of layout");
elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
elm_genlist_clear(genlist);
screenreader_checkbox = createGendialGroupItem(
- genlist, &itc_1text_1icon,
- listCb,
- ad, SwallowType::ICON_RADIO, 1,
- "IDS_ST_MBODY_SCREEN_READER_HTTS",
- {}, screenReaderCheckCb);
+ genlist, &itc_1text_1icon,
+ listCb,
+ ad, SwallowType::ICON_RADIO, 1,
+ "IDS_ST_MBODY_SCREEN_READER_HTTS",
+ {}, screenReaderCheckCb);
if (screenreader_checkbox) {
screenreader_checkbox->userdata = ad;
__BACK_POINTER_SET(screenreader_checkbox);
screenreader_checkbox->chk_status = screen_reader ? 1 : 0;
/*---------------------------------------------------------------------------------------------- */
int vconf_ret = vconf_notify_key_changed(
- VCONFKEY_SETAPPL_ACCESSIBILITY_TTS,
- onVconfChangedCb,
- screenreader_checkbox);
+ VCONFKEY_SETAPPL_ACCESSIBILITY_TTS,
+ onVconfChangedCb,
+ screenreader_checkbox);
if (vconf_ret != 0) {
SETTING_TRACE("FAIL: vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS)");
return;
}
multiline_screen_reader_comment = createGendialGroupItem(
- genlist, &ad->itc_multiline_sub,
- NULL, ad, SwallowType::INVALID, 0,
- {},
- "IDS_ACCS_BODY_WHILE_SCREEN_READER_IS_ENABLED_YOUR_PHONE_WILL_PROVIDE_VOICE_FEEDBACK_FOR_EXAMPLE_SCREEN_READER_WILL_MSG",
- NULL);
+ genlist, &ad->itc_multiline_sub,
+ NULL, ad, SwallowType::INVALID, 0,
+ {},
+ "IDS_ACCS_BODY_WHILE_SCREEN_READER_IS_ENABLED_YOUR_PHONE_WILL_PROVIDE_VOICE_FEEDBACK_FOR_EXAMPLE_SCREEN_READER_WILL_MSG",
+ NULL);
if (multiline_screen_reader_comment) {
multiline_screen_reader_comment->userdata = ad;
__BACK_POINTER_SET(multiline_screen_reader_comment);
}
screen_reader_settings = createGendialGroupItem(
- genlist, &itc_1text,
- settingsListCb,
- ad, SwallowType::INVALID, 0,
- "IDS_ST_OPT_SETTINGS",
- {}, NULL);
+ genlist, &itc_1text,
+ settingsListCb,
+ ad, SwallowType::INVALID, 0,
+ "IDS_ST_OPT_SETTINGS",
+ {}, NULL);
if (screen_reader_settings) {
screen_reader_settings->userdata = ad;
__BACK_POINTER_SET(screen_reader_settings);
elm_genlist_item_selected_set(item, EINA_FALSE);
- auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+ auto list_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
setting_retm_if(data == NULL, "Data parameter is NULL");
setting_update_gl_item_chk_status(list_item, list_item->chk_status ? 0 : 1);
updateScreenReaderVconfCheck((list_item->chk_status ? 1 : 0), list_item->userdata);
retm_if(data == NULL, "Invalid argument: data is NULL");
retm_if(event_info == NULL, "Invalid argument: event_info is NULL");
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_genlist_item_selected_set(item, EINA_FALSE);
void ScreenReaderPage::screenReaderCheckCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
- auto list_item = static_cast<GenGroupItemData*>(data);
+ auto list_item = static_cast<GenGroupItemData *>(data);
/* for genlist update status */
list_item->chk_status = elm_check_state_get(obj);
updateScreenReaderVconfCheck(list_item->chk_status, list_item->userdata);
}
-void ScreenReaderPage::updateScreenReaderVconfCheck(int state, void* data)
+void ScreenReaderPage::updateScreenReaderVconfCheck(int state, void *data)
{
retm_if(data == NULL, "Data parameter is NULL");
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
vconf_set_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, state);
if (!state) {
- auto buf = TranslatedString{"IDS_ST_MBODY_SCREEN_READER_HTTS"}.str() + " " + TranslatedString{"IDS_ST_BODY_OFF"}.str();
+ auto buf = TranslatedString{"IDS_ST_MBODY_SCREEN_READER_HTTS"} .str() + " " + TranslatedString{"IDS_ST_BODY_OFF"} .str();
int utterance_id;
int ret = tts_add_text(ad->tts, buf.c_str(), NULL, TTS_VOICE_TYPE_AUTO, TTS_SPEED_AUTO, &utterance_id);
SETTING_TRACE_DEBUG("tts_add_text %d", ret);
Eina_Bool ScreenReaderPage::hideScreenReaderPage(void *data, Elm_Object_Item *it)
{
retv_if(data == NULL, EINA_TRUE);
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, onVconfChangedCb);
elm_naviframe_item_pop(ad->md.getNaviframe());
void ScreenReaderPage::onVconfChangedCb(keynode_t *node, void *user_data)
{
- auto screenReaderItem = static_cast<GenGroupItemData*>(user_data);
+ auto screenReaderItem = static_cast<GenGroupItemData *>(user_data);
/*SETTING_TRACE_DEBUG("check_status: %i, node->value.i: %i",
* screenReaderItem->chk_status, node->value.i); */
/* I don't know why following code does not update check box to
static void listCb(void *data, Evas_Object *obj, void *event_info);
static void settingsListCb(void *data, Evas_Object *obj, void *event_info);
static void screenReaderCheckCb(void *data, Evas_Object *obj, void *event_info);
- static void updateScreenReaderVconfCheck(int state, void* data);
+ static void updateScreenReaderVconfCheck(int state, void *data);
static Eina_Bool hideScreenReaderPage(void *data, Elm_Object_Item *it);
static void onVconfChangedCb(keynode_t *node, void *user_data);
#include <app.h>
#include <efl_extension.h>
-namespace {
- struct VConfCheckData{
+namespace
+{
+ struct VConfCheckData {
std::string label;
std::string vconf_key;
int *status = nullptr;
static const size_t POPUP_CONTENT_BASE_SIZE = 120;
- std::vector<GenGroupItemData*> items;
+ std::vector<GenGroupItemData *> items;
GenGroupItemData *speech_rate_list_item = nullptr;
}
ScreenReaderSettingsPage::ScreenReaderSettingsPage(SettingAccessibility *data)
{
- SettingAccessibility *ad = static_cast<SettingAccessibility*>(data);
+ SettingAccessibility *ad = static_cast<SettingAccessibility *>(data);
int s_speed = -1;
int s_speed_normal = -1;
auto denominator = s_speed_max - s_speed_min;
double s_speed_percent = 0.0;
if (denominator != 0)
- s_speed_percent = (((double)s_speed - (double)s_speed_min)/((double)denominator)) * 100;
+ s_speed_percent = (((double)s_speed - (double)s_speed_min) / ((double)denominator)) * 100;
std::string buf = std::to_string(std::lround(s_speed_percent));
SETTING_TRACE("TTS rate is %.0f", s_speed_percent);
/* Item 1 : Speech Rate */
speech_rate_item = createGendialGroupItem(
- genlist, &itc_2text,
- speechRateCb,
- ad, SwallowType::INVALID, 1,
- "IDS_ST_BODY_SPEECH_RATE",
- buf,
- NULL);
+ genlist, &itc_2text,
+ speechRateCb,
+ ad, SwallowType::INVALID, 1,
+ "IDS_ST_BODY_SPEECH_RATE",
+ buf,
+ NULL);
tts_setting_set_speed_changed_cb(ttsSpeedChangedCb, speech_rate_item);
if (speech_rate_item) {
speech_rate_item->userdata = ad;
/* Item 2 : Keyboard feedback */
vconf_ret = vconf_get_bool(
- VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_KEYBOARD_FEEDBACK,
- &vconf_val);
+ VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_KEYBOARD_FEEDBACK,
+ &vconf_val);
if (vconf_ret != 0) {
LOGE("Failed to get vconf bool value VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_KEYBOARD_FEEDBACK. Error: %d",
- vconf_ret);
+ vconf_ret);
}
keyboard_feedback_item = createGendialGroupItem(
- genlist, &itc_multiline_2text,
- keyboardFeedbackCb,
- ad, SwallowType::ICON_RADIO, vconf_val ? 1 : 0,
- "IDS_ACCS_OPT_KEYBOARD_FEEDBACK_TTS",
- "IDS_ACCS_OPT_ALWAYS_READ_OUT_KEYBOARD_INPUT_TTS",
- updateKeyboardFeedbackCheck);
+ genlist, &itc_multiline_2text,
+ keyboardFeedbackCb,
+ ad, SwallowType::ICON_RADIO, vconf_val ? 1 : 0,
+ "IDS_ACCS_OPT_KEYBOARD_FEEDBACK_TTS",
+ "IDS_ACCS_OPT_ALWAYS_READ_OUT_KEYBOARD_INPUT_TTS",
+ updateKeyboardFeedbackCheck);
if (keyboard_feedback_item) {
keyboard_feedback_item->userdata = ad;
/* Item 3 : Hints */
vconf_ret = vconf_get_bool(
- VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_DESCRIPTION,
- &vconf_val);
+ VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_DESCRIPTION,
+ &vconf_val);
if (vconf_ret != 0) {
LOGE("Failed to get vconf bool value VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_DESCRIPTION. Error: %d",
- vconf_ret);
+ vconf_ret);
}
hints_item = createGendialGroupItem(
- genlist, &itc_1text_1icon,
- hintsCb,
- ad, SwallowType::ICON_RADIO, vconf_val ? 1 : 0,
- "IDS_ACCS_MBODY_READ_OUT_USAGE_HINTS_ABB",
- {},
- updateHintsCheck);
+ genlist, &itc_1text_1icon,
+ hintsCb,
+ ad, SwallowType::ICON_RADIO, vconf_val ? 1 : 0,
+ "IDS_ACCS_MBODY_READ_OUT_USAGE_HINTS_ABB",
+ {},
+ updateHintsCheck);
if (hints_item) {
hints_item->userdata = ad;
/* Item 4 : Vibration Feedback */
vconf_ret = vconf_get_bool(
- VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_HAPTIC,
- &vconf_val);
+ VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_HAPTIC,
+ &vconf_val);
if (vconf_ret != 0) {
LOGE("Failed to get vconf bool value VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_HAPTIC. Error: %d",
- vconf_ret);
+ vconf_ret);
}
vibration_feedback_item = createGendialGroupItem(
- genlist, &itc_1text_1icon,
- vibrationFeedbackCb,
- ad, SwallowType::ICON_RADIO, vconf_val ? 1 : 0,
- "IDS_ACCS_MBODY_VIBRATION_FEEDBACK",
- {},
- updateVibrationFeedbackCheck);
+ genlist, &itc_1text_1icon,
+ vibrationFeedbackCb,
+ ad, SwallowType::ICON_RADIO, vconf_val ? 1 : 0,
+ "IDS_ACCS_MBODY_VIBRATION_FEEDBACK",
+ {},
+ updateVibrationFeedbackCheck);
if (vibration_feedback_item) {
vibration_feedback_item->userdata = ad;
/* Item 5 : Sound Feedback */
vconf_ret = vconf_get_bool(
- VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_SOUND_FEEDBACK,
- &vconf_val);
+ VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_SOUND_FEEDBACK,
+ &vconf_val);
if (vconf_ret != 0) {
LOGE("Failed to get vconf bool value VCONFKEY_SETAPPL_ACCESSIBILITY_SCREEN_READER_SOUND_FEEDBACK. Error: %d",
- vconf_ret);
+ vconf_ret);
}
sound_feedback_item = createGendialGroupItem(
- genlist, &itc_1text_1icon,
- soundFeedbackCb,
- ad, SwallowType::ICON_RADIO, vconf_val ? 1 : 0,
- "IDS_ACCS_MBODY_SOUND_FEEDBACK",
- {},
- updateSoundFeedbackCheck);
+ genlist, &itc_1text_1icon,
+ soundFeedbackCb,
+ ad, SwallowType::ICON_RADIO, vconf_val ? 1 : 0,
+ "IDS_ACCS_MBODY_SOUND_FEEDBACK",
+ {},
+ updateSoundFeedbackCheck);
if (sound_feedback_item) {
sound_feedback_item->userdata = ad;
}
status_bar_information_item = createGendialGroupItem(
- genlist, &itc_1text,
- mouseUpGendialListCb,
- ad, SwallowType::INVALID, 1,
- "IDS_ACCS_TMBODY_STATUS_BAR_INFORMATION",
- {},
- NULL);
+ genlist, &itc_1text,
+ mouseUpGendialListCb,
+ ad, SwallowType::INVALID, 1,
+ "IDS_ACCS_TMBODY_STATUS_BAR_INFORMATION",
+ {},
+ NULL);
if (status_bar_information_item) {
status_bar_information_item->userdata = ad;
}
multiline_status_bar_information_description = createGendialGroupItem(
- genlist, &ad->itc_multiline_sub,
- NULL, ad, SwallowType::INVALID, 0,
- {},
- "IDS_ACCS_SBODY_SELECT_WHICH_INFORMATION_FROM_INDICATORS_SHOWN_ON_THE_STATUS_BAR_WILL_BE_READ_OUT_WHEN_YOU_TRIPLE_TAP_THE_SCREEN_WITH_TWO_FINGERS_MSG",
- NULL);
+ genlist, &ad->itc_multiline_sub,
+ NULL, ad, SwallowType::INVALID, 0,
+ {},
+ "IDS_ACCS_SBODY_SELECT_WHICH_INFORMATION_FROM_INDICATORS_SHOWN_ON_THE_STATUS_BAR_WILL_BE_READ_OUT_WHEN_YOU_TRIPLE_TAP_THE_SCREEN_WITH_TWO_FINGERS_MSG",
+ NULL);
if (multiline_status_bar_information_description) {
multiline_status_bar_information_description->userdata = ad;
__BACK_POINTER_SET(multiline_status_bar_information_description);
elm_genlist_item_select_mode_set(
- multiline_status_bar_information_description->item,
- ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+ multiline_status_bar_information_description->item,
+ ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
}
Elm_Object_Item *navi_it = elm_naviframe_item_push(ad->md.getNaviframe(), _("IDS_ST_OPT_SETTINGS"), NULL, NULL, genlist, NULL);
retm_if(data == NULL, "Invalid argument: data is NULL");
retm_if(event_info == NULL, "Invalid argument: event_info is NULL");
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
Evas_Object *popup;
Evas_Object *box;
Evas_Object *genlist;
/* eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK,
* eext_popup_back_cb, NULL); */
elm_object_part_text_set(popup, "title,text",
- _("IDS_ACCS_TMBODY_STATUS_BAR_INFORMATION"));
+ _("IDS_ACCS_TMBODY_STATUS_BAR_INFORMATION"));
evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND);
/* box */
box = elm_box_add(popup);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND);
/* genlist */
genlist = elm_genlist_add(box);
evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
+ EVAS_HINT_FILL);
for (i = 0; i < size; ++i) {
auto status = vconfValueGet(vConfCheckData[i].vconf_key.c_str());
screenreader_checkbox = createGendialGroupItem(
- genlist, &itc_1text_1icon,
- onListItemClicked, ad,
- SwallowType::ICON_RADIO, status,
- vConfCheckData[i].label,
- {}, onCheckStateChanged);
+ genlist, &itc_1text_1icon,
+ onListItemClicked, ad,
+ SwallowType::ICON_RADIO, status,
+ vConfCheckData[i].label,
+ {}, onCheckStateChanged);
vConfCheckData[i].status = &screenreader_checkbox->chk_status;
items.push_back(screenreader_checkbox);
}
elm_scroller_movement_block_set(genlist,
- Elm_Scroller_Movement_Block(ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL | ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL));
+ Elm_Scroller_Movement_Block(ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL | ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL));
elm_scroller_policy_set(genlist, ELM_SCROLLER_POLICY_OFF,
- ELM_SCROLLER_POLICY_OFF);
+ ELM_SCROLLER_POLICY_OFF);
evas_object_show(genlist);
elm_box_pack_end(box, genlist);
evas_object_size_hint_min_set(box, -1,
- ELM_SCALE_SIZE(POPUP_CONTENT_BASE_SIZE) * size);
+ ELM_SCALE_SIZE(POPUP_CONTENT_BASE_SIZE) * size);
evas_object_size_hint_max_set(box, -1,
- ELM_SCALE_SIZE(POPUP_CONTENT_BASE_SIZE) * size);
+ ELM_SCALE_SIZE(POPUP_CONTENT_BASE_SIZE) * size);
elm_object_content_set(popup, box);
Evas_Object *btnCancel = setting_create_button(popup, "IDS_MSG_ACBUTTON_CANCEL_ABB", {}, onCancelButtonClicked, popup);
void ScreenReaderSettingsPage::vibrationFeedbackCb(void *data, Evas_Object *obj, void *event_info)
{
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+ auto list_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
elm_genlist_item_selected_set(item, EINA_FALSE);
setting_update_gl_item_chk_status(list_item,
- list_item->chk_status ? 0 : 1);
+ list_item->chk_status ? 0 : 1);
updateVibrationFeedbackVconf(list_item->chk_status ? 1 : 0);
}
void ScreenReaderSettingsPage::updateVibrationFeedbackCheck(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
- auto list_item = static_cast<GenGroupItemData*>(data);
+ auto list_item = static_cast<GenGroupItemData *>(data);
/* for genlist update status */
list_item->chk_status = elm_check_state_get(obj);
void ScreenReaderSettingsPage::soundFeedbackCb(void *data, Evas_Object *obj, void *event_info)
{
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+ auto list_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
elm_genlist_item_selected_set(item, EINA_FALSE);
setting_update_gl_item_chk_status(list_item, list_item->chk_status ? 0 : 1);
void ScreenReaderSettingsPage::updateSoundFeedbackCheck(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
- auto list_item = static_cast<GenGroupItemData*>(data);
+ auto list_item = static_cast<GenGroupItemData *>(data);
/* for genlist update status */
list_item->chk_status = elm_check_state_get(obj);
{
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+ auto list_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
elm_genlist_item_selected_set(item, EINA_FALSE);
setting_update_gl_item_chk_status(list_item,
- list_item->chk_status ? 0 : 1);
+ list_item->chk_status ? 0 : 1);
updateHintsVconf(list_item->chk_status ? 1 : 0);
}
void ScreenReaderSettingsPage::updateHintsCheck(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
- auto list_item = static_cast<GenGroupItemData*>(data);
+ auto list_item = static_cast<GenGroupItemData *>(data);
/* for genlist update status */
list_item->chk_status = elm_check_state_get(obj);
void ScreenReaderSettingsPage::keyboardFeedbackCb(void *data, Evas_Object *obj, void *event_info)
{
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+ auto list_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
elm_genlist_item_selected_set(item, EINA_FALSE);
setting_update_gl_item_chk_status(list_item, list_item->chk_status ? 0 : 1);
void ScreenReaderSettingsPage::updateKeyboardFeedbackCheck(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
- auto list_item = static_cast<GenGroupItemData*>(data);
+ auto list_item = static_cast<GenGroupItemData *>(data);
/* for genlist update status */
list_item->chk_status = elm_check_state_get(obj);
void ScreenReaderSettingsPage::speechRateCb(void *data, Evas_Object *obj, void *event_info)
{
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_genlist_item_selected_set(item, EINA_FALSE);
createSpeechRatePopup(ad, item);
void ScreenReaderSettingsPage::ttsSpeedChangedCb(int speed, void *user_data)
{
SETTING_TRACE("=== Speed changed to (%d)", speed);
- auto speech_rate_item = static_cast<GenGroupItemData*>(user_data);
+ auto speech_rate_item = static_cast<GenGroupItemData *>(user_data);
elm_object_item_part_text_set(speech_rate_item->item, "elm.text.2", std::to_string(speed).c_str());
}
void ScreenReaderSettingsPage::createSpeechRatePopup(void *data, void *item)
{
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
Evas_Object *popup;
Evas_Object *layout;
Evas_Object *slider;
/* eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK,
* eext_popup_back_cb, NULL); */
elm_object_part_text_set(popup, "title,text",
- _("IDS_ST_BODY_SPEECH_RATE"));
+ _("IDS_ST_BODY_SPEECH_RATE"));
evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND);
/* layout */
layout = elm_layout_add(popup);
elm_layout_file_set(layout, SETTINGS_EDJ,
- "popup_text_slider_view_layout");
+ "popup_text_slider_view_layout");
elm_object_part_text_set(layout, "elm.text.description",
- _("IDS_SCR_POP_DRAG_THE_SLIDER_TO_SET_THE_SPEECH_RATE"));
+ _("IDS_SCR_POP_DRAG_THE_SLIDER_TO_SET_THE_SPEECH_RATE"));
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND);
elm_object_content_set(popup, layout);
/* slider */
slider = elm_slider_add(layout);
elm_slider_indicator_show_set(slider, EINA_TRUE);
evas_object_size_hint_weight_set(slider, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(slider, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_slider_indicator_format_set(slider, "%1.0f");
auto denominator = s_speed_max - s_speed_min;
double s_speed_percent = 0.0;
if (denominator != 0)
- s_speed_percent = (((double)speed_val - (double)s_speed_min)/((double)denominator)) * 100;
+ s_speed_percent = (((double)speed_val - (double)s_speed_min) / ((double)denominator)) * 100;
std::string buf = std::to_string(std::lround(s_speed_percent));
SETTING_TRACE("Updating speed to %s", buf.c_str());
elm_genlist_item_selected_set(item, EINA_FALSE);
- auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+ auto list_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
retm_if(!list_item, "list_item == NULL");
LOGI("ITEM SELECTED: %s", list_item->keyStr.c_str());
return;
}
- auto item_data = static_cast<GenGroupItemData*>(data);
+ auto item_data = static_cast<GenGroupItemData *>(data);
item_data->chk_status = elm_check_state_get(obj);
LOGE("Check changed: %s; status: %d, %p", item_data->keyStr.c_str(), item_data->chk_status, &item_data->chk_status);
}
Eina_Bool ScreenReaderSettingsPage::hidePage(void *data, Elm_Object_Item *it)
{
retv_if(data == NULL, EINA_TRUE);
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
if (0 != tts_setting_unset_speed_changed_cb())
SETTING_TRACE("Fail to unset speed changed cb");
ad->us_configuration.screen_switch_added_cb = cb;
}
-void ScreenSwitchPage::actionCb(SettingAccessibility *ad, const std::string& action, void *user_data)
+void ScreenSwitchPage::actionCb(SettingAccessibility *ad, const std::string &action, void *user_data)
{
if (ad->us_configuration.screen_switch_added_cb) {
auto switches = setting_accessibility_universal_switch_dbus_config_get_switches(&ad->config, ACCESSIBILITY_UNIVERSAL_SWITCH_SCREEN_SWITCH_PROVIDER);
static void attachActionCallback(SettingAccessibility *ad, UniversalSwitchUpdateCb cb);
private:
- static void actionCb(SettingAccessibility *ad, const std::string& action, void *user_data);
+ static void actionCb(SettingAccessibility *ad, const std::string &action, void *user_data);
};
#endif
#include "SetValueLayout.hpp"
-Evas_Object* SetValueLayout::getLayout() const
+Evas_Object *SetValueLayout::getLayout() const
{
- return layout;
+ return layout;
}
-void SetValueLayout::setLayout(Evas_Object* layout)
+void SetValueLayout::setLayout(Evas_Object *layout)
{
- this->layout = layout;
+ this->layout = layout;
}
-Evas_Object* SetValueLayout::getScroller() const
+Evas_Object *SetValueLayout::getScroller() const
{
- return scroller;
+ return scroller;
}
-void SetValueLayout::setScroller(Evas_Object* scroller)
+void SetValueLayout::setScroller(Evas_Object *scroller)
{
- this->scroller = scroller;
+ this->scroller = scroller;
}
-Evas_Object* SetValueLayout::getBox() const
+Evas_Object *SetValueLayout::getBox() const
{
- return box;
+ return box;
}
-void SetValueLayout::setBox(Evas_Object* box)
+void SetValueLayout::setBox(Evas_Object *box)
{
- this->box = box;
+ this->box = box;
}
-Evas_Object* SetValueLayout::getCheck() const
+Evas_Object *SetValueLayout::getCheck() const
{
- return check;
+ return check;
}
-void SetValueLayout::setCheck(Evas_Object* check)
+void SetValueLayout::setCheck(Evas_Object *check)
{
- this->check = check;
+ this->check = check;
}
-Evas_Object* SetValueLayout::getGenlist() const
+Evas_Object *SetValueLayout::getGenlist() const
{
- return genlist;
+ return genlist;
}
-void SetValueLayout::setGenlist(Evas_Object* genlist)
+void SetValueLayout::setGenlist(Evas_Object *genlist)
{
- this->genlist = genlist;
+ this->genlist = genlist;
}
-std::vector<OptionsItem*>& SetValueLayout::getOptionsData()
+std::vector<OptionsItem *> &SetValueLayout::getOptionsData()
{
- return options_data;
+ return options_data;
}
double SetValueLayout::getMinVal() const
{
- return min_val;
+ return min_val;
}
void SetValueLayout::setMinVal(double val)
{
- min_val = val;
+ min_val = val;
}
double SetValueLayout::getMaxVal() const
{
- return max_val;
+ return max_val;
}
void SetValueLayout::setMaxVal(double val)
{
- max_val = val;
+ max_val = val;
}
double SetValueLayout::getStep() const
{
- return step;
+ return step;
}
void SetValueLayout::setStep(double val)
{
- step = val;
+ step = val;
}
std::string SetValueLayout::getUnits() const
{
- return units;
+ return units;
}
void SetValueLayout::setUnits(const std::string &units)
{
- this->units = units;
+ this->units = units;
}
struct SettingAccessibility;
-using changeValueCb = std::function<void(SettingAccessibility*, double)>;
-using changeSwitchCb = std::function<void(SettingAccessibility*, bool)>;
-using changeRadioItemCb = std::function<void(SettingAccessibility*, size_t)>;
-using changeSwitchItemCb = std::function<void(SettingAccessibility*, int, bool)>;
-using requestListItemOptionsCb = std::function<void(SettingAccessibility*, int)>;
+using changeValueCb = std::function<void(SettingAccessibility *, double)>;
+using changeSwitchCb = std::function<void(SettingAccessibility *, bool)>;
+using changeRadioItemCb = std::function<void(SettingAccessibility *, size_t)>;
+using changeSwitchItemCb = std::function<void(SettingAccessibility *, int, bool)>;
+using requestListItemOptionsCb = std::function<void(SettingAccessibility *, int)>;
struct OptionsItem {
SettingAccessibility *ad;
int option_id;
};
-class SetValueLayout {
+class SetValueLayout
+{
public:
SetValueLayout() = default;
- Evas_Object* getLayout() const;
- void setLayout(Evas_Object* layout);
- Evas_Object* getScroller() const;
- void setScroller(Evas_Object* scroller);
- Evas_Object* getBox() const;
- void setBox(Evas_Object* box);
- Evas_Object* getCheck() const;
- void setCheck(Evas_Object* check);
- Evas_Object* getGenlist() const;
- void setGenlist(Evas_Object* genlist);
- std::vector<OptionsItem*>& getOptionsData();
+ Evas_Object *getLayout() const;
+ void setLayout(Evas_Object *layout);
+ Evas_Object *getScroller() const;
+ void setScroller(Evas_Object *scroller);
+ Evas_Object *getBox() const;
+ void setBox(Evas_Object *box);
+ Evas_Object *getCheck() const;
+ void setCheck(Evas_Object *check);
+ Evas_Object *getGenlist() const;
+ void setGenlist(Evas_Object *genlist);
+ std::vector<OptionsItem *> &getOptionsData();
double getMinVal() const;
void setMinVal(double val);
double getMaxVal() const;
Evas_Object *box = nullptr;
Evas_Object *check = nullptr;
Evas_Object *genlist = nullptr;
- std::vector<OptionsItem*> options_data;
+ std::vector<OptionsItem *> options_data;
double min_val = 0.0;
double max_val = 0.0;
double step = 0.0;
retm_if(title == NULL, "Title parameter is NULL");
switch (type) {
- case ValueEditorType::NUMERIC: layout_grp = GRP_SET_VALUE_NUMERIC; break;
- case ValueEditorType::NUMERIC_SWITCH: layout_grp = GRP_SET_VALUE_NUMERIC_SWITCH; break;
+ case ValueEditorType::NUMERIC:
+ layout_grp = GRP_SET_VALUE_NUMERIC;
+ break;
+ case ValueEditorType::NUMERIC_SWITCH:
+ layout_grp = GRP_SET_VALUE_NUMERIC_SWITCH;
+ break;
case ValueEditorType::RADIOS:
- case ValueEditorType::SWITCHES: layout_grp = GRP_SET_VALUE_SWITCHES; break;
- case ValueEditorType::LIST_SWITCH: layout_grp = GRP_SET_VALUE_LIST_SWITCH; break;
+ case ValueEditorType::SWITCHES:
+ layout_grp = GRP_SET_VALUE_SWITCHES;
+ break;
+ case ValueEditorType::LIST_SWITCH:
+ layout_grp = GRP_SET_VALUE_LIST_SWITCH;
+ break;
default:
layout_grp = GRP_SET_VALUE_NUMERIC;
SETTING_TRACE_DEBUG("Unrecognized layout type!");
elm_object_part_text_set(ad->set_value_layout.getLayout(), PRT_SET_VALUE_SWITCH_LABEL, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
}
-void SetValuePage::addRadioItem(SettingAccessibility *ad, const std::string& caption, int id, bool selected)
+void SetValuePage::addRadioItem(SettingAccessibility *ad, const std::string &caption, int id, bool selected)
{
retm_if(ad == NULL, "Input parameter is NULL");
GenGroupItemData *item = createGendialGroupItem(ad->set_value_layout.getGenlist(), &itc_1text_1icon_3,
- gendialRadioItemSelectedCb, NULL,
- SwallowType::RADIO_1TEXT, selected ? 0 : -1,
- caption,
- {},
- gendialRadioChangeCb);
+ gendialRadioItemSelectedCb, NULL,
+ SwallowType::RADIO_1TEXT, selected ? 0 : -1,
+ caption,
+ {},
+ gendialRadioChangeCb);
if (item) {
item->userdata = ad;
retm_if(ad == NULL, "Input parameter is NULL");
GenGroupItemData *item = createGendialGroupItem(ad->set_value_layout.getGenlist(), &ad->itc_multiline_sub,
- gl_sel, NULL,
- SwallowType::ICON_RADIO, (int)state,
- caption ? caption : std::string{},
- sub_desc ? sub_desc : std::string{},
- switchItemCheckboxCb);
+ gl_sel, NULL,
+ SwallowType::ICON_RADIO, (int)state,
+ caption ? caption : std::string{},
+ sub_desc ? sub_desc : std::string{},
+ switchItemCheckboxCb);
if (item) {
item->userdata = (void *)ad;
}
}
-void SetValuePage::addRemoveSwitchItem(SettingAccessibility *ad, const std::string& caption, const std::string& subtext, int id, bool state)
+void SetValuePage::addRemoveSwitchItem(SettingAccessibility *ad, const std::string &caption, const std::string &subtext, int id, bool state)
{
retm_if(ad == NULL, "Input parameter is NULL");
GenGroupItemData *item = createGendialGroupItem(ad->set_value_layout.getGenlist(), &itc_1text_1icon_3,
- gendialRemoveSelectedItemCb, NULL,
- SwallowType::CHECK, (int)state,
- caption,
- subtext,
- gendialRemoveCheckboxItemCb);
+ gendialRemoveSelectedItemCb, NULL,
+ SwallowType::CHECK, (int)state,
+ caption,
+ subtext,
+ gendialRemoveCheckboxItemCb);
if (item) {
item->userdata = (void *)ad;
}
}
-GenGroupItemData* SetValuePage::addRadioListItem(SettingAccessibility *ad, const char *main_text, const char *sub_text, int option_id)
+GenGroupItemData *SetValuePage::addRadioListItem(SettingAccessibility *ad, const char *main_text, const char *sub_text, int option_id)
{
retvm_if(ad == NULL, NULL, "Input parameter is NULL");
ad->set_value_layout.getOptionsData().push_back(opt_item);
GenGroupItemData *item = createGendialGroupItem(ad->set_value_layout.getGenlist(), &itc_2text,
- listItemClickCb, opt_item,
- SwallowType::INVALID, 0,
- main_text ? main_text : std::string{},
- sub_text ? sub_text : std::string{},
- NULL);
+ listItemClickCb, opt_item,
+ SwallowType::INVALID, 0,
+ main_text ? main_text : std::string{},
+ sub_text ? sub_text : std::string{},
+ NULL);
if (item)
elm_object_item_disabled_set(item->item, !elm_check_state_get(ad->set_value_layout.getCheck()));
{
retm_if(user_data == NULL, "Data parameter is NULL");
retm_if(node == NULL, "Data parameter is NULL");
- auto ad = static_cast<SettingAccessibility*>(user_data);
+ auto ad = static_cast<SettingAccessibility *>(user_data);
int ret = vconf_keynode_get_bool(node);
retm_if(ret < 0, "FAIL: vconf_keynode_get_bool");
if (elm_check_state_get(ad->set_value_layout.getCheck()) != ret) {
void SetValuePage::addActionGendialField(SettingAccessibility *ad)
{
createGendialGroupItem(ad->update_accessories_action_genlist, &itc_1text,
- updateSwitchAction, ad,
- SwallowType::INVALID, 0,
- "IDS_ACCS_UNIVERSAL_SWITCH_ACTION",
- setting_accessibility_universal_switch_dbus_config_get_activity_name(&ad->config, ad->config_item_to_update.activity_type),
- NULL);
+ updateSwitchAction, ad,
+ SwallowType::INVALID, 0,
+ "IDS_ACCS_UNIVERSAL_SWITCH_ACTION",
+ setting_accessibility_universal_switch_dbus_config_get_activity_name(&ad->config, ad->config_item_to_update.activity_type),
+ NULL);
}
void SetValuePage::updateSwitchAction(void *data, Evas_Object *obj, void *event_info)
{
elm_genlist_item_selected_set((Elm_Genlist_Item *)event_info, 0);
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
retm_if(ad == NULL, "Data argument is NULL");
ad->actionPage_ = std::make_unique<ActionPage>(ad);
ActionPage::attachCallback(ad, updateSwitchChooseAction, NULL);
}
-void SetValuePage::updateSwitchChooseAction(SettingAccessibility *ad, const std::string& action, void *user_data)
+void SetValuePage::updateSwitchChooseAction(SettingAccessibility *ad, const std::string &action, void *user_data)
{
ad->config_item_to_update.activity_type = action;
updateGendialActionField(ad);
void SetValuePage::closeUpdateAccessoriesSwitchPage(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
retm_if(ad == NULL, "Data argument is NULL");
if (event_info == ad->save_object_item)
elm_genlist_item_selected_set(item, 0);
- auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+ auto list_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
if (list_item->chk_status)
setting_update_gl_item_chk_status(list_item, 0);
void SetValuePage::gendialRadioChangeCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Input parameter is NULL");
- auto list_item = static_cast<GenGroupItemData*>(data);
+ auto list_item = static_cast<GenGroupItemData *>(data);
callRadioItemChangeCbAndPopNaviframe(list_item);
}
void SetValuePage::callRadioItemChangeCbAndPopNaviframe(GenGroupItemData *list_item)
{
retm_if(list_item == NULL, "Input parameter is NULL");
- auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
+ auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
retm_if(ad == NULL, "Application data is NULL");
if (ad->set_value_layout.radio_item_change_cb)
ad->set_value_layout.radio_item_change_cb(ad, list_item->chk_id);
elm_genlist_item_selected_set(item, 0);
- auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+ auto list_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
setting_update_gl_item_chk_status(list_item,
- list_item->chk_status ? 0 : 1);
+ list_item->chk_status ? 0 : 1);
- auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
+ auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
if (elm_check_state_get(list_item->eo_check))
ad->switches_to_remove_counter++;
void SetValuePage::gendialRemoveCheckboxItemCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Input parameter is NULL");
- auto list_item = static_cast<GenGroupItemData*>(data);
- auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
+ auto list_item = static_cast<GenGroupItemData *>(data);
+ auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
if (elm_check_state_get(list_item->eo_check))
ad->switches_to_remove_counter++;
else
void SetValuePage::switchItemCheckboxCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Input parameter is NULL");
- auto list_item = static_cast<GenGroupItemData*>(data);
- auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
+ auto list_item = static_cast<GenGroupItemData *>(data);
+ auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
if (ad->set_value_layout.switch_item_change_cb) {
bool state = elm_check_state_get(list_item->eo_check);
}
}
-Evas_Object* SetValuePage::createGenlist(Evas_Object *parent, const char *title)
+Evas_Object *SetValuePage::createGenlist(Evas_Object *parent, const char *title)
{
retvm_if(parent == NULL, NULL, "Input parameter is NULL");
return genlist;
}
-Evas_Object* SetValuePage::createCheck(Evas_Object *parent, bool state)
+Evas_Object *SetValuePage::createCheck(Evas_Object *parent, bool state)
{
retvm_if(parent == NULL, NULL, "Input parameter is NULL");
return check;
}
-Evas_Object* SetValuePage::createLabel(Evas_Object *parent, const char *caption)
+Evas_Object *SetValuePage::createLabel(Evas_Object *parent, const char *caption)
{
retvm_if(parent == NULL || caption == NULL, NULL, "Input parameter is NULL");
return label;
}
-Evas_Object* SetValuePage::createBox(Evas_Object *parent)
+Evas_Object *SetValuePage::createBox(Evas_Object *parent)
{
Evas_Object *box;
retvm_if(parent == NULL, NULL, "Input parameter is NULL");
return box;
}
-Evas_Object* SetValuePage::createScroller(Evas_Object *parent)
+Evas_Object *SetValuePage::createScroller(Evas_Object *parent)
{
Evas_Object *scroller;
retvm_if(parent == NULL, NULL, "Input parameter is NULL");
return scroller;
}
-Evas_Object* SetValuePage::createLayout(Evas_Object *parent, const char *layout_grp)
+Evas_Object *SetValuePage::createLayout(Evas_Object *parent, const char *layout_grp)
{
Evas_Object *layout;
retvm_if(parent == NULL || layout_grp == NULL, NULL, "Input parameter is NULL");
- char* res_path = app_get_resource_path();
+ char *res_path = app_get_resource_path();
std::string edj_path;
if (res_path) {
edj_path = std::string{res_path} + std::string{EDJ_SET_VALUE};
{
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
retm_if(data == NULL, "Input parameter is NULL");
- auto opt_item = static_cast<OptionsItem*>(data);
+ auto opt_item = static_cast<OptionsItem *>(data);
retm_if(opt_item->ad->set_value_layout.list_item_options_request_cb == NULL, "Function not provided");
opt_item->ad->set_value_layout.list_item_options_request_cb(opt_item->ad, opt_item->option_id);
{
int page_num = 0;
retm_if(data == NULL, "Data argument is NULL");
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_scroller_current_page_get(ad->set_value_layout.getScroller(), NULL, &page_num);
{
bool state;
retm_if(data == NULL, "Data argument is NULL");
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
state = elm_check_state_get(obj);
Eina_Bool SetValuePage::naviframePopCb(void *data, Elm_Object_Item *it)
{
retv_if(data == NULL, EINA_TRUE);
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_STATE, SetValuePage::syncPageWithVconf);
vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_SOUND_STATE, SetValuePage::syncPageWithVconf);
void SetValuePage::backCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data argument is NULL");
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_naviframe_item_pop(ad->md.getNaviframe());
}
static void setRange(SettingAccessibility *ad, double min, double max, double step);
static void setValue(SettingAccessibility *ad, double value, const char *units);
static void setSwitch(SettingAccessibility *ad, bool state);
- static void addRadioItem(SettingAccessibility *ad, const std::string& caption, int id, bool selected);
+ static void addRadioItem(SettingAccessibility *ad, const std::string &caption, int id, bool selected);
static void addSwitchItem(SettingAccessibility *ad, const char *caption, const char *sub_desc, int id, bool state, SettingCallback gl_sel);
- static void addRemoveSwitchItem(SettingAccessibility *ad, const std::string& caption, const std::string& subtext, int id, bool state);
- static GenGroupItemData* addRadioListItem(SettingAccessibility *ad, const char *main_text, const char *sub_text, int option_id);
+ static void addRemoveSwitchItem(SettingAccessibility *ad, const std::string &caption, const std::string &subtext, int id, bool state);
+ static GenGroupItemData *addRadioListItem(SettingAccessibility *ad, const char *main_text, const char *sub_text, int option_id);
static void addValueChangedCb(SettingAccessibility *ad, changeValueCb cb);
static void addSwitchChangedCb(SettingAccessibility *ad, changeSwitchCb cb);
static void addRadioItemChangedCb(SettingAccessibility *ad, changeRadioItemCb cb);
private:
static void addActionGendialField(SettingAccessibility *ad);
static void updateSwitchAction(void *data, Evas_Object *obj, void *event_info);
- static void updateSwitchChooseAction(SettingAccessibility *ad, const std::string& action, void *user_data); //TODO rename
+ static void updateSwitchChooseAction(SettingAccessibility *ad, const std::string &action, void *user_data); //TODO rename
static void updateGendialActionField(SettingAccessibility *ad);
static void closeUpdateAccessoriesSwitchPage(void *data, Evas_Object *obj, void *event_info);
static void saveAccessoriesSwitchUpdateChanges(SettingAccessibility *ad); //TODO rename
static void gendialRemoveSelectedItemCb(void *data, Evas_Object *obj, void *event_info);
static void gendialRemoveCheckboxItemCb(void *data, Evas_Object *obj, void *event_info);
static void switchItemCheckboxCb(void *data, Evas_Object *obj, void *event_info);
- static Evas_Object* createGenlist(Evas_Object *parent, const char *title);
- static Evas_Object* createCheck(Evas_Object *parent, bool state);
- static Evas_Object* createLabel(Evas_Object *parent, const char *caption);
- static Evas_Object* createBox(Evas_Object *parent);
+ static Evas_Object *createGenlist(Evas_Object *parent, const char *title);
+ static Evas_Object *createCheck(Evas_Object *parent, bool state);
+ static Evas_Object *createLabel(Evas_Object *parent, const char *caption);
+ static Evas_Object *createBox(Evas_Object *parent);
static Evas_Object *createScroller(Evas_Object *parent);
static Evas_Object *createLayout(Evas_Object *parent, const char *layout_grp);
static void displayValue(SettingAccessibility *ad, double value);
class UniversalSwitchSettingsPage;
class SetValuePage;
-typedef void (*switch_action_cb)(SettingAccessibility *ad, const std::string& action, void *user_data);
+typedef void (*switch_action_cb)(SettingAccessibility *ad, const std::string &action, void *user_data);
typedef void (*back_cb)(SettingAccessibility *ad);
#include "setting-common-draw-widget.h"
SettingPopup::SettingPopup(void *data, Evas_Object *parent,
- const std::string& title, const std::string& text,
- SettingCallback response_cb, int timeout,
- bool blocked_flag,
- bool keygrab_flag, std::vector<std::string> buttons)
+ const std::string &title, const std::string &text,
+ SettingCallback response_cb, int timeout,
+ bool blocked_flag,
+ bool keygrab_flag, std::vector<std::string> buttons)
{
Evas_Object *popup = elm_popup_add(parent);
elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_object_text_set(popup, TranslatedString{text}.c_str());
+ elm_object_text_set(popup, TranslatedString{text} .c_str());
- elm_object_part_text_set(popup, "title,text", TranslatedString{title}.c_str());
+ elm_object_part_text_set(popup, "title,text", TranslatedString{title} .c_str());
if (timeout > 0)
elm_popup_timeout_set(popup, timeout);
setEvent(popup, data, response_cb, onTimeout, timeout, blocked_flag, keygrab_flag);
- evas_object_data_set(popup, "title", TranslatedString{title}.c_str());
- evas_object_data_set(popup, "text", TranslatedString{text}.c_str());
+ evas_object_data_set(popup, "title", TranslatedString{title} .c_str());
+ evas_object_data_set(popup, "text", TranslatedString{text} .c_str());
auto r = vconf_notify_key_changed(VCONFKEY_LANGSET, onLanguageChange, popup);
if (!r)
SETTING_TRACE_ERROR("Could not get value for key: %s", VCONFKEY_SETAPPL_ACCESSIBILITY_TTS);
Evas_Object *btn = setting_create_button(popup, buttons[i], {}, response_cb, data);
elm_object_style_set(btn, "popup");
elm_object_part_content_set(popup, buttons_parts[i].c_str(), btn);
- evas_object_data_set(popup, buttons_parts[i].c_str(), TranslatedString{buttons[i]}.c_str());
+ evas_object_data_set(popup, buttons_parts[i].c_str(), TranslatedString{buttons[i]} .c_str());
}
} else {
SETTING_TRACE_ERROR("incorrect button number for popup");
}
void SettingPopup::setEvent(Evas_Object *popup, void *data,
- SettingCallback response_cb,
- SettingCallback back_cb, int timeout,
- bool blocked_flag,
- bool keygrab_flag)
+ SettingCallback response_cb,
+ SettingCallback back_cb, int timeout,
+ bool blocked_flag,
+ bool keygrab_flag)
{
if (timeout > 0) {
if (response_cb)
void SettingPopup::onPopupKeygrabDel(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
- #ifdef ECORE_X
- Ecore_X_Window xwin = elm_win_xwindow_get(obj);
+#ifdef ECORE_X
+ Ecore_X_Window xwin = elm_win_xwindow_get(obj);
- int ret = eext_win_keygrab_unset(xwin, "XF86Home");
- if (ret)
- SETTING_TRACE_ERROR("KEY_HOME ungrab error ret[%d]", ret);
+ int ret = eext_win_keygrab_unset(xwin, "XF86Home");
+ if (ret)
+ SETTING_TRACE_ERROR("KEY_HOME ungrab error ret[%d]", ret);
- ret = eext_win_keygrab_unset(xwin, "XF86Back");
- if (ret)
- SETTING_TRACE_ERROR("KEY_BACK ungrab error ret[%d]", ret);
- #endif
+ ret = eext_win_keygrab_unset(xwin, "XF86Back");
+ if (ret)
+ SETTING_TRACE_ERROR("KEY_BACK ungrab error ret[%d]", ret);
+#endif
}
void SettingPopup::updateLanguage(Evas_Object *popup)
{
setting_retm_if(NULL == popup, "data is NULL");
- auto title = static_cast<char*>(evas_object_data_get(popup, "title"));
- auto text1 = static_cast<char*>(evas_object_data_get(popup, "text"));
- auto text0 = static_cast<char*>(evas_object_data_get(popup, "text0"));
+ auto title = static_cast<char *>(evas_object_data_get(popup, "title"));
+ auto text1 = static_cast<char *>(evas_object_data_get(popup, "text"));
+ auto text0 = static_cast<char *>(evas_object_data_get(popup, "text0"));
std::string text; // TODO change this variable into TranslatedString
if (text0) {
- text = TranslatedString{text0}.str() + "<br>" + TranslatedString{text1}.str();
+ text = TranslatedString{text0} .str() + "<br>" + TranslatedString{text1} .str();
} else {
- text = TranslatedString{text1}.str();
+ text = TranslatedString{text1} .str();
}
if (title)
* @param buttons buttons to show in the popup
**********************************************************/
SettingPopup(void *data, Evas_Object *parent,
- const std::string& title, const std::string& text,
- SettingCallback response_cb, int timeout,
- bool blocked_flag,
- bool keygrab_flag, std::vector<std::string> buttons);
+ const std::string &title, const std::string &text,
+ SettingCallback response_cb, int timeout,
+ bool blocked_flag,
+ bool keygrab_flag, std::vector<std::string> buttons);
Evas_Object *getObject() const;
~SettingPopup();
private:
void setEvent(Evas_Object *popup, void *data,
- SettingCallback response_cb,
- SettingCallback back_cb, int timeout,
- bool blocked_flag,
- bool keygrab_flag);
+ SettingCallback response_cb,
+ SettingCallback back_cb, int timeout,
+ bool blocked_flag,
+ bool keygrab_flag);
static void onTimeout(void *data, Evas_Object *obj, void *event_info);
static void onLanguageChange(keynode_t *key, void *data);
static void onPopupDel(void *data, Evas *e, Evas_Object *obj, void *event_info);
retm_if(ad == NULL, "Input argument is NULL");
GenGroupItemData *item = createGendialGroupItem(genlist, &itc_1text_1icon_3,
- addSwitchClickedCb, ad,
- SwallowType::ICON_IMAGE, 0,
- "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SWITCHES_ADD_SWITCH",
- {},
- NULL);
+ addSwitchClickedCb, ad,
+ SwallowType::ICON_IMAGE, 0,
+ "IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SWITCHES_ADD_SWITCH",
+ {},
+ NULL);
if (item) {
item->l_swallow_path = ACCESSIBILITY_UNIVERSAL_SWITCH_PLUS_ICON;
void SwitchesPage::createRemovePageCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data argument is NULL");
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
ad->removeSwitchPage_ = std::make_unique<RemoveSwitchPage>(ad);
RemoveSwitchPage::attachCallback(ad, switchRemovedCb);
{
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 ad = static_cast<SettingAccessibility *>(data);
AddSwitchPage::attachCallbackOnSwitchAttach(ad, addSwitchCb);
ad->addSwitchPage_ = std::make_unique<AddSwitchPage>(ad);
elm_genlist_item_selected_set(item, EINA_FALSE);
retm_if(data == NULL, "Data argument is NULL");
- auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
- auto config_item = static_cast<UniversalSwitchConfigurationItem*>(list_item->userdata);
+ auto list_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
+ auto config_item = static_cast<UniversalSwitchConfigurationItem *>(list_item->userdata);
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
UpdateSwitchPage::attachActionCallback(ad, switchUpdatedCb);
ad->updateSwitchPage_ = std::make_unique<UpdateSwitchPage>(ad, config_item);
}
-void SwitchesPage::switchUpdatedCb(SettingAccessibility *ad, const std::string& switch_id, const std::string& switch_action, const std::string& switch_name)
+void SwitchesPage::switchUpdatedCb(SettingAccessibility *ad, const std::string &switch_id, const std::string &switch_action, const std::string &switch_name)
{
retm_if(ad == NULL, "Input parameter is NULL");
updateSwitchesList(ad, ad->universal_switch_switches);
}
-void SwitchesPage::switchRemovedCb(SettingAccessibility *ad, const std::string& switch_id, const std::string& switch_action, const std::string& switch_name)
+void SwitchesPage::switchRemovedCb(SettingAccessibility *ad, const std::string &switch_id, const std::string &switch_action, const std::string &switch_name)
{
retm_if(ad == NULL, "Input parameter is NULL");
updateSwitchesList(ad, ad->universal_switch_switches);
}
-void SwitchesPage::addSwitchCb(SettingAccessibility *ad, const std::string& switch_id, const std::string& switch_action, const std::string& switch_name)
+void SwitchesPage::addSwitchCb(SettingAccessibility *ad, const std::string &switch_id, const std::string &switch_action, const std::string &switch_name)
{
retm_if(ad == NULL, "Input parameter is NULL");
updateSwitchesList(ad, ad->universal_switch_switches);
}
-GenGroupItemData* SwitchesPage::addMappedSwitchMenuItem(SettingAccessibility *ad, Evas_Object *genlist, const std::string& main_text,
- const std::string& sub_text, SettingCallback item_cb, void *user_data)
+GenGroupItemData *SwitchesPage::addMappedSwitchMenuItem(SettingAccessibility *ad, Evas_Object *genlist, const std::string &main_text,
+ const std::string &sub_text, SettingCallback item_cb, void *user_data)
{
retvm_if(ad == NULL, NULL, "Input argument is NULL");
retvm_if(genlist == NULL, NULL, "Input genlist argument is NULL");
auto item = createGendialGroupItem(genlist, &itc_2text_1icon_3,
- item_cb, ad,
- SwallowType::INVALID, 0,
- main_text,
- sub_text,
- NULL);
+ item_cb, ad,
+ SwallowType::INVALID, 0,
+ main_text,
+ sub_text,
+ NULL);
if (item)
item->userdata = user_data;
Eina_Bool SwitchesPage::naviframePopCb(void *data, Elm_Object_Item *it)
{
retv_if(data == NULL, EINA_TRUE);
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
if (ad->universal_switch_switches_back)
ad->universal_switch_switches_back(ad);
void SwitchesPage::backCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data argument is NULL");
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_naviframe_item_pop(ad->md.getNaviframe());
}
using back_cb = void(*)(SettingAccessibility *ad); //TODO: probably remove
SwitchesPage(SettingAccessibility *ad);
static void attachCallback(SettingAccessibility *ad, back_cb callback);
- static void addSwitchCb(SettingAccessibility *ad, const std::string& switch_id, const std::string& switch_action, const std::string& switch_name);
+ static void addSwitchCb(SettingAccessibility *ad, const std::string &switch_id, const std::string &switch_action, const std::string &switch_name);
private:
static void updateSwitchesList(SettingAccessibility *ad, Evas_Object *genlist);
static void createRemovePageCb(void *data, Evas_Object *obj, void *event_info);
static void addSwitchClickedCb(void *data, Evas_Object *obj, void *event_info);
static void switchClickCb(void *data, Evas_Object *obj, void *event_info);
- static void switchUpdatedCb(SettingAccessibility *ad, const std::string& switch_id, const std::string& switch_action, const std::string& switch_name);
- static void switchRemovedCb(SettingAccessibility *ad, const std::string& switch_id, const std::string& switch_action, const std::string& switch_name);
- static GenGroupItemData * addMappedSwitchMenuItem(SettingAccessibility *ad, Evas_Object *genlist, const std::string& main_text,
- const std::string& sub_text, SettingCallback item_cb, void *user_data);
+ static void switchUpdatedCb(SettingAccessibility *ad, const std::string &switch_id, const std::string &switch_action, const std::string &switch_name);
+ static void switchRemovedCb(SettingAccessibility *ad, const std::string &switch_id, const std::string &switch_action, const std::string &switch_name);
+ static GenGroupItemData *addMappedSwitchMenuItem(SettingAccessibility *ad, Evas_Object *genlist, const std::string &main_text,
+ const std::string &sub_text, SettingCallback item_cb, void *user_data);
static Eina_Bool naviframePopCb(void *data, Elm_Object_Item *it);
static void backCb(void *data, Evas_Object *obj, void *event_info);
#include <cstring>
#include <appcore-common.h>
-TranslatedString::TranslatedString(const std::string& str)
+TranslatedString::TranslatedString(const std::string &str)
: value(std::string{gettext(str.c_str())})
{}
-TranslatedString::TranslatedString(const char* str)
+TranslatedString::TranslatedString(const char *str)
: value(std::string{gettext(str), strlen(gettext(str))})
{}
return value;
}
-const char* TranslatedString::c_str() const
+const char *TranslatedString::c_str() const
{
return value.c_str();
}
{
public:
TranslatedString() = default;
- TranslatedString(const std::string& str);
- TranslatedString(const char* str);
+ TranslatedString(const std::string &str);
+ TranslatedString(const char *str);
bool empty() const;
std::string str() const;
- const char* c_str() const;
+ const char *c_str() const;
private:
std::string value;
#include <string>
#include <functional>
-enum class ScanMethod
-{
- POINT = 1,
- ROW
+enum class ScanMethod {
+ POINT = 1,
+ ROW
};
-enum class ScanDirection
-{
- TO_BOTTOM = 1,
- TO_TOP
+enum class ScanDirection {
+ TO_BOTTOM = 1,
+ TO_TOP
};
class SettingAccessibility;
-using UniversalSwitchUpdateCb = std::function<void(SettingAccessibility*, const std::string&, const std::string&, const std::string&)>;
+using UniversalSwitchUpdateCb = std::function<void(SettingAccessibility *, const std::string &, const std::string &, const std::string &)>;
/**
* Class containing cached parameteres required by Universal Switch
}
ad->universal_switch_off_checkbox = createGendialGroupItem(
- genlist, &itc_1text_1icon,
- listCb,
- ad, SwallowType::ICON_RADIO, state,
- "IDS_ACCS_UNIVERSAL_SWITCH_OFF",
- {}, checkboxCb);
+ genlist, &itc_1text_1icon,
+ listCb,
+ ad, SwallowType::ICON_RADIO, state,
+ "IDS_ACCS_UNIVERSAL_SWITCH_OFF",
+ {}, checkboxCb);
if (ad->universal_switch_off_checkbox) {
ad->universal_switch_off_checkbox->userdata = ad;
}
ad->universal_switch_comment = createGendialGroupItem(
- genlist, &ad->itc_multiline_sub,
- NULL, ad, SwallowType::INVALID, 0,
- {},
- "IDS_ACCS_UNIVERSAL_SWITCH_COMMENT",
- NULL);
+ genlist, &ad->itc_multiline_sub,
+ NULL, ad, SwallowType::INVALID, 0,
+ {},
+ "IDS_ACCS_UNIVERSAL_SWITCH_COMMENT",
+ NULL);
if (ad->universal_switch_comment) {
ad->universal_switch_comment->userdata = ad;
elm_naviframe_item_pop_cb_set(ad->md.naviframe_it, naviframePopCb, ad);
ad->universal_switch_main_item = ad->md.naviframe_it;
- std::string title_str = "<font_size=30>" + TranslatedString{"IDS_ACCS_SETTINGS_CAPS"}.str() + "</font_size>";
+ std::string title_str = "<font_size=30>" + TranslatedString{"IDS_ACCS_SETTINGS_CAPS"} .str() + "</font_size>";
ad->universal_switch_settings_btn = setting_create_button(ad->md.getNaviframe(), title_str, "naviframe/title_right", createSettingsPage, ad);
if (ad->universal_switch_settings_btn)
void UniversalSwitchPage::createSettingsPage(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
retm_if(ad == NULL, "Input parameter is NULL");
ad->universalSwitchSettingsPage_ = std::make_unique<UniversalSwitchSettingsPage>(ad);
void UniversalSwitchPage::updateVconfKey(int state, void *data)
{
retm_if(data == NULL, "Data parameter is NULL");
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
int switch_count = setting_accessibility_universal_switch_dbus_config_get_switch_count(&ad->config);
if (state && switch_count == 0) {
elm_check_state_set(ad->universal_switch_off_checkbox->eo_check, EINA_FALSE);
ad->md.naviframe_it = elm_naviframe_top_item_get(ad->md.getNaviframe());
ad->settingPopup_ = std::make_unique<SettingPopup>(data, ad->md.getWindow(),
- std::string{}, "To turn on Universal switch, tap ADD SWITCH and add at least one switch",
- popupResponseCb, 0,
- true,
- true,
- std::vector<std::string>{"IDS_ACCS_UNIVERSAL_SWITCH_POPUP_ADD", "IDS_ACCS_UNIVERSAL_SWITCH_CANCEL"});
+ std::string{}, "To turn on Universal switch, tap ADD SWITCH and add at least one switch",
+ popupResponseCb, 0,
+ true,
+ true,
+ std::vector<std::string> {"IDS_ACCS_UNIVERSAL_SWITCH_POPUP_ADD", "IDS_ACCS_UNIVERSAL_SWITCH_CANCEL"});
} else {
setState(state);
}
}
-void UniversalSwitchPage::onNewSwitchAddition(SettingAccessibility *ad, const std::string& switch_id, const std::string& switch_action, const std::string& switch_name)
+void UniversalSwitchPage::onNewSwitchAddition(SettingAccessibility *ad, const std::string &switch_id, const std::string &switch_action, const std::string &switch_name)
{
retm_if(ad == NULL, "Input parameter is NULL");
SwitchesPage::addSwitchCb(ad, switch_id, switch_action, switch_name);
void UniversalSwitchPage::popupResponseCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
auto response_type = get_popup_btn_response_type(obj);
SETTING_TRACE_DEBUG("popup response_type: %i", static_cast<int>(response_type));
void UniversalSwitchPage::backCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data argument is NULL");
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_naviframe_item_pop(ad->md.getNaviframe());
}
Eina_Bool UniversalSwitchPage::naviframePopCb(void *data, Elm_Object_Item *it)
{
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_INTERACTION_SERVICE, onVconfKeyChange);
stopUniversalSwitch(ad);
setting_accessibility_universal_switch_dbus_config_init(&ad->config, onUniversalSwitchStarting, ad);
}
-void UniversalSwitchPage::onUniversalSwitchStarting(void * data)
+void UniversalSwitchPage::onUniversalSwitchStarting(void *data)
{
SETTING_TRACE_DEBUG("universal-switch started");
retm_if(data == NULL, "Data argument is NULL");
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
if (ad->universal_switch_off_checkbox)
elm_object_item_disabled_set(ad->universal_switch_off_checkbox->item, EINA_FALSE);
elm_genlist_item_selected_set(item, EINA_FALSE);
- auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+ auto list_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
setting_retm_if(data == NULL, "Data parameter is NULL");
setting_update_gl_item_chk_status(list_item, list_item->chk_status ? 0 : 1);
updateVconfKey(list_item->chk_status ? 1 : 0, list_item->userdata);
void UniversalSwitchPage::checkboxCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
- auto list_item = static_cast<GenGroupItemData*>(data);
+ auto list_item = static_cast<GenGroupItemData *>(data);
list_item->chk_status = elm_check_state_get(obj);
void UniversalSwitchPage::onVconfKeyChange(keynode_t *node, void *user_data)
{
int state;
- auto ad = static_cast<SettingAccessibility*>(user_data);
+ auto ad = static_cast<SettingAccessibility *>(user_data);
state = vconf_keynode_get_bool(node);
if (state >= 0)
static void displayState(SettingAccessibility *ad, bool state);
static bool setState(bool state);
static void updateVconfKey(int state, void *data); //TODO rename
- static void onNewSwitchAddition(SettingAccessibility *ad, const std::string& switch_id, const std::string& switch_action, const std::string& switch_name);
+ static void onNewSwitchAddition(SettingAccessibility *ad, const std::string &switch_id, const std::string &switch_action, const std::string &switch_name);
static void popupResponseCb(void *data, Evas_Object *obj, void *event_info);
static void backCb(void *data, Evas_Object *obj, void *event_info);
static Eina_Bool naviframePopCb(void *data, Elm_Object_Item *it);
static void stopUniversalSwitch(SettingAccessibility *ad);
static void startUniversalSwitch(SettingAccessibility *ad);
- static void onUniversalSwitchStarting(void * data);
+ static void onUniversalSwitchStarting(void *data);
static void listCb(void *data, Evas_Object *obj, void *event_info); //TODO rename
static void checkboxCb(void *data, Evas_Object *obj, void *event_info);
static void onVconfKeyChange(keynode_t *node, void *user_data);
#define DEFAULT_FEEDBACK_VOICE_SPEECH_VOLUME 50
#define DEFAULT_MANAGE_OPTIONS_VALUE true
-enum class VoiceFeedbackAttribute : int
-{
+enum class VoiceFeedbackAttribute : int {
SPEECH_RATE,
VOLUME
};
};
const char *_manage_options_key_array[] = {
- VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_GESTURES,
- VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_ACTIONS,
- VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_SETTINGS,
- VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_RECENT_APPS,
- VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_HOMESCREEN,
- VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_BACK,
- VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_KEYS,
- VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_CONTEXTUAL_MENU
+ VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_GESTURES,
+ VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_ACTIONS,
+ VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_SETTINGS,
+ VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_RECENT_APPS,
+ VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_HOMESCREEN,
+ VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_BACK,
+ VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_KEYS,
+ VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_MANAGE_CONTEXTUAL_MENU
};
UniversalSwitchSettingsPage::UniversalSwitchSettingsPage(SettingAccessibility *ad)
void UniversalSwitchSettingsPage::createManageGroup(SettingAccessibility *ad, Evas_Object *genlist)
{
addMenuItem(ad, genlist, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE"),
- _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE_SUB"), manageOptionsCb, false, false, NULL);
+ _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_MANAGE_SUB"), manageOptionsCb, false, false, NULL);
}
void UniversalSwitchSettingsPage::createFeedbackGroup(SettingAccessibility *ad, Evas_Object *genlist)
str, cursorColorCb, false, false, NULL);
str = getBoleanText(ad->us_configuration.feedback_sound_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_ON"),
- _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ _("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);
+ 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);
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"),
- _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ _("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);
+ 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);
if (vconf_ret)
SETTING_TRACE_ERROR("FAIL: vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_FEEDBACK_VOICE_STATE)");
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->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.c_str(), pauseOnFirstCb, true, ad->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);
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->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.c_str(), tapDurationCb, true, ad->us_configuration.tap_duration_state, tapDurationCheckboxCb);
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->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.c_str(), sglInactionIntervalCb, true, ad->us_configuration.sgl_iaction_int_state, sglInactionIntervalCheckboxCb);
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->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.c_str(), autoTapCb, true, ad->us_configuration.auto_tap_state, autoTapCheckboxCb);
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->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.c_str(), autoMoveIntervalCb, true, ad->us_configuration.auto_move_int_state, autoMoveIntervalCheckboxCb);
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);
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);
+ _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_ADD_SETTINGS_AUTO_TAP_KBD_SUB"), autoTapKBDMenuItemSelected, true, ad->us_configuration.auto_tap_kbd_state, autoTapKbdCheckboxCb);
}
void UniversalSwitchSettingsPage::autoTapKBDMenuItemSelected(void *data, Evas_Object *obj, void *event_info)
elm_genlist_item_selected_set(item, EINA_FALSE);
- auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+ auto list_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
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);
+ auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
ad->us_configuration.auto_tap_kbd_state = list_item->chk_status;
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_TAP_KBD_STATE, (bool *)&list_item->chk_status, NULL, NULL);
evas_object_move(ctxpopup, -1, y + h);
}
-Evas_Object* UniversalSwitchSettingsPage::createCtxPopup(SettingAccessibility *ad)
+Evas_Object *UniversalSwitchSettingsPage::createCtxPopup(SettingAccessibility *ad)
{
Evas_Object *ctxpopup = NULL;
retvm_if(ad == NULL, NULL, "Input parameter is NULL");
return ctxpopup;
}
-const char* UniversalSwitchSettingsPage::getScanDirectionText(ScanDirection direction)
+const char *UniversalSwitchSettingsPage::getScanDirectionText(ScanDirection direction)
{
switch (direction) {
- case ScanDirection::TO_BOTTOM: return _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_DIR_TB");
- case ScanDirection::TO_TOP: return _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_DIR_BT");
- default: return _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_UNDEFINED");
+ case ScanDirection::TO_BOTTOM:
+ return _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_DIR_TB");
+ case ScanDirection::TO_TOP:
+ return _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_DIR_BT");
+ default:
+ return _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_UNDEFINED");
}
}
-const char* UniversalSwitchSettingsPage::getScanMethodText(ScanMethod method)
+const char *UniversalSwitchSettingsPage::getScanMethodText(ScanMethod method)
{
switch (method) {
- case ScanMethod::POINT: return _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_METHOD_POINT");
- case ScanMethod::ROW: return _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_METHOD_ROW");
- default: return _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_UNDEFINED");
+ case ScanMethod::POINT:
+ return _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_METHOD_POINT");
+ case ScanMethod::ROW:
+ return _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_SCANNING_SCAN_METHOD_ROW");
+ default:
+ return _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_UNDEFINED");
}
}
-const char* UniversalSwitchSettingsPage::getBoleanText(bool bvalue, const char *t_str, const char *f_str)
+const char *UniversalSwitchSettingsPage::getBoleanText(bool bvalue, const char *t_str, const char *f_str)
{
if (bvalue)
return t_str;
return ss.str();
}
-GenGroupItemData* UniversalSwitchSettingsPage::addMenuItem(SettingAccessibility *ad, Evas_Object *genlist, const char *main_text, const char *sub_text,
+GenGroupItemData *UniversalSwitchSettingsPage::addMenuItem(SettingAccessibility *ad, Evas_Object *genlist, const char *main_text, const char *sub_text,
SettingCallback item_cb, bool chk, bool chk_state, SettingCallback chk_cb)
{
retvm_if(ad == NULL, NULL, "Input argument is NULL");
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);
+ item_cb, ad,
+ item_type, (int)chk_state,
+ main_text,
+ sub_text ? sub_text : std::string{},
+ chk_cb);
if (item)
item->userdata = ad;
void UniversalSwitchSettingsPage::manageOptionsCb(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
retm_if(ad == NULL, "Data argument is NULL");
for (auto i = 0u; i < utils::lenOf(_manage_options); ++i)
SetValuePage::addSwitchItem(ad, _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],
- manageOptionsItemSelected);
+ (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],
+ manageOptionsItemSelected);
SetValuePage::addSwitchItemChangedCb(ad, manageOptionsCheckboxCb);
}
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
elm_genlist_item_selected_set(item, EINA_FALSE);
- auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+ auto list_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
setting_retm_if(list_item == NULL, "Data parameter is NULL");
- auto ad = static_cast<SettingAccessibility*>(list_item->userdata);
+ auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
list_item->chk_status = ad->us_configuration.manage_options_state[list_item->chk_id] ? 1 : 0;
setting_update_gl_item_chk_status(list_item, list_item->chk_status ? 0 : 1);
void UniversalSwitchSettingsPage::feedbackVoiceCb(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(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_voice_speech_rate) + "%";
ad->universal_switch_feedback_voice_speech_rate = SetValuePage::addRadioListItem(ad,
- _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_VOICE_SPEECH_RATE"), str.c_str(), static_cast<int>(VoiceFeedbackAttribute::SPEECH_RATE));
+ _("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,
- _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_VOICE_SPEECH_VOLUME"), str.c_str(), static_cast<int>(VoiceFeedbackAttribute::VOLUME));
+ _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_VOICE_SPEECH_VOLUME"), str.c_str(), static_cast<int>(VoiceFeedbackAttribute::VOLUME));
SetValuePage::addListItemOptionsRequestCb(ad, feedbackVoiceItemOptionsRequestCb);
}
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 list_item = static_cast<GenGroupItemData *>(data);
+ auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
list_item->chk_status = elm_check_state_get(obj);
ad->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"),
- _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ _("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);
}
void UniversalSwitchSettingsPage::feedbackSoundCb(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
retm_if(ad == NULL, "Data argument is NULL");
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,
- _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_GROUP_FEEDBACK_SOUND_VOLUME"), str.c_str(), 0);
+ _("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);
if (vconf_ret)
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 list_item = static_cast<GenGroupItemData *>(data);
+ auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
list_item->chk_status = elm_check_state_get(obj);
ad->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"),
- _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
+ _("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);
}
void UniversalSwitchSettingsPage::cursorColorCb(void *data, Evas_Object *obj, void *event_info)
{
int i;
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
retm_if(ad == NULL, "Data argument is NULL");
void UniversalSwitchSettingsPage::autoTapKbdCheckboxCb(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 list_item = static_cast<GenGroupItemData *>(data);
+ auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
retm_if(ad == NULL, "View data parameter is NULL");
list_item->chk_status = elm_check_state_get(obj);
void UniversalSwitchSettingsPage::autoMoveIntervalCb(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
retm_if(ad == NULL, "Data argument is 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"));
+ !ad->us_configuration.auto_move_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
elm_genlist_item_update(ad->universal_switch_auto_move_int->item);
}
void UniversalSwitchSettingsPage::autoTapCb(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
retm_if(ad == NULL, "Data argument is 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"));
+ !ad->us_configuration.auto_tap_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
elm_genlist_item_update(ad->universal_switch_auto_tap->item);
}
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"));
+ !ad->us_configuration.auto_tap_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
elm_genlist_item_update(ad->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);
+ auto list_item = static_cast<GenGroupItemData *>(data);
+ auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
retm_if(ad == NULL, "View data parameter is NULL");
list_item->chk_status = elm_check_state_get(obj);
ad->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"));
+ !ad->us_configuration.auto_tap_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
elm_genlist_item_update(ad->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 ad = static_cast<SettingAccessibility *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
retm_if(ad == NULL, "Data argument is 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"));
+ !ad->us_configuration.sgl_iaction_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
elm_genlist_item_update(ad->universal_switch_sgl_iaction_int->item);
}
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"));
+ !ad->us_configuration.sgl_iaction_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
elm_genlist_item_update(ad->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);
+ auto list_item = static_cast<GenGroupItemData *>(data);
+ auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
retm_if(ad == NULL, "View data parameter is NULL");
list_item->chk_status = elm_check_state_get(obj);
ad->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"));
+ !ad->us_configuration.sgl_iaction_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
elm_genlist_item_update(ad->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 ad = static_cast<SettingAccessibility *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
retm_if(ad == NULL, "Data argument is 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"));
+ !ad->us_configuration.tap_duration_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
elm_genlist_item_update(ad->universal_switch_tap_duration->item);
}
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"));
+ !ad->us_configuration.tap_duration_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
elm_genlist_item_update(ad->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);
+ auto list_item = static_cast<GenGroupItemData *>(data);
+ auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
retm_if(ad == NULL, "View data parameter is NULL");
list_item->chk_status = elm_check_state_get(obj);
ad->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"));
+ !ad->us_configuration.tap_duration_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
elm_genlist_item_update(ad->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 ad = static_cast<SettingAccessibility *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
retm_if(ad == NULL, "Data argument is 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"));
+ !ad->us_configuration.pause_on_first_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
elm_genlist_item_update(ad->universal_switch_pause_on_first->item);
}
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"));
+ !ad->us_configuration.pause_on_first_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
elm_genlist_item_update(ad->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);
+ auto list_item = static_cast<GenGroupItemData *>(data);
+ auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
retm_if(ad == NULL, "View data parameter is NULL");
list_item->chk_status = elm_check_state_get(obj);
ad->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"));
+ !ad->us_configuration.pause_on_first_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
elm_genlist_item_update(ad->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 ad = static_cast<SettingAccessibility *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
retm_if(ad == NULL, "Data argument is NULL");
void UniversalSwitchSettingsPage::scanDirectionCb(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *ctxpopup;
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
retm_if(ad == NULL, "Data argument is NULL");
void UniversalSwitchSettingsPage::scanMethodCb(void *data, Evas_Object *obj, void *event_info)
{
Evas_Object *ctxpopup;
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
retm_if(ad == NULL, "Data argument is NULL");
void UniversalSwitchSettingsPage::scanNumberCb(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
retm_if(ad == NULL, "Data argument is NULL");
void UniversalSwitchSettingsPage::autoScanIntervalCb(void *data, Evas_Object *obj, void *event_info)
{
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
retm_if(ad == NULL, "Data argument is NULL");
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));
+ auto ad = static_cast<SettingAccessibility *>(evas_object_data_get(obj, CTXPOPUP_DATA_AD));
retm_if(ad == NULL, "ctxpopup data is NULL");
if (updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SCAN_DIR_VERTICAL, NULL, (int *)&scan_dir, NULL)) {
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));
+ auto ad = static_cast<SettingAccessibility *>(evas_object_data_get(obj, CTXPOPUP_DATA_AD));
retm_if(ad == NULL, "ctxpopup data is NULL");
if (updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_SCAN_METHOD, NULL, (int *)&scan_method, NULL)) {
void UniversalSwitchSettingsPage::autoScanCheckboxCb(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 list_item = static_cast<GenGroupItemData *>(data);
+ auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
retm_if(ad == NULL, "View data parameter is NULL");
list_item->chk_status = elm_check_state_get(obj);
{
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 ad = static_cast<SettingAccessibility *>(data);
ad->switchesPage_ = std::make_unique<SwitchesPage>(ad);
SwitchesPage::attachCallback(ad, updateSwitchesCount);
Eina_Bool UniversalSwitchSettingsPage::naviframPopCb(void *data, Elm_Object_Item *it)
{
- auto ad = static_cast<SettingAccessibility*>(data);
+ 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);
void UniversalSwitchSettingsPage::backCb(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data argument is NULL");
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_naviframe_item_pop(ad->md.getNaviframe());
}
{
retm_if(user_data == NULL, "Data parameter is NULL");
retm_if(node == NULL, "Data parameter is NULL");
- auto list_item = static_cast<GenGroupItemData*>(user_data);
+ auto list_item = static_cast<GenGroupItemData *>(user_data);
int ret = vconf_keynode_get_bool(node);
retm_if(ret < 0, "FAIL: vconf_keynode_get_bool");
if (list_item->chk_status != ret) {
void UniversalSwitchSettingsPage::autoMoveIntervalCheckboxCb(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 list_item = static_cast<GenGroupItemData *>(data);
+ auto ad = static_cast<SettingAccessibility *>(list_item->userdata);
retm_if(ad == NULL, "View data parameter is NULL");
list_item->chk_status = elm_check_state_get(obj);
ad->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"));
+ !ad->us_configuration.auto_move_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
elm_genlist_item_update(ad->universal_switch_auto_move_int->item);
updateVconfValue(VCONFKEY_SETAPPL_ACCESSIBILITY_UNIVERSAL_SWITCH_SETTINGS_AUTO_MOVE_INT_STATE, (bool *)&list_item->chk_status, NULL, NULL);
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"));
+ !ad->us_configuration.auto_move_int_state, _("IDS_ACCS_UNIVERSAL_SWITCH_SETTINGS_OFF"));
elm_genlist_item_update(ad->universal_switch_auto_move_int->item);
}
elm_genlist_item_selected_set(item, EINA_FALSE);
- auto list_item = static_cast<GenGroupItemData*>(elm_object_item_data_get(item));
+ auto list_item = static_cast<GenGroupItemData *>(elm_object_item_data_get(item));
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);
+ 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);
static void onAutoScanItemSelection(void *data, Evas_Object *obj, void *event_info);
static void createSwitchesGroup(SettingAccessibility *ad, Evas_Object *genlist);
static void setCtxPopupPosition(SettingAccessibility *ad, Evas_Object *ctxpopup);
- static Evas_Object* createCtxPopup(SettingAccessibility *ad);
- static const char* getScanDirectionText(ScanDirection direction);
- static const char* getScanMethodText(ScanMethod method);
- static const char* getBoleanText(bool bvalue, const char *t_str, const char *f_str);
+ static Evas_Object *createCtxPopup(SettingAccessibility *ad);
+ static const char *getScanDirectionText(ScanDirection direction);
+ static const char *getScanMethodText(ScanMethod method);
+ static const char *getBoleanText(bool bvalue, const char *t_str, const char *f_str);
static std::string getValueUnitText(int *ivalue, double *dvalue, const char *units, bool def_trigger, const char *def);
- static GenGroupItemData* addMenuItem(SettingAccessibility *ad, Evas_Object *genlist, const char *main_text, const char *sub_text,
- SettingCallback item_cb, bool chk, bool chk_state, SettingCallback chk_cb);
+ static GenGroupItemData *addMenuItem(SettingAccessibility *ad, Evas_Object *genlist, const char *main_text, const char *sub_text,
+ SettingCallback item_cb, bool chk, bool chk_state, SettingCallback chk_cb);
static void getVconfSettings(SettingAccessibility *ad);
static int getAndConvertVconfValue(const char *key);
static bool updateVconfValue(const char *key, bool *bvalue, int *ivalue, double *dvalue);
retm_if(ad == NULL, "Input parameter is NULL");
if (strlen(config_item->provider_id.c_str()) == strlen(ACCESSIBILITY_UNIVERSAL_SWITCH_ACCESSORIES_SWITCH_PROVIDER)
- && !strncmp(config_item->provider_id.c_str(), ACCESSIBILITY_UNIVERSAL_SWITCH_ACCESSORIES_SWITCH_PROVIDER, strlen(ACCESSIBILITY_UNIVERSAL_SWITCH_ACCESSORIES_SWITCH_PROVIDER)) != 0) {
+ && !strncmp(config_item->provider_id.c_str(), ACCESSIBILITY_UNIVERSAL_SWITCH_ACCESSORIES_SWITCH_PROVIDER, strlen(ACCESSIBILITY_UNIVERSAL_SWITCH_ACCESSORIES_SWITCH_PROVIDER)) != 0) {
ad->config_item_to_update.activity_type = config_item->activity_type;
ad->config_item_to_update.switch_id = config_item->switch_id;
ad->us_configuration.switch_updated_cb = cb;
}
-void UpdateSwitchPage::onActionUpdate(SettingAccessibility *ad, const std::string& action, void *user_data)
+void UpdateSwitchPage::onActionUpdate(SettingAccessibility *ad, const std::string &action, void *user_data)
{
if (ad->us_configuration.switch_updated_cb) {
- auto config_item = static_cast<UniversalSwitchConfigurationItem*>(user_data);
+ auto config_item = static_cast<UniversalSwitchConfigurationItem *>(user_data);
ad->us_configuration.switch_updated_cb(ad, config_item->switch_id, action, config_item->user_name);
}
}
static void attachActionCallback(SettingAccessibility *ad, UniversalSwitchUpdateCb cb);
private:
- static void onActionUpdate(SettingAccessibility *ad, const std::string& action, void *user_data);
+ static void onActionUpdate(SettingAccessibility *ad, const std::string &action, void *user_data);
};
#endif
static int setting_accessibility_main_cleanup(void *cb);
setting_view setting_view_accessibility_main = {
- .create = setting_accessibility_main_create,
- .destroy = setting_accessibility_main_destroy,
- .update = setting_accessibility_main_update,
- .cleanup = setting_accessibility_main_cleanup, };
+ .create = setting_accessibility_main_create,
+ .destroy = setting_accessibility_main_destroy,
+ .update = setting_accessibility_main_update,
+ .cleanup = setting_accessibility_main_cleanup,
+};
static void setting_accessibility_screen_reader_key_change_vconf_cb(
- keynode_t *key, void *user_data)
+ keynode_t *key, void *user_data)
{
- auto screen_reader_item = static_cast<GenGroupItemData*>(user_data);
+ auto screen_reader_item = static_cast<GenGroupItemData *>(user_data);
screen_reader_item->sub_desc = vconf_keynode_get_bool(key) ? _("IDS_ST_BODY_ON") : _("IDS_ST_BODY_OFF");
elm_genlist_item_update(screen_reader_item->item);
static Eina_Bool _cancel_cb(void *data, Elm_Object_Item *it)
{
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
retv_if(!ad, EINA_FALSE);
vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS,
- setting_accessibility_screen_reader_key_change_vconf_cb);
+ setting_accessibility_screen_reader_key_change_vconf_cb);
ui_app_exit();
return EINA_TRUE;
}
static void setting_accessibility_vision_screen_reader_mouse_up_Gendial_list_cb(
- void *data, Evas_Object *obj, void *event_info)
+ void *data, Evas_Object *obj, void *event_info)
{
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_genlist_item_selected_set(item, EINA_FALSE);
ad->screenReaderPage_ = std::make_unique<ScreenReaderPage>(ad);
{
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_genlist_item_selected_set(item, EINA_FALSE);
ad->universalSwitchPage_ = std::make_unique<UniversalSwitchPage>(ad);
{
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
elm_genlist_item_selected_set(item, EINA_FALSE);
ad->accessibilityLauncherPage_ = std::make_unique<AccessibilityLauncherPage>(ad);
/* error check */
retv_if(data == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
- auto ad = static_cast<SettingAccessibility*>(data);
+ auto ad = static_cast<SettingAccessibility *>(data);
Evas_Object *scroller = ad->md.getGenlist();
createGendialTitleItem(scroller, &(itc_group_item), "IDS_ST_HEADER_VISION");
SETTING_TRACE_ERROR("Could not get value for key: %s", VCONFKEY_SETAPPL_ACCESSIBILITY_TTS);
ad->screen_reader_item = createGendialGroupItem(
- scroller, &itc_2text,
- setting_accessibility_vision_screen_reader_mouse_up_Gendial_list_cb,
- ad, SwallowType::INVALID, 1,
- "IDS_ST_MBODY_SCREEN_READER_HTTS",
- screen_reader ? "IDS_ST_BODY_ON" : "IDS_ST_BODY_OFF",
- NULL);
+ scroller, &itc_2text,
+ setting_accessibility_vision_screen_reader_mouse_up_Gendial_list_cb,
+ ad, SwallowType::INVALID, 1,
+ "IDS_ST_MBODY_SCREEN_READER_HTTS",
+ screen_reader ? "IDS_ST_BODY_ON" : "IDS_ST_BODY_OFF",
+ NULL);
if (ad->screen_reader_item) {
ad->screen_reader_item->userdata = ad;
__BACK_POINTER_SET(ad->screen_reader_item);
}
ad->universal_switch_item = createGendialGroupItem(
- scroller, &ad->itc_multiline_sub,
- setting_accessibility_universal_switch_mouse_up_Gendial_list_cb,
- ad, SwallowType::INVALID, 1,
- "IDS_ACCS_UNIVERSAL_SWITCH",
- "IDS_ACCS_UNIVERSAL_SWITCH_HINT",
- NULL);
+ scroller, &ad->itc_multiline_sub,
+ setting_accessibility_universal_switch_mouse_up_Gendial_list_cb,
+ ad, SwallowType::INVALID, 1,
+ "IDS_ACCS_UNIVERSAL_SWITCH",
+ "IDS_ACCS_UNIVERSAL_SWITCH_HINT",
+ NULL);
if (ad->universal_switch_item) {
ad->universal_switch_item->userdata = ad;
__BACK_POINTER_SET(ad->universal_switch_item);
}
GenGroupItemData *item = createGendialGroupItem(
- scroller, &ad->itc_multiline_sub,
- setting_accessibility_accessibility_launcher_mouse_up_Gendial_list_cb,
- ad, SwallowType::INVALID, 1,
- "IDS_ACCS_ACCESSIBILITY_LAUNCHER",
- "IDS_ACCS_ACCESSIBILITY_LAUNCHER_HINT",
- NULL);
+ scroller, &ad->itc_multiline_sub,
+ setting_accessibility_accessibility_launcher_mouse_up_Gendial_list_cb,
+ ad, SwallowType::INVALID, 1,
+ "IDS_ACCS_ACCESSIBILITY_LAUNCHER",
+ "IDS_ACCS_ACCESSIBILITY_LAUNCHER_HINT",
+ NULL);
if (item) {
item->userdata = ad;
__BACK_POINTER_SET(item);
}
int vconf_ret = vconf_notify_key_changed(
- VCONFKEY_SETAPPL_ACCESSIBILITY_TTS,
- setting_accessibility_screen_reader_key_change_vconf_cb,
- ad->screen_reader_item);
+ VCONFKEY_SETAPPL_ACCESSIBILITY_TTS,
+ setting_accessibility_screen_reader_key_change_vconf_cb,
+ ad->screen_reader_item);
if (vconf_ret != 0) {
SETTING_TRACE("FAIL: vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS)");
return SETTING_RETURN_FAIL;
static int setting_accessibility_main_create(void *cb)
{
- auto ad = static_cast<SettingAccessibility*>(cb);
+ auto ad = static_cast<SettingAccessibility *>(cb);
retv_if(ad == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
ad->md.initView(_("IDS_ST_BODY_ACCESSIBILITY"));
eldbus_shutdown();
}
-static void __eldbus_getInfoArray(std::vector<UniversalSwitchInfoType*>& infoTypes, Eldbus_Message *reply)
+static void __eldbus_getInfoArray(std::vector<UniversalSwitchInfoType *> &infoTypes, Eldbus_Message *reply)
{
Eldbus_Message_Iter *array;
Eldbus_Message_Iter *struct_sss;
}
}
-static std::vector<UniversalSwitchInfoType*> __eldbus_getAllSwitchesByProviderId(UniversalSwitchEldbus *eldbus, const char * provider_id)
+static std::vector<UniversalSwitchInfoType *> __eldbus_getAllSwitchesByProviderId(UniversalSwitchEldbus *eldbus, const char *provider_id)
{
Eldbus_Message *req = NULL;
Eldbus_Message *reply = NULL;
iter = eldbus_message_iter_get(req);
eldbus_message_iter_arguments_append(iter, "s", provider_id);
- std::vector<UniversalSwitchInfoType*> switches;
+ std::vector<UniversalSwitchInfoType *> switches;
reply = eldbus_proxy_send_and_block(eldbus->proxy, req, ELDBUS_TIMEOUT);
if (!reply || eldbus_message_error_get(reply, &errname, &errmsg))
SETTING_TRACE_ERROR("Unable to call method " IFACE ".getAllSwitchesByProviderId: %s %s", errname, errmsg);
return switches;
}
-static std::vector<UniversalSwitchSwitchProvider*> __eldbus_getAllSwitchProviders(UniversalSwitchEldbus *eldbus)
+static std::vector<UniversalSwitchSwitchProvider *> __eldbus_getAllSwitchProviders(UniversalSwitchEldbus *eldbus)
{
Eldbus_Message *req = NULL;
Eldbus_Message *reply = NULL;
return {};
}
- std::vector<UniversalSwitchSwitchProvider*> switch_providers;
+ std::vector<UniversalSwitchSwitchProvider *> switch_providers;
reply = eldbus_proxy_send_and_block(eldbus->proxy, req, ELDBUS_TIMEOUT);
if (!reply || eldbus_message_error_get(reply, &errname, &errmsg)) {
SETTING_TRACE_ERROR("Unable to call method " IFACE ".getAllSwitchProviders: %s %s", errname, errmsg);
} else {
- std::vector<UniversalSwitchInfoType*> switch_providers_info;
+ std::vector<UniversalSwitchInfoType *> switch_providers_info;
if (true) {
__eldbus_getInfoArray(switch_providers_info, reply);
}
-static std::vector<UniversalSwitchInfoType*> __eldbus_getBindableActivityTypes(UniversalSwitchEldbus *eldbus)
+static std::vector<UniversalSwitchInfoType *> __eldbus_getBindableActivityTypes(UniversalSwitchEldbus *eldbus)
{
Eldbus_Message *req = NULL;
Eldbus_Message *reply = NULL;
return {};
}
- std::vector<UniversalSwitchInfoType*> activity_types;
+ std::vector<UniversalSwitchInfoType *> activity_types;
reply = eldbus_proxy_send_and_block(eldbus->proxy, req, ELDBUS_TIMEOUT);
if (!reply || eldbus_message_error_get(reply, &errname, &errmsg)) {
SETTING_TRACE_ERROR("Unable to call method " IFACE ".getBindableActivityTypes: %s %s", errname, errmsg);
return activity_types;
}
-static void __eldbus_getAllSwitchConfigurationItemsArray(std::vector<UniversalSwitchConfigurationItem*>& infoTypes, Eldbus_Message *reply)
+static void __eldbus_getAllSwitchConfigurationItemsArray(std::vector<UniversalSwitchConfigurationItem *> &infoTypes, Eldbus_Message *reply)
{
Eldbus_Message_Iter *array;
}
-static std::vector<UniversalSwitchConfigurationItem*> __eldbus_getAllSwitchConfigurationItems(UniversalSwitchEldbus *eldbus)
+static std::vector<UniversalSwitchConfigurationItem *> __eldbus_getAllSwitchConfigurationItems(UniversalSwitchEldbus *eldbus)
{
Eldbus_Message *req = NULL;
Eldbus_Message *reply = NULL;
return {};
}
- std::vector<UniversalSwitchConfigurationItem*> configurationItems;
+ std::vector<UniversalSwitchConfigurationItem *> configurationItems;
reply = eldbus_proxy_send_and_block(eldbus->proxy, req, ELDBUS_TIMEOUT);
if (!reply || eldbus_message_error_get(reply, &errname, &errmsg)) {
SETTING_TRACE_ERROR("Unable to call method " IFACE ".getAllSwitchConfigurationItems: %s %s", errname, errmsg);
delete info;
}
-static void __relese_info_type_array(std::vector<UniversalSwitchInfoType*>& infoArray)
+static void __relese_info_type_array(std::vector<UniversalSwitchInfoType *> &infoArray)
{
for (auto &it : infoArray)
delete it;
if (!new_id || strlen(new_id) == 0)
return;
- auto config = static_cast<UniversalSwitchDbusConfig*>(data);
+ auto config = static_cast<UniversalSwitchDbusConfig *>(data);
UniversalSwitchEldbus *eldbus = &config->eldbus;
if (!eldbus->dobj && !(eldbus->dobj = eldbus_object_get(eldbus->conn, BUS, PATH))) {
__eldbus_shutdown(config);
}
-std::string setting_accessibility_universal_switch_dbus_config_get_activity_name(UniversalSwitchDbusConfig *config, const std::string& activity_id)
+std::string setting_accessibility_universal_switch_dbus_config_get_activity_name(UniversalSwitchDbusConfig *config, const std::string &activity_id)
{
for (auto &it : config->activity_types)
if (it->id == activity_id)
return {};
}
-std::vector<UniversalSwitchInfoType*> setting_accessibility_universal_switch_dbus_config_get_switches(UniversalSwitchDbusConfig *config, const char * provider_id)
+std::vector<UniversalSwitchInfoType *> setting_accessibility_universal_switch_dbus_config_get_switches(UniversalSwitchDbusConfig *config, const char *provider_id)
{
for (auto &it : config->switch_providers)
if (strcmp(it->info->id.c_str(), provider_id) == 0)
static void __eldbus_on_capture_switch(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED)
{
- auto eldbus = static_cast<UniversalSwitchEldbus*>(data);
+ auto eldbus = static_cast<UniversalSwitchEldbus *>(data);
const char *errname, *errmsg;
const char *switch_id = NULL;
void setting_accessibility_universal_switch_dbus_config_captureSwitch(UniversalSwitchDbusConfig *config, const char *provider_id, double timeout, capture_switch_cb callback, void *calback_data)
{
- UniversalSwitchEldbus * eldbus = &config->eldbus;
+ UniversalSwitchEldbus *eldbus = &config->eldbus;
SETTING_TRACE_DEBUG("DBus call captureSwitch for %s", provider_id);
eldbus->capture_switch_request = eldbus_proxy_call(eldbus->proxy, "captureSwitch", __eldbus_on_capture_switch, eldbus, timeout, "s", provider_id);
if (eldbus->capture_switch_request) {
void setting_accessibility_universal_switch_dbus_config_cancelCaptureSwitch(UniversalSwitchDbusConfig *config)
{
- UniversalSwitchEldbus * eldbus = &config->eldbus;
+ UniversalSwitchEldbus *eldbus = &config->eldbus;
SETTING_TRACE_DEBUG("Running " IFACE ".cancelCaptureSwitch");
eldbus_proxy_call(config->eldbus.proxy, "cancelCaptureSwitch", NULL, NULL, ELDBUS_TIMEOUT, "");
struct UniversalSwitchSwitchProvider {
UniversalSwitchInfoType *info;
- std::vector<UniversalSwitchInfoType*> switches;
+ std::vector<UniversalSwitchInfoType *> switches;
};
struct UniversalSwitchDbusConfig {
UniversalSwitchEldbus eldbus;
- std::vector<UniversalSwitchInfoType*> activity_types;
- std::vector<UniversalSwitchConfigurationItem*> configuration_items;
- std::vector<UniversalSwitchSwitchProvider*> switch_providers;
+ std::vector<UniversalSwitchInfoType *> activity_types;
+ std::vector<UniversalSwitchConfigurationItem *> configuration_items;
+ std::vector<UniversalSwitchSwitchProvider *> switch_providers;
};
Eina_Bool setting_accessibility_universal_switch_dbus_config_init(UniversalSwitchDbusConfig *config, init_done_cb callback, void *callback_data);
int setting_accessibility_universal_switch_dbus_config_get_switch_count(UniversalSwitchDbusConfig *config);
-std::string setting_accessibility_universal_switch_dbus_config_get_activity_name(UniversalSwitchDbusConfig *config, const std::string& activity_id);
-std::vector<UniversalSwitchInfoType*> setting_accessibility_universal_switch_dbus_config_get_switches(UniversalSwitchDbusConfig *config, const char * provider_id);
+std::string setting_accessibility_universal_switch_dbus_config_get_activity_name(UniversalSwitchDbusConfig *config, const std::string &activity_id);
+std::vector<UniversalSwitchInfoType *> setting_accessibility_universal_switch_dbus_config_get_switches(UniversalSwitchDbusConfig *config, const char *provider_id);
void setting_accessibility_universal_switch_dbus_config_shutdown(UniversalSwitchDbusConfig *config);
void setting_accessibility_universal_switch_dbus_config_addSwitchConfigurationItem(UniversalSwitchDbusConfig *config, const char *switch_id, const char *user_name, const char *activity_type);
void setting_accessibility_universal_switch_dbus_config_updateSwitchConfigurationItem(UniversalSwitchDbusConfig *config, const char *switch_id, const char *user_name, const char *activity_type);
static const char *get_tts_error(int r)
{
switch (r) {
- case TTS_ERROR_NONE: {
- return "no error";
- }
- case TTS_ERROR_INVALID_PARAMETER: {
- return "inv param";
- }
- case TTS_ERROR_OUT_OF_MEMORY: {
- return "out of memory";
- }
- case TTS_ERROR_OPERATION_FAILED: {
- return "oper failed";
- }
- case TTS_ERROR_INVALID_STATE: {
- return "inv state";
- }
- default: {
- return "uknown error";
- }
+ case TTS_ERROR_NONE: {
+ return "no error";
+ }
+ case TTS_ERROR_INVALID_PARAMETER: {
+ return "inv param";
+ }
+ case TTS_ERROR_OUT_OF_MEMORY: {
+ return "out of memory";
+ }
+ case TTS_ERROR_OPERATION_FAILED: {
+ return "oper failed";
+ }
+ case TTS_ERROR_INVALID_STATE: {
+ return "inv state";
+ }
+ default: {
+ return "uknown error";
+ }
}
}
void
-state_changed_cb(tts_h tts, tts_state_e previous, tts_state_e current, void* user_data)
+state_changed_cb(tts_h tts, tts_state_e previous, tts_state_e current, void *user_data)
{
SETTING_TRACE_DEBUG(" previous = %d current = %d", previous, current);
}
static char *_universal_switch_gendial_new_text_get(void *data, Evas_Object *obj, const char *part)
{
- auto item_data = static_cast<GenGroupItemData*>(data);
+ auto item_data = static_cast<GenGroupItemData *>(data);
if (!safeStrCmp(item_data->itc.c_str(), "multiline")) {
if (!safeStrCmp(part, "elm.text")) {
if (!item_data->keyStr.empty()) {
{
setting_retvm_if((NULL == priv), NULL, "NULL == priv");
- auto ad = static_cast<SettingAccessibility*>(priv);
+ auto ad = static_cast<SettingAccessibility *>(priv);
ad->launched_by_app_control = false;
ad->universal_switch_main_item = NULL;
ad->universal_switch_settings_item = NULL;
/* register view node table */
setting_view_node_table_intialize();
setting_view_node_table_register(&setting_view_accessibility_main,
- NULL);
+ NULL);
setting_view_node_set_cur_view(&setting_view_accessibility_main);
static void on_app_terminate(void *priv)
{
- auto ad = static_cast<SettingAccessibility*>(priv);
+ auto ad = static_cast<SettingAccessibility *>(priv);
destroy_tts_handle(ad);
setting_view_destroy(&setting_view_accessibility_main, ad);
static void on_app_control(app_control_h service, void *priv)
{
- auto ad = static_cast<SettingAccessibility*>(priv);
+ auto ad = static_cast<SettingAccessibility *>(priv);
retm_if(!ad, "Data parameter is NULL");
char *value = NULL;
if (!app_control_get_extra_data(service, "SHOW_US_SETTINGS", &value) && value != NULL && !strcmp(value, "1")) {
SettingAccessibility app_data;
ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY],
- APP_EVENT_LOW_MEMORY, NULL, NULL);
+ APP_EVENT_LOW_MEMORY, NULL, NULL);
ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY],
- APP_EVENT_LOW_BATTERY, NULL, NULL);
+ APP_EVENT_LOW_BATTERY, NULL, NULL);
ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED],
- APP_EVENT_LANGUAGE_CHANGED, _lang_changed, NULL);
+ APP_EVENT_LANGUAGE_CHANGED, _lang_changed, NULL);
ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED],
- APP_EVENT_REGION_FORMAT_CHANGED, NULL, NULL);
+ APP_EVENT_REGION_FORMAT_CHANGED, NULL, NULL);
ui_app_add_event_handler(
- &handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED],
- APP_EVENT_DEVICE_ORIENTATION_CHANGED, NULL, NULL);
+ &handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED],
+ APP_EVENT_DEVICE_ORIENTATION_CHANGED, NULL, NULL);
return ui_app_main(argc, argv, &ops, &app_data);
}
#define ACCESSIBILITY_UNIVERSAL_SWITCH_PLUS_ICON SETTING_ICON_PATH "/plus.png"
-enum class ManageMenuOption : int
-{
+enum class ManageMenuOption : int {
GESTURES,
ACTIONS,
SETTINGS,
#define DEFINE_ITC1(style, name) \
const Elm_Genlist_Item_Class name = { \
- .version = 0, \
- .refcount = 0, \
- .delete_me = EINA_FALSE, \
- .homogeneous = EINA_FALSE, \
- .item_style = style, \
- .decorate_item_style = NULL, \
- .decorate_all_item_style = NULL, \
- .func = {gendialNewTextGetCb, _gl_Gendial_content_get, NULL, _gl_Gendial_del, NULL, NULL} \
- };
+ .version = 0, \
+ .refcount = 0, \
+ .delete_me = EINA_FALSE, \
+ .homogeneous = EINA_FALSE, \
+ .item_style = style, \
+ .decorate_item_style = NULL, \
+ .decorate_all_item_style = NULL, \
+ .func = {gendialNewTextGetCb, _gl_Gendial_content_get, NULL, _gl_Gendial_del, NULL, NULL} \
+ };
DEFINE_ITC1(SETTING_GENLIST_ICON_1LINE_STYLE, itc_1text);
DEFINE_ITC1(SETTING_GENLIST_ICON_1LINE_STYLE, itc_1text_1icon);
static void __radio_changed(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
- auto list_item = static_cast<GenGroupItemData*>(data);
+ auto list_item = static_cast<GenGroupItemData *>(data);
list_item->chk_status = elm_radio_value_get(obj); /* for update */
}
static void __chk_changed(void *data, Evas_Object *obj, void *event_info)
{
retm_if(data == NULL, "Data parameter is NULL");
- auto list_item = static_cast<GenGroupItemData*>(data);
+ auto list_item = static_cast<GenGroupItemData *>(data);
list_item->chk_status = elm_check_state_get(obj); /* for update */
}
static char *gendialNewTextGetCb(void *data, Evas_Object *obj, const char *part)
{
- GenGroupItemData *item_data = static_cast<GenGroupItemData*>(data);
+ GenGroupItemData *item_data = static_cast<GenGroupItemData *>(data);
std::string ret;
std::string part_str = part ? part : std::string{};
/* "elm.text.sub" */
/*------------------------------------------------------------- */
if (item_data->itc == "multiline" && part_str == "elm.text.multiline") {
- ret = item_data->keyStr.str();
+ ret = item_data->keyStr.str();
} else {
if (part_str == "elm.text" || part_str == "elm.text.main" || part_str == "elm.text.main.left"
- || part_str == "elm.text.main.left.top" || part_str == "elm.text.multiline") {
+ || part_str == "elm.text.main.left.top" || part_str == "elm.text.multiline") {
ret = item_data->keyStr.str();
} else if (part_str == "elm.text.sub" || part_str == "elm.text.2" || part_str == "elm.text.sub.left.bottom") {
ret = item_data->sub_desc.str();
}
static Evas_Object *__add_check(GenGroupItemData *item_data,
- Evas_Object *parent)
+ Evas_Object *parent)
{
retv_if(!item_data || !parent, NULL);
evas_object_propagate_events_set(check, 0);
evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND);
if (SwallowType::CHECK == item_data->swallow_type) {
elm_check_state_pointer_set(check,
- (Eina_Bool *)(&(item_data->chk_status)));
+ (Eina_Bool *)(&(item_data->chk_status)));
evas_object_pass_events_set(check, 1);
} else {
evas_object_pass_events_set(check, 1);
if (item_data->chk_change_cb) {
evas_object_smart_callback_add(check, "changed",
- item_data->chk_change_cb, item_data);
+ item_data->chk_change_cb, item_data);
} else {
evas_object_smart_callback_add(check, "changed", __chk_changed,
- item_data);
+ item_data);
}
evas_object_show(check);
}
static Evas_Object *__add_toggle(GenGroupItemData *item_data,
- Evas_Object *parent)
+ Evas_Object *parent)
{
retv_if(!item_data || !parent, NULL);
Evas_Object *check = elm_check_add(parent);
evas_object_propagate_events_set(check, 0);
evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND);
if (SwallowType::CHECK == item_data->swallow_type) {
elm_check_state_pointer_set(check,
- (Eina_Bool *)(&(item_data->chk_status)));
+ (Eina_Bool *)(&(item_data->chk_status)));
evas_object_pass_events_set(check, 1);
} else {
evas_object_pass_events_set(check, 1);
if (item_data->chk_change_cb) {
evas_object_smart_callback_add(check, "changed",
- item_data->chk_change_cb, item_data);
+ item_data->chk_change_cb, item_data);
} else {
evas_object_smart_callback_add(check, "changed", __chk_changed,
- item_data);
+ item_data);
}
evas_object_show(check);
}
static Evas_Object *__add_radio_text(GenGroupItemData *item_data,
- Evas_Object *parent)
+ Evas_Object *parent)
{
retv_if(!item_data || !parent, NULL);
if (!item_data->rgd) { /* exceptional handling */
item_data->eo_check = radio;
if (item_data->chk_change_cb) {
evas_object_smart_callback_add(radio, "changed",
- item_data->chk_change_cb, item_data);
+ item_data->chk_change_cb, item_data);
} else {
evas_object_smart_callback_add(radio, "changed",
- __radio_changed, item_data);
+ __radio_changed, item_data);
}
return radio;
}
static Evas_Object *__add_left_default(GenGroupItemData *item_data,
- Evas_Object *parent)
+ Evas_Object *parent)
{
retv_if(!item_data || !parent, NULL);
setting_decorate_image_RGBA(icon, 15, 41, 73, 255);
elm_image_file_set(icon, item_data->l_swallow_path.c_str(), NULL);
evas_object_size_hint_aspect_set(icon,
- EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
+ EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
return icon;
} else {
- Evas_Object * c = elm_image_add(parent);
+ Evas_Object *c = elm_image_add(parent);
elm_image_file_set(c, item_data->l_swallow_path.c_str(), NULL);
setting_decorate_image_RGBA(c, 14, 41, 73, 255);
evas_object_size_hint_align_set(c, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
+ EVAS_HINT_FILL);
evas_object_size_hint_weight_set(c, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND);
return c;
}
}
static Evas_Object *__add_right_default(GenGroupItemData *item_data,
- Evas_Object *parent)
+ Evas_Object *parent)
{
retv_if(!item_data || !parent, NULL);
elm_image_file_set(icon, item_data->r_swallow_path.c_str(), NULL);
evas_object_size_hint_align_set(icon, 0.0, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
+ EVAS_HINT_EXPAND);
return icon;
}
/* draw handler */
-using drawer_fp = Evas_Object*(*)(GenGroupItemData *item_data, Evas_Object *parent);
+using drawer_fp = Evas_Object * (*)(GenGroupItemData *item_data, Evas_Object *parent);
-struct ContentDrawer
-{
+struct ContentDrawer {
SwallowType type; /* ui type */
drawer_fp draw;
};
static ContentDrawer cd_left[static_cast<int>(SwallowType::MAX)] = {
- /*base objects */
- { SwallowType::CHECK, __add_check },
+ /*base objects */
+ { SwallowType::CHECK, __add_check },
- /*other compelx objects */
- /* setting-network */
- { SwallowType::RADIO_1TEXT, __add_radio_text },
+ /*other compelx objects */
+ /* setting-network */
+ { SwallowType::RADIO_1TEXT, __add_radio_text },
};
static ContentDrawer cd_right[static_cast<int>(SwallowType::MAX)] = {
- /*right part object of the type */
- { SwallowType::ICON_RADIO, __add_toggle },
+ /*right part object of the type */
+ { SwallowType::ICON_RADIO, __add_toggle },
};
/* When X marked button clicked, make string as empty. */
static void __multiline_eraser_clicked(void *data, Evas_Object *obj,
- void *event_info)
+ void *event_info)
{
- auto list_item = static_cast<GenGroupItemData*>(data);
+ auto list_item = static_cast<GenGroupItemData *>(data);
Evas_Object *entry = (Evas_Object *)elm_object_item_part_content_get(list_item->item,
- "elm.icon.entry");
+ "elm.icon.entry");
/* After button is clicked, entry should get focus again. */
elm_object_focus_set(entry, EINA_TRUE);
elm_entry_entry_set(entry, "");
static Evas_Object *_gl_Gendial_content_get(void *data, Evas_Object *obj, const char *part)
{
- auto item_data = static_cast<GenGroupItemData*>(data);
+ auto item_data = static_cast<GenGroupItemData *>(data);
ContentDrawer *cd_list = NULL;
drawer_fp fp = NULL;
retv_if(!item_data, NULL);
static void _gl_Gendial_del(void *data, Evas_Object *obj)
{
- auto item_data = static_cast<GenGroupItemData*>(data);
+ auto item_data = static_cast<GenGroupItemData *>(data);
if (item_data) {
item_data->eo_check = NULL;/*set to NULL at once */
item_data->itc = {};
* @return a pointer to GenGroupItemData
*/
GenGroupItemData *createGendialTitleItem(
- Evas_Object *genlist, const Elm_Genlist_Item_Class *itc,
- const std::string& keyStr)
+ Evas_Object *genlist, const Elm_Genlist_Item_Class *itc,
+ const std::string &keyStr)
{
auto item_data = new GenGroupItemData;
setting_retvm_if(!item_data, NULL, "new failed");
* @return a pointer to GenGroupItemData
*/
GenGroupItemData *createGendialGroupItem(
- Evas_Object *genlist, const Elm_Genlist_Item_Class *itc,
- SettingCallback gl_sel,
- void *sel_data, SwallowType swallow_type, int chk_status, const std::string& keyStr,
- const std::string& sub_desc, SettingCallback chk_change_cb)
+ Evas_Object *genlist, const Elm_Genlist_Item_Class *itc,
+ SettingCallback gl_sel,
+ void *sel_data, SwallowType swallow_type, int chk_status, const std::string &keyStr,
+ const std::string &sub_desc, SettingCallback chk_change_cb)
{
auto item_data = new GenGroupItemData;
setting_retvm_if(!item_data, NULL, "new failed");
void __gl_realized_cb(void *data, Evas_Object *obj, void *event_info)
{
setting_retm_if(event_info == NULL,
- "invalid parameter: event_info is NULL");
+ "invalid parameter: event_info is NULL");
Elm_Object_Item *item = (Elm_Object_Item *)event_info;
elm_object_item_data_get(item);
/*for check,radio,slider etc.. */
void setting_update_gl_item_chk_status(GenGroupItemData *item_data,
- int status)
+ int status)
{
if (item_data && item_data->chk_status != status) {
item_data->chk_status = status;
if (item_data->item) {
elm_genlist_item_fields_update(item_data->item, "*",
- ELM_GENLIST_ITEM_FIELD_CONTENT);
+ ELM_GENLIST_ITEM_FIELD_CONTENT);
}
}
}
#include <app.h>
Evas_Object *setting_create_button(
- Evas_Object *parent,
- const std::string& btn_str,
- const std::string& btn_style,
- Evas_Smart_Cb btn_click_cb,
- void *cb_data)
+ Evas_Object *parent,
+ const std::string &btn_str,
+ const std::string &btn_style,
+ Evas_Smart_Cb btn_click_cb,
+ void *cb_data)
{
retv_if(!parent, NULL);
/* not '<-' button */
if (btn_style != NAVI_BACK_ARROW_BUTTON_STYLE) {
- elm_object_text_set(button, TranslatedString{btn_str}.c_str());
+ elm_object_text_set(button, TranslatedString{btn_str} .c_str());
evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(button, EVAS_HINT_FILL, 0.5);
}
} setting_gif_data;
void setting_conformant_keypad_state(
- Evas_Object *window, bool enable)
+ Evas_Object *window, bool enable)
{
Evas_Object *conform = (Evas_Object *)evas_object_data_get(window, "conformant");
if (conform) {
SETTING_TRACE("conformant keypad %d", enable);
if (enable) {
elm_object_signal_emit(conform,
- "elm,state,virtualkeypad,enable", "");
+ "elm,state,virtualkeypad,enable", "");
elm_object_signal_emit(conform,
- "elm,state,clipboard,enable", "");
+ "elm,state,clipboard,enable", "");
} else {
elm_object_signal_emit(conform,
- "elm,state,virtualkeypad,disable", "");
+ "elm,state,virtualkeypad,disable", "");
elm_object_signal_emit(conform,
- "elm,state,clipboard,disable", "");
+ "elm,state,clipboard,disable", "");
}
}
}
* @return a pointer to GenGroupItemData
*/
extern GenGroupItemData *createGendialTitleItem(
- Evas_Object *genlist, const Elm_Genlist_Item_Class *itc,
- const std::string& keyStr);
+ Evas_Object *genlist, const Elm_Genlist_Item_Class *itc,
+ const std::string &keyStr);
/**
* Common function to create a genlist item
* @return a pointer to GenGroupItemData
*/
GenGroupItemData *createGendialGroupItem(
- Evas_Object *genlist, const Elm_Genlist_Item_Class *itc,
- SettingCallback gl_sel,
- void *sel_data, SwallowType swallow_type, int chk_status, const std::string& keyStr,
- const std::string& sub_desc, SettingCallback chk_change_cb);
+ Evas_Object *genlist, const Elm_Genlist_Item_Class *itc,
+ SettingCallback gl_sel,
+ void *sel_data, SwallowType swallow_type, int chk_status, const std::string &keyStr,
+ const std::string &sub_desc, SettingCallback chk_change_cb);
/**
* The API to Create a button
* @return a button
*/
Evas_Object *setting_create_button(Evas_Object *parent,
- const std::string& btn_str, const std::string& btn_style,
- Evas_Smart_Cb btn_click_cb, void *cb_data);
+ const std::string &btn_str, const std::string &btn_style,
+ Evas_Smart_Cb btn_click_cb, void *cb_data);
extern void __gl_realized_cb(void *data, Evas_Object *obj, void *event_info);
extern void setting_update_gl_item_chk_status(
- GenGroupItemData *item_data, int status);
+ GenGroupItemData *item_data, int status);
extern void setting_conformant_keypad_state(Evas_Object *conform, bool enable);
extern void setting_decorate_image_RGBA(Evas_Object *obj, int r, int g, int b,
- int a);
+ int a);
#endif /* __SETTING_COMMON_DRAW_WIDGET_H__ */
char *btn_str = elm_entry_markup_to_utf8(elm_object_text_get(obj));
if (btn_str) {
if (0 == safeStrCmp(btn_str, _("IDS_CST_BUTTON_CLOSE"))
- /*KeyStr_Try */
- || 0 == safeStrCmp(btn_str, _("IDS_SAPPS_SK_TRY_ABB"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BUTTON_OK"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_SK_YES"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BUTTON_STOP"))
- || 0 == safeStrCmp(btn_str,
- _("IDS_ST_BUTTON_DISCONNECT"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BODY_USE_MOTION"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_TPOP_TRY_AGAIN"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BODY_DELETE"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_HEADER_RESET"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_SK_FORMAT_ABB"))
- || 0 == safeStrCmp(btn_str,
- _("IDS_ST_HEADER_FORMAT_MVERB_ABB"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BUTTON_CONTINUE"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BODY_SAVE"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BUTTON_ENABLE"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BUTTON_DISABLE"))
- || 0 == safeStrCmp(btn_str, _("IDS_SA_BUTTON_DONE_ABB"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BODY_TURN_OFF"))
- || 0 == safeStrCmp(btn_str, _("IDS_CLD_BUTTON_EXPORT"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_BUTTON_UNINSTALL"))
- || 0 == safeStrCmp(btn_str, _("IDS_SMEMO_BUTTON_IMPORT"))
- || 0 == safeStrCmp(btn_str, _("IDS_ST_HEADER_CLEAR_CACHE_ABB"))
- || 0 == safeStrCmp(btn_str, _("IDS_MTTRL_BUTTON_ENABLE_MOTION"))
- /* The below 'Add switch' label must be substituted with valid localization tag
- * once it is defined */
- || 0 == safeStrCmp(btn_str, _("Add switch"))) {
+ /*KeyStr_Try */
+ || 0 == safeStrCmp(btn_str, _("IDS_SAPPS_SK_TRY_ABB"))
+ || 0 == safeStrCmp(btn_str, _("IDS_ST_BUTTON_OK"))
+ || 0 == safeStrCmp(btn_str, _("IDS_ST_SK_YES"))
+ || 0 == safeStrCmp(btn_str, _("IDS_ST_BUTTON_STOP"))
+ || 0 == safeStrCmp(btn_str,
+ _("IDS_ST_BUTTON_DISCONNECT"))
+ || 0 == safeStrCmp(btn_str, _("IDS_ST_BODY_USE_MOTION"))
+ || 0 == safeStrCmp(btn_str, _("IDS_ST_TPOP_TRY_AGAIN"))
+ || 0 == safeStrCmp(btn_str, _("IDS_ST_BODY_DELETE"))
+ || 0 == safeStrCmp(btn_str, _("IDS_ST_HEADER_RESET"))
+ || 0 == safeStrCmp(btn_str, _("IDS_ST_SK_FORMAT_ABB"))
+ || 0 == safeStrCmp(btn_str,
+ _("IDS_ST_HEADER_FORMAT_MVERB_ABB"))
+ || 0 == safeStrCmp(btn_str, _("IDS_ST_BUTTON_CONTINUE"))
+ || 0 == safeStrCmp(btn_str, _("IDS_ST_BODY_SAVE"))
+ || 0 == safeStrCmp(btn_str, _("IDS_ST_BUTTON_ENABLE"))
+ || 0 == safeStrCmp(btn_str, _("IDS_ST_BUTTON_DISABLE"))
+ || 0 == safeStrCmp(btn_str, _("IDS_SA_BUTTON_DONE_ABB"))
+ || 0 == safeStrCmp(btn_str, _("IDS_ST_BODY_TURN_OFF"))
+ || 0 == safeStrCmp(btn_str, _("IDS_CLD_BUTTON_EXPORT"))
+ || 0 == safeStrCmp(btn_str, _("IDS_ST_BUTTON_UNINSTALL"))
+ || 0 == safeStrCmp(btn_str, _("IDS_SMEMO_BUTTON_IMPORT"))
+ || 0 == safeStrCmp(btn_str, _("IDS_ST_HEADER_CLEAR_CACHE_ABB"))
+ || 0 == safeStrCmp(btn_str, _("IDS_MTTRL_BUTTON_ENABLE_MOTION"))
+ /* The below 'Add switch' label must be substituted with valid localization tag
+ * once it is defined */
+ || 0 == safeStrCmp(btn_str, _("Add switch"))) {
rsp_type = PopupBtnResponse::OK;
} else { /*for others, */
rsp_type = PopupBtnResponse::CANCEL;
* @return #0 on success, else on failed
*/
int setting_view_node_table_register(setting_view *view,
- setting_view *topview)
+ setting_view *topview)
{
/*SETTING_TRACE_BEGIN; */
if (g_view_node_table_cur_size >= MAX_VIEWNODE_NUM)
{
/* error check */
setting_retvm_if(!view || !cb, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER,
- "Invalid arguement");
+ "Invalid arguement");
int ret = SETTING_RETURN_FAIL;
* @return #0 on success, else on failed
*/
int setting_view_node_table_register(setting_view *view,
- setting_view *topview);
+ setting_view *topview);
/**
* @brief Callback of view creating
#ifdef SETTING_USING_PLATFORM_DBG
#define SETTING_TRACE_SECURE_DEBUG(fmt, arg...) do {\
SECURE_LOGD("\033[0;32mDEBUG: " fmt "\033[0m\n", ##arg);\
-} while (0)
+ } while (0)
#define SETTING_TRACE_DEBUG(fmt, arg...) do {\
SECURE_LOGD("\033[0;32mDEBUG: " fmt "\033[0m\n", ##arg);\
-} while (0)
+ } while (0)
#define SETTING_TRACE(fmt, arg...) do {\
SECURE_LOGI("\033[0;36m" fmt "\033[0m\n", ##arg);\
-} while (0)
+ } while (0)
#define SETTING_TRACE_WARNING(fmt, arg...) do {\
SECURE_LOGI("\033[0;33mWARRING: " fmt "\033[0m\n", ##arg);\
-} while (0)
+ } while (0)
#define SETTING_TRACE_ERROR(fmt, arg...) do {\
SECURE_LOGE("\033[0;31mERROR: " fmt "\033[0m\n", ##arg);\
-} while (0)
+ } while (0)
#define SETTING_TRACE_BEGIN do {\
- SECURE_LOGD("\033[0;35mENTER FUNCTION: %s. \033[0m\n", \
- __FUNCTION__);\
-} while (0)
+ SECURE_LOGD("\033[0;35mENTER FUNCTION: %s. \033[0m\n", \
+ __FUNCTION__);\
+ } while (0)
#define SETTING_TRACE_END do {\
SECURE_LOGD("\033[0;35mEXIT FUNCTION: %s. \033[0m\n", \
- __FUNCTION__);\
-} while (0)
+ __FUNCTION__);\
+ } while (0)
#else
#define SETTING_TRACE(fmt, arg...) do {\
- printf("\n[SETTING]\033[0;36m" fmt "\033[0m\t%s:%d\n", \
- ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
-} while (0)
+ printf("\n[SETTING]\033[0;36m" fmt "\033[0m\t%s:%d\n", \
+ ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
+ } while (0)
#define SETTING_TRACE_SECURE_DEBUG(fmt, arg...) do {\
- printf("\n[SETTING]\033[0;32mDEBUG: " fmt "\033[0m\t%s:%d\n", \
- ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
-} while (0)
+ printf("\n[SETTING]\033[0;32mDEBUG: " fmt "\033[0m\t%s:%d\n", \
+ ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
+ } while (0)
#define SETTING_TRACE_DEBUG(fmt, arg...) do {\
- printf("\n[SETTING]\033[0;32mDEBUG: " fmt "\033[0m\t%s:%d\n", \
- ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
-} while (0)
+ printf("\n[SETTING]\033[0;32mDEBUG: " fmt "\033[0m\t%s:%d\n", \
+ ##arg, (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
+ } while (0)
#define SETTING_TRACE_WARNING(fmt, arg...) do {\
- printf("[SETTING]\033[0;33mWARRING: " fmt \
- "\033[0m\t%s:%d\n", ##arg, \
- (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
-} while (0)
+ printf("[SETTING]\033[0;33mWARRING: " fmt \
+ "\033[0m\t%s:%d\n", ##arg, \
+ (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
+ } while (0)
#define SETTING_TRACE_ERROR(fmt, arg...) do {\
- fprintf(stderr, "[SETTING]\033[0;31mERROR: " fmt \
- "\033[0m\t%s:%d\n", ##arg, \
- (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
-} while (0)
+ fprintf(stderr, "[SETTING]\033[0;31mERROR: " fmt \
+ "\033[0m\t%s:%d\n", ##arg, \
+ (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
+ } while (0)
#define SETTING_TRACE_BEGIN do {\
- printf("\n[SETTING]\033[0;35mENTER FUNCTION: %s. \033[0m\t%s:%d\n", \
- __FUNCTION__, \
- (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
-} while (0)
+ printf("\n[SETTING]\033[0;35mENTER FUNCTION: %s. \033[0m\t%s:%d\n", \
+ __FUNCTION__, \
+ (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
+ } while (0)
#define SETTING_TRACE_END do {\
- printf("\n[SETTING]\033[0;35mEXIT FUNCTION: %s. \033[0m\t%s:%d\n", \
- __FUNCTION__, \
- (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
-} while (0)
+ printf("\n[SETTING]\033[0;35mEXIT FUNCTION: %s. \033[0m\t%s:%d\n", \
+ __FUNCTION__, \
+ (char*)(strrchr(__FILE__, '/')+1), __LINE__);\
+ } while (0)
#endif
#endif
#define setting_retvm_if(expr, val, fmt, arg...) do { \
- if (expr) { \
- SETTING_TRACE_ERROR(fmt, ##arg); \
- return (val); \
- } \
-} while (0)
+ if (expr) { \
+ SETTING_TRACE_ERROR(fmt, ##arg); \
+ return (val); \
+ } \
+ } while (0)
#define setting_retm_if(expr, fmt, arg...) do { \
- if (expr) { \
- SETTING_TRACE_ERROR(fmt, ##arg); \
- return; \
- } \
-} while (0)
+ if (expr) { \
+ SETTING_TRACE_ERROR(fmt, ##arg); \
+ return; \
+ } \
+ } while (0)
#ifndef retm_if
#define retm_if setting_retm_if
#ifndef retv_if
#define retv_if(expr, val) do { \
- if (expr) { \
- SETTING_TRACE_ERROR("(%s)", #expr); \
- return (val); \
- } \
-} while (0)
+ if (expr) { \
+ SETTING_TRACE_ERROR("(%s)", #expr); \
+ return (val); \
+ } \
+ } while (0)
#endif
#ifndef ret_if
#define ret_if(expr) do { \
- if (expr) { \
- SETTING_TRACE_ERROR("(%s)", #expr); \
- return ; \
- } \
-} while (0)
+ if (expr) { \
+ SETTING_TRACE_ERROR("(%s)", #expr); \
+ return ; \
+ } \
+ } while (0)
#endif
#ifndef warn_if
#define warn_if(expr, fmt, arg...) do { \
- if (expr) { \
- SETTING_TRACE_ERROR(fmt, ##arg); \
- } \
-} while (0)
+ if (expr) { \
+ SETTING_TRACE_ERROR(fmt, ##arg); \
+ } \
+ } while (0)
#endif
#define __FREE(del, arg) do { \
- if (arg) { \
- /*cast any argument to (void*) to avoid build warring*/\
- del((void *)(arg)); \
- arg = NULL; \
- } \
-} while (0)
+ if (arg) { \
+ /*cast any argument to (void*) to avoid build warring*/\
+ del((void *)(arg)); \
+ arg = NULL; \
+ } \
+ } while (0)
#define FREE(arg) __FREE(free, arg)
#define G_FREE(arg) __FREE(g_free, arg)
* use __BACK_POINTER_SET to bind the Setting side point into the Genlist side
* pointer */
#define __BACK_POINTER_SET(pData) do { \
- if (pData) {\
- pData->pBack = (void **)(&(pData));\
- } \
-} while (0)
+ if (pData) {\
+ pData->pBack = (void **)(&(pData));\
+ } \
+ } while (0)
#define __BACK_POINTER_UNSET(pData) do { \
- /*release Setting side poniter handlers*/\
- if (pData && pData->pBack) {\
- *(pData->pBack) = NULL;\
- } \
-} while (0)
+ /*release Setting side poniter handlers*/\
+ if (pData && pData->pBack) {\
+ *(pData->pBack) = NULL;\
+ } \
+ } while (0)
#endif /* _SETTING_DEBUG_H_ */
#include "Elementary.h"
-using SettingCallback = void (*)(void*, Evas_Object*, void*);
+using SettingCallback = void (*)(void *, Evas_Object *, void *);
namespace utils
{
- template <typename T, size_t len>
- size_t lenOf(const T(&)[len]) { return len; }
+ template <typename T, size_t len>
+ size_t lenOf(const T(&)[len])
+ {
+ return len;
+ }
}