extern void *quickpanel_common_ui_get_buffer_from_image(const char *file_path, size_t *memfile_size, char *ext, int ext_size);
extern char *quickpanel_common_ui_get_pkginfo_icon(const char *pkgid);
extern char *quickpanel_common_ui_get_pkginfo_label(const char *pkgid);
-extern int quickpanel_common_ui_is_package_exist(const char *pkgid);
extern char *quickpanel_common_ui_get_appinfo_icon(const char *pkgid);
extern void quickpanel_common_inform_launch_app_result(const char *pkgname, int retcode);
extern int quickpanel_common_send_message_to_app(const char *app_id, const char *operation, const char *key, const char *value);
#define APP_CONTROL_OPERATION_SECURED_LOCK "http://tizen.org/appcontrol/operation/secured_lock"
#define QP_QUICK_SETTINGS "qp_quick_settings"
+#define QP_QUICK_SETTINGS_EVENT_CLICKED "_clicked"
+#define QP_QUICK_SETTINGS_EVENT_LONGPRESSED "_longpressed"
#endif /* __QUICKPANEL_UI_H__ */
QP_SETTING_ICON_CONTAINER_ALL_LIST,
} qp_setting_icon_container_type;
+typedef enum _qp_setting_icon_event_type {
+ QP_SETTING_ICON_CLICKED,
+ QP_SETTING_ICON_LONGPRESSED,
+} qp_setting_icon_event_type;
+
+
extern Evas_Object *quickpanel_setting_module_icon_create(QP_Module_Setting *module, Evas_Object *parent);
extern void quickpanel_setting_module_icon_add(QP_Module_Setting *module, Evas_Object *icon, qp_setting_icon_container_type container_type);
extern void quickpanel_setting_module_icon_remove(QP_Module_Setting *module, Evas_Object *icon);
extern void quickpanel_setting_module_icon_view_update_text(QP_Module_Setting *module);
extern void quickpanel_setting_module_icon_status_update(QP_Module_Setting *module, int flag_extra_1, int flag_extra_2);
extern int quickpanel_setting_module_is_icon_clickable(QP_Module_Setting *module);
+extern int quickpanel_setting_module_is_immediate_actionable(QP_Module_Setting *module, qp_setting_icon_event_type event_type);
extern void quickpanel_setting_module_icon_timer_add(QP_Module_Setting *module);
extern void quickpanel_setting_module_icon_timer_del(QP_Module_Setting *module);
extern void quickpanel_setting_module_progress_mode_set(QP_Module_Setting *module, int is_enable, int is_request_on);
extern void quickpanel_setting_module_syspopup_launch(char *appid, char *key, char *value);
extern int quickpanel_setting_module_dpm_state_get(char *module_name, int *state);
extern void quickpanel_setting_module_operate(const char *module_name);
+extern void quickpanel_setting_module_longpress_operate(const char *module_name);
#endif /* __SETTING_MODULE_API_H__ */
struct _QP_Module_Setting {
char *name;
+ char *setting_pkgname;
int is_disable_feedback;
/* func */
}
-HAPI int quickpanel_common_ui_is_package_exist(const char *pkgid)
-{
- int ret = 0;
- retif(pkgid == NULL, 0, "invalid parameter");
-
- package_info_h package_info = NULL;
-
- ret = package_manager_get_package_info(pkgid, &package_info);
- if (ret == PACKAGE_MANAGER_ERROR_NO_SUCH_PACKAGE) {
- DBG("package %s isn't exist", pkgid);
- return 0;
- }
-
- if (package_info)
- package_info_destroy(package_info);
-
-
- return 1;
-}
-
static void _quickpanel_move_data_to_service(const char *key, const char *val, void *data)
{
retif(data == NULL || key == NULL || val == NULL, , "Invialid parameter!");
int ret;
char *op = NULL;
- char *val = NULL;
+ char *moudle_info = NULL;
+ char *search_click_event = NULL;
+ char *search_longpress_event = NULL;
ret = app_control_get_operation(service, &op);
if (ret != APP_CONTROL_ERROR_NONE)
if (!strncmp(APP_CONTROL_OPERATION_SECURED_LOCK, op, strlen(APP_CONTROL_OPERATION_SECURED_LOCK))) {
- ret = app_control_get_extra_data(service, QP_QUICK_SETTINGS, &val);
- if (ret != APP_CONTROL_ERROR_NONE)
- ERR("Failed to get extra data (%d)", ret);
+ ret = app_control_get_extra_data(service, QP_QUICK_SETTINGS, &moudle_info);
+ if (ret == APP_CONTROL_ERROR_NONE && moudle_info != NULL) {
+
+ search_click_event = strstr(moudle_info, QP_QUICK_SETTINGS_EVENT_CLICKED);
+ if (search_click_event != NULL) {
+ *(moudle_info + strlen(moudle_info) - strlen(QP_QUICK_SETTINGS_EVENT_CLICKED)) = '\0';
+ quickpanel_setting_module_operate(moudle_info);
+ } else {
+ search_longpress_event = strstr(moudle_info, QP_QUICK_SETTINGS_EVENT_LONGPRESSED);
+ if (search_longpress_event != NULL) {
+ *(moudle_info + strlen(moudle_info) - strlen(QP_QUICK_SETTINGS_EVENT_LONGPRESSED)) = '\0';
+ quickpanel_setting_module_longpress_operate(moudle_info);
+ }
+ }
+
+ free(moudle_info);
- if (!strncmp("wifi", val, strlen("wifi")))
- quickpanel_setting_module_operate("wifi");
- else if (!strncmp("gps", val, strlen("gps")))
- quickpanel_setting_module_operate("gps");
- else if (!strncmp("bluetooth", val, strlen("bluetooth")))
- quickpanel_setting_module_operate("bluetooth");
+ quickpanel_page_secured_lock_set(QP_SECURED_LOCK_OFF);
+ }
- quickpanel_page_secured_lock_set(QP_SECURED_LOCK_OFF);
} else {
_service_request_process(service, data);
}
#define BUTTON_ICON_NORMAL "quick_icon_bluetooth.png"
#define BUTTON_ICON_HIGHLIGHT NULL
#define BUTTON_ICON_DIM NULL
-#define PACKAGE_SETTING_MENU "ug-bluetooth-efl"
int bt_service = BT_ERROR_NONE;
static void _long_press_cb(void *data)
{
+ QP_Module_Setting *module = (QP_Module_Setting *)data;
if (bt_service == BT_ERROR_NOT_SUPPORTED) {
quickpanel_setting_show_not_supported_message();
return;
}
- quickpanel_setting_icon_handler_longpress(PACKAGE_SETTING_MENU, NULL, NULL);
+
+ if (quickpanel_setting_module_is_immediate_actionable(module, QP_SETTING_ICON_LONGPRESSED) == false)
+ return;
+
+ quickpanel_setting_icon_handler_longpress(module->setting_pkgname, NULL, NULL);
}
static void _view_update(Evas_Object *view, int state, int flag_extra_1, int flag_extra_2)
{
int dpm_state = 0;
QP_Module_Setting *module = (QP_Module_Setting *)data;
- Eina_Bool secured_lock = EINA_FALSE;
retif(module == NULL, , "Invalid parameter!");
return;
+ if (quickpanel_setting_module_is_immediate_actionable(module, QP_SETTING_ICON_CLICKED) == 0)
+ return;
+
+
if (quickpanel_setting_module_dpm_state_get(module->name, &dpm_state) == 0)
return;
return;
}
- secured_lock = quickpanel_setting_get_secured_lock_state();
- if (secured_lock == EINA_TRUE) {
- quickpanel_uic_close_quickpanel(false, 0);
- quickpanel_common_send_message_to_app("org.tizen.lockscreen", APP_CONTROL_OPERATION_SECURED_LOCK, QP_QUICK_SETTINGS, module->name);
- } else {
- _state_change(module);
- }
+ _state_change(module);
+
}
static void _bluetooth_status_changed_cb(int result, bt_adapter_state_e adapter_state, void *user_data)
QP_Module_Setting bluetooth = {
.name = "bluetooth",
+ .setting_pkgname = "ug-bluetooth-efl",
.init = _init,
.fini = _fini,
.lang_changed = _lang_changed,
#define BUTTON_ICON_NORMAL "quick_icon_location.png"
#define BUTTON_ICON_HIGHLIGHT NULL
#define BUTTON_ICON_DIM NULL
-#define PACKAGE_SETTING_MENU "org.tizen.setting-location"
#define OPERATION_SETTING_MENU "http://tizen.org/appcontrol/operation/configure/location"
#define PACKAGE_SYSPOPUP "gps-syspopup"
static void _long_press_cb(void *data)
{
- quickpanel_setting_icon_handler_longpress(PACKAGE_SETTING_MENU, NULL, NULL);
+ QP_Module_Setting *module = (QP_Module_Setting *)data;
+
+ if (quickpanel_setting_module_is_immediate_actionable(module, QP_SETTING_ICON_LONGPRESSED) == false)
+ return;
+
+ quickpanel_setting_icon_handler_longpress(module->setting_pkgname, NULL, NULL);
}
static void _gps_syspopup_launch(int is_on)
{
int dpm_state = 0;
QP_Module_Setting *module = (QP_Module_Setting *)data;
- Eina_Bool secured_lock = EINA_FALSE;
retif(module == NULL, , "Invalid parameter!");
return;
+ if (quickpanel_setting_module_is_immediate_actionable(module, QP_SETTING_ICON_CLICKED) == 0)
+ return;
+
+
if (dpm_state == 0) {
quickpanel_setting_module_syspopup_launch(DPM_SYSPOPUP, "id", "location");
return;
}
- secured_lock = quickpanel_setting_get_secured_lock_state();
- if (secured_lock == EINA_TRUE) {
- quickpanel_uic_close_quickpanel(false, 0);
- quickpanel_common_send_message_to_app("org.tizen.lockscreen", APP_CONTROL_OPERATION_SECURED_LOCK, QP_QUICK_SETTINGS, module->name);
- } else {
- _state_change(module);
- }
+ _state_change(module);
+
}
static void _gps_vconf_cb(keynode_t *node, void *data)
QP_Module_Setting gps = {
.name = "gps",
+ .setting_pkgname = "org.tizen.setting-location",
.init = _init,
.fini = _fini,
.lang_changed = _lang_changed,
#define BUTTON_ICON_NORMAL "quick_icon_auto_rotate.png"
#define BUTTON_ICON_HIGHLIGHT NULL
#define BUTTON_ICON_DIM NULL
-#define PACKAGE_SETTING_MENU "org.tizen.setting-display"
static void _mouse_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _long_press_cb(void *data)
{
- quickpanel_setting_icon_handler_longpress(PACKAGE_SETTING_MENU, "viewtype", "main");
+ QP_Module_Setting *module = (QP_Module_Setting *)data;
+
+ if (quickpanel_setting_module_is_immediate_actionable(module, QP_SETTING_ICON_LONGPRESSED) == false)
+ return;
+
+ quickpanel_setting_icon_handler_longpress(module->setting_pkgname, "viewtype", "main");
}
static void _view_update(Evas_Object *view, int state, int flag_extra_1, int flag_extra_2)
QP_Module_Setting rotate = {
.name = "rotate",
+ .setting_pkgname = "org.tizen.setting-display",
.init = _init,
.fini = _fini,
.lang_changed = _lang_changed,
#define BUTTON_ICON_SND_HIGHLIGHT "quick_icon_sn_vf.png"
#define BUTTON_ICON_MUTE_NORMAL "quick_icon_sf_vf.png"
#define BUTTON_ICON_VIB_HIGHLIGHT "quick_icon_sf_vn.png"
-#define PACKAGE_SETTING_MENU "org.tizen.setting-profile"
#define SAM_LOG_FEATURE_SOUND "ST0C"
typedef enum {
static void _long_press_cb(void *data)
{
- quickpanel_setting_icon_handler_longpress(PACKAGE_SETTING_MENU, NULL, NULL);
+ QP_Module_Setting *module = (QP_Module_Setting *)data;
+
+ if (quickpanel_setting_module_is_immediate_actionable(module, QP_SETTING_ICON_LONGPRESSED) == false)
+ return;
+
+ quickpanel_setting_icon_handler_longpress(module->setting_pkgname, NULL, NULL);
}
QP_Module_Setting sound = {
.name = "sound",
+ .setting_pkgname = "org.tizen.setting-profile",
.init = _init,
.fini = _fini,
.lang_changed = _lang_changed,
#define BUTTON_ICON_NORMAL "quick_icon_wifi.png"
#define BUTTON_ICON_HIGHLIGHT NULL
#define BUTTON_ICON_DIM NULL
-#define PACKAGE_SETTING_MENU "wifi-efl-ug-lite"
-#define PACKAGE_SETTING_MENU_PTN "wifi-efl-ug" // for redwood partner
-
static int _wifi_on(void *data, const char *popup_txt);
static int _wifi_off(void);
static void _long_press_cb(void *data)
{
+ QP_Module_Setting *module = (QP_Module_Setting *)data;
if (wifi_manager == NULL && wifi_error_type == WIFI_MANAGER_ERROR_NOT_SUPPORTED) {
quickpanel_setting_show_not_supported_message();
return;
}
- if (quickpanel_common_ui_is_package_exist(PACKAGE_SETTING_MENU)) {
- quickpanel_setting_icon_handler_longpress(PACKAGE_SETTING_MENU, NULL, NULL);
- } else {
- DBG("No package[%s] try[%s]", PACKAGE_SETTING_MENU, PACKAGE_SETTING_MENU_PTN);
- quickpanel_setting_icon_handler_longpress(PACKAGE_SETTING_MENU_PTN, NULL, NULL);
- }
+ if (quickpanel_setting_module_is_immediate_actionable(module, QP_SETTING_ICON_LONGPRESSED) == false)
+ return;
+
+
+ quickpanel_setting_icon_handler_longpress(module->setting_pkgname, NULL, NULL);
}
static void _view_update(Evas_Object *view, int state, int flag_extra_1, int flag_extra_2)
{
int dpm_state = 0;
QP_Module_Setting *module = (QP_Module_Setting *)data;
- Eina_Bool secured_lock = EINA_FALSE;
if (wifi_manager == NULL && wifi_error_type == WIFI_MANAGER_ERROR_NOT_SUPPORTED) {
quickpanel_setting_show_not_supported_message();
return;
+ if (quickpanel_setting_module_is_immediate_actionable(module, QP_SETTING_ICON_CLICKED) == 0)
+ return;
+
+
if (quickpanel_setting_module_dpm_state_get(module->name, &dpm_state) == 0)
return;
return;
}
- secured_lock = quickpanel_setting_get_secured_lock_state();
- if (secured_lock == EINA_TRUE) {
- quickpanel_uic_close_quickpanel(false, 0);
- quickpanel_common_send_message_to_app("org.tizen.lockscreen", APP_CONTROL_OPERATION_SECURED_LOCK, QP_QUICK_SETTINGS, module->name);
- } else {
- _state_change(module);
- }
+ _state_change(module);
}
static int _register_module_event_handler(void *data)
QP_Module_Setting wifi = {
.name = "wifi",
+ .setting_pkgname = "wifi-efl-ug",
.init = _init,
.fini = _fini,
.lang_changed = _lang_changed,
#include "setting_utils.h"
#include "setting_module_api.h"
#include "settings_icon_common.h"
+#include "common_uic.h"
#ifdef QP_SCREENREADER_ENABLE
#include "accessibility.h"
return 1;
}
+
+HAPI int quickpanel_setting_module_is_immediate_actionable(QP_Module_Setting *module, qp_setting_icon_event_type event_type)
+{
+ Eina_Bool secured_lock = EINA_FALSE;
+ char buf[MAX_NAM_LEN];
+ retif(module == NULL || module->loader == NULL, 0, "invalid parameter");
+
+ secured_lock = quickpanel_setting_get_secured_lock_state();
+ if (secured_lock == EINA_TRUE) {
+ strncpy(buf, module->name, strlen(module->name));
+ buf[strlen(module->name)] = '\0';
+
+ switch (event_type) {
+ case QP_SETTING_ICON_CLICKED:
+ strncat(buf, QP_QUICK_SETTINGS_EVENT_CLICKED, strlen(QP_QUICK_SETTINGS_EVENT_CLICKED));
+ break;
+ case QP_SETTING_ICON_LONGPRESSED:
+ strncat(buf, QP_QUICK_SETTINGS_EVENT_LONGPRESSED, strlen(QP_QUICK_SETTINGS_EVENT_LONGPRESSED));
+ break;
+ default:
+ break;
+ }
+
+ quickpanel_common_send_message_to_app("org.tizen.lockscreen", APP_CONTROL_OPERATION_SECURED_LOCK, QP_QUICK_SETTINGS, buf);
+ quickpanel_uic_close_quickpanel(false, 0);
+ return 0;
+ }
+
+ return 1;
+}
+
+
static Eina_Bool _timer_expire_cb(void *data)
{
retif(data == NULL, ECORE_CALLBACK_CANCEL, "invalid parameter");
QP_Module_Setting *module = NULL;
module = quickpanel_settings_module_get_by_name(module_name);
- if (module->state_change)
+
+ if (module != NULL && module->state_change)
module->state_change(module);
+ else
+ DBG("Faild to get module [%s]", module_name);
}
+
+
+HAPI void quickpanel_setting_module_longpress_operate(const char *module_name)
+{
+ QP_Module_Setting *module = NULL;
+
+ module = quickpanel_settings_module_get_by_name(module_name);
+ if (module != NULL && module->setting_pkgname)
+ quickpanel_setting_icon_handler_longpress(module->setting_pkgname, NULL, NULL);
+ else
+ DBG("Faild to get module [%s]", module_name);
+
+}
+
if (module->name)
DBG("launch setting menu of %s", module->name);
- module->handler_longpress(obj);
+ module->handler_longpress(module);
elm_object_signal_emit(obj, "mouse,up,1", "background.super");
}
ret = quickpanel_common_send_message_to_app(pkgname, NULL, key, value);
quickpanel_common_inform_launch_app_result(pkgname, ret);
- quickpanel_uic_close_quickpanel(true, 1);
+ quickpanel_uic_close_quickpanel(false, 0);
}
#endif