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);
+extern int quickpanel_common_launch_app(char *app_id, void *data);
enum app_subdir {
APP_DIR_DATA,
OPENED_BY_CMD_SHOW_SETTINGS = 2,
} qp_open_reason;
+
extern Evas_Object *quickpanel_uic_load_edj(Evas_Object * parent, const char *file, const char *group, int is_just_load);
-extern int quickpanel_uic_launch_app(char *app_id, void *data);
-extern int quickpanel_uic_launch_ug_by_appcontrol(const char *package, void *data);
extern int quickpanel_uic_is_emul(void);
extern int quickpanel_uic_is_suspended(void);
extern int quickpanel_uic_is_opened(void);
-extern void quickpanel_uic_launch_app_inform_result(const char *pkgname, int retcode);
extern void quickpanel_uic_initial_resize(Evas_Object *obj, int height);
extern void quickpanel_uic_close_quickpanel(bool is_check_lock, int is_delay_needed);
extern void quickpanel_uic_open_quickpanel(int reason);
extern void quickpanel_uic_opened_reason_set(int reason);
extern int quickpanel_uic_opened_reason_get(void);
+
#endif /* __QP_COMMON_UIC_H_ */
extern int quickpanel_setting_icon_click_cb_add(Evas_Object *icon, Edje_Signal_Cb func, void *data);
extern int quickpanel_setting_icon_click_cb_without_feedback_add(Evas_Object *icon, Edje_Signal_Cb func, void *data);
extern int quickpanel_setting_icon_click_cb_del(Evas_Object *icon, Edje_Signal_Cb func);
-extern void quickpanel_setting_icon_handler_longpress(const char *pkgname, void *data);
+extern void quickpanel_setting_icon_handler_longpress(const char *pkgname, const char *key, const char *value);
#endif /* __SETTING_ICON_COMMON_H__ */
#include <tzsh_quickpanel_service.h>
#include <E_DBus.h>
#include <app_common.h>
+#include <app_control.h>
+#include <app_control_internal.h>
+#include <bundle_internal.h>
+#include <notification.h>
+
#include "common.h"
+
#include "quickpanel-ui.h"
static inline int _is_space(char in)
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!");
+
+ app_control_h service = data;
+ app_control_add_extra_data(service, key, val);
+}
+
+HAPI void quickpanel_common_inform_launch_app_result(const char *pkgname, int retcode)
+{
+ retif(retcode == APP_CONTROL_ERROR_NONE, , "retcode = APP_CONTROL_ERROR_NONE!");
+ retif(pkgname == NULL && retcode != APP_CONTROL_ERROR_APP_NOT_FOUND, , "Invialid parameter!");
+
+ const char *msg = NULL;
+ char *app_label = NULL;
+
+ if (retcode == APP_CONTROL_ERROR_APP_NOT_FOUND) {
+ notification_status_message_post(_NOT_LOCALIZED("Unable to find application to perform this action."));
+ } else {
+ Eina_Strbuf *strbuf = eina_strbuf_new();
+ char *format = _("IDS_QP_TPOP_UNABLE_TO_OPEN_PS");
+
+ if (strbuf != NULL) {
+ app_label = quickpanel_common_ui_get_pkginfo_label(pkgname);
+ if (app_label != NULL) {
+ eina_strbuf_append_printf(strbuf, format, app_label);
+ free(app_label);
+ } else {
+ eina_strbuf_append_printf(strbuf, format, pkgname);
+ }
+ eina_strbuf_append_printf(strbuf, "(%x)", retcode);
+ msg = eina_strbuf_string_get(strbuf);
+
+ if (msg != NULL) {
+ notification_status_message_post(msg);
+ }
+ eina_strbuf_free(strbuf);
+ }
+ }
+}
+
+HAPI int quickpanel_common_send_message_to_app(const char *app_id, const char *operation, const char *key, const char *value)
+{
+ int ret = APP_CONTROL_ERROR_NONE;
+ app_control_h service = NULL;
+
+ retif(app_id == NULL && operation == NULL, APP_CONTROL_ERROR_INVALID_PARAMETER, "Invialid parameter!");
+
+ ret = app_control_create(&service);
+ if (ret != APP_CONTROL_ERROR_NONE || service == NULL) {
+ ERR("app_control_create() return error : %d", ret);
+ return ret;
+ }
+
+ if (app_id != NULL) {
+ app_control_set_app_id(service, app_id);
+ } else {
+ DBG("Implicit app_control, %s", operation?operation:"-");
+ }
+
+ if (operation != NULL) {
+ app_control_set_operation(service, operation);
+ } else {
+ app_control_set_operation(service, APP_CONTROL_OPERATION_DEFAULT);
+ }
+
+ if (key != NULL && value != NULL) {
+ app_control_add_extra_data(service, key, value);
+ }
+
+ ret = app_control_send_launch_request(service, NULL, NULL);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ ERR("app_control_send_launch_request() is failed : %d", ret);
+ }
+
+ app_control_destroy(service);
+
+ return ret;
+}
+
+HAPI int quickpanel_common_launch_app(char *app_id, void *data)
+{
+ int ret = APP_CONTROL_ERROR_NONE;
+ app_control_h service = NULL;
+ char *app_id_from_service = NULL;
+
+ retif(app_id == NULL && data == NULL, APP_CONTROL_ERROR_INVALID_PARAMETER, "Invialid parameter!");
+
+ ret = app_control_create(&service);
+ if (ret != APP_CONTROL_ERROR_NONE || service == NULL) {
+ ERR("app_control_create() return error : %d", ret);
+ return ret;
+ }
+
+ if (app_id != NULL) {
+ app_control_set_operation(service, APP_CONTROL_OPERATION_DEFAULT);
+ app_control_set_app_id(service, app_id);
+
+ if (data != NULL) {
+ bundle_iterate((bundle *)data, _quickpanel_move_data_to_service, service);
+ }
+ } else {
+ if (data != NULL) {
+ ret = app_control_import_from_bundle(service, (bundle *)data);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ ERR("Failed to import[%d]", ret);
+ }
+ }
+ }
+
+ ret = app_control_send_launch_request(service, NULL, NULL);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ ERR("app_control_send_launch_request() is failed : %d", ret);
+ app_control_get_app_id(service, &app_id_from_service);
+ if (app_id_from_service != NULL) {
+ quickpanel_common_inform_launch_app_result(app_id_from_service, ret);
+ free(app_id_from_service);
+ } else {
+ quickpanel_common_inform_launch_app_result(app_id, ret);
+ }
+ app_control_destroy(service);
+ return ret;
+ }
+ app_control_destroy(service);
+ return ret;
+}
+
const char *util_get_file_path(enum app_subdir dir, const char *relative)
{
static char buf[PATH_MAX];
#include <appcore-common.h>
#include <notification.h>
#include <app_control_internal.h>
-#include <bundle_internal.h>
#include <system_info.h>
#include <tzsh.h>
static Ecore_Timer *_close_timer = NULL;
-static void _quickpanel_move_data_to_service(const char *key, const char *val, void *data)
-{
- retif(data == NULL || key == NULL || val == NULL, , "Invialid parameter!");
-
- app_control_h service = data;
- app_control_add_extra_data(service, key, val);
-}
HAPI Evas_Object *quickpanel_uic_load_edj(Evas_Object * parent, const char *file, const char *group, int is_just_load)
{
}
}
-HAPI int quickpanel_uic_launch_app(char *app_id, void *data)
-{
- int ret = APP_CONTROL_ERROR_NONE;
- app_control_h service = NULL;
- char *app_id_from_service = NULL;
-
- retif(app_id == NULL && data == NULL, APP_CONTROL_ERROR_INVALID_PARAMETER, "Invialid parameter!");
-
- ret = app_control_create(&service);
- if (ret != APP_CONTROL_ERROR_NONE) {
- ERR("app_control_create() return error : %d", ret);
- return ret;
- }
- retif(service == NULL, APP_CONTROL_ERROR_INVALID_PARAMETER, "fail to create service handle!");
-
- if (app_id != NULL) {
- app_control_set_operation(service, APP_CONTROL_OPERATION_DEFAULT);
- app_control_set_app_id(service, app_id);
-
- if (data != NULL) {
- bundle_iterate((bundle *)data, _quickpanel_move_data_to_service, service);
- }
- } else {
- if (data != NULL) {
- ret = app_control_import_from_bundle(service, data);
- if (ret != APP_CONTROL_ERROR_NONE) {
- ERR("Failed to import[%d]", ret);
- }
- }
- }
-
- ret = app_control_send_launch_request(service, NULL, NULL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- ERR("app_control_send_launch_request() is failed : %d", ret);
- app_control_get_app_id(service, &app_id_from_service);
- if (app_id_from_service != NULL) {
- quickpanel_uic_launch_app_inform_result(app_id_from_service, ret);
- free(app_id_from_service);
- } else {
- quickpanel_uic_launch_app_inform_result(app_id, ret);
- }
- app_control_destroy(service);
- return ret;
- }
- app_control_destroy(service);
- return ret;
-}
-
-HAPI int quickpanel_uic_launch_ug_by_appcontrol(const char *package, void *data)
-{
- int ret = APP_CONTROL_ERROR_NONE;
- app_control_h service = NULL;
- struct appdata *ad = quickpanel_get_app_data();
- retif(ad == NULL, APP_CONTROL_ERROR_INVALID_PARAMETER, "ad null");
- retif(package == NULL, APP_CONTROL_ERROR_INVALID_PARAMETER, "package null");
-
- ret = app_control_create(&service);
- if (ret != APP_CONTROL_ERROR_NONE) {
- ERR("app_control_create() return error : %d", ret);
- return ret;
- }
- retif(service == NULL, APP_CONTROL_ERROR_INVALID_PARAMETER, "fail to create service handle!");
-
- app_control_set_operation(service, APP_CONTROL_OPERATION_DEFAULT);
- app_control_set_app_id(service, package);
-
- if (data != NULL) {
- bundle_iterate((bundle *)data, _quickpanel_move_data_to_service, service);
- }
-
- ret = app_control_send_launch_request(service, NULL, NULL);
- if (ret != APP_CONTROL_ERROR_NONE) {
- ERR("app_control_send_launch_request() is failed : %d", ret);
- app_control_destroy(service);
- return ret;
- }
- app_control_destroy(service);
- return ret;
-}
-
-HAPI void quickpanel_uic_launch_app_inform_result(const char *pkgname, int retcode)
-{
- retif(retcode == APP_CONTROL_ERROR_NONE, , "retcode = APP_CONTROL_ERROR_NONE!");
- retif(pkgname == NULL && retcode != APP_CONTROL_ERROR_APP_NOT_FOUND, , "Invialid parameter!");
-
- const char *msg = NULL;
- char *app_label = NULL;
-
- if (retcode == APP_CONTROL_ERROR_APP_NOT_FOUND) {
- notification_status_message_post(_NOT_LOCALIZED("Unable to find application to perform this action."));
- } else {
- Eina_Strbuf *strbuf = eina_strbuf_new();
- char *format = _("IDS_QP_TPOP_UNABLE_TO_OPEN_PS");
-
- if (strbuf != NULL) {
- app_label = quickpanel_common_ui_get_pkginfo_label(pkgname);
- if (app_label != NULL) {
- eina_strbuf_append_printf(strbuf, format, app_label);
- free(app_label);
- } else {
- eina_strbuf_append_printf(strbuf, format, pkgname);
- }
- eina_strbuf_append_printf(strbuf, "(%x)", retcode);
- msg = eina_strbuf_string_get(strbuf);
-
- if (msg != NULL) {
- notification_status_message_post(msg);
- }
- eina_strbuf_free(strbuf);
- }
- }
-}
-
HAPI void quickpanel_uic_open_quickpanel(int reason)
{
struct appdata *ad = quickpanel_get_app_data();
{
/* TO DO */
}
+
+
quickpanel_media_play_feedback();
- ret = quickpanel_uic_launch_ug_by_appcontrol(QP_TIMEDATE_SETTING_UG, NULL);
- quickpanel_uic_launch_app_inform_result(QP_TIMEDATE_SETTING_UG, ret);
+ ret = quickpanel_common_send_message_to_app(QP_TIMEDATE_SETTING_UG, NULL, NULL, NULL);
+ quickpanel_common_inform_launch_app_result(QP_TIMEDATE_SETTING_UG, ret);
quickpanel_uic_close_quickpanel(true, 1);
}
#ifdef QP_EMERGENCY_MODE_ENABLE
if (quickpanel_emergency_mode_is_on()) {
- quickpanel_uic_launch_app(PACKAGE_EMERGENCY_MODE_SETTING, NULL);
+ quickpanel_common_launch_app(PACKAGE_EMERGENCY_MODE_SETTING, NULL);
} else {
- quickpanel_uic_launch_app(QP_SETTING_PKG_SETTING, NULL);
+ quickpanel_common_launch_app(QP_SETTING_PKG_SETTING, NULL);
}
#else
- quickpanel_uic_launch_app(QP_SETTING_PKG_SETTING, NULL);
+ quickpanel_common_launch_app(QP_SETTING_PKG_SETTING, NULL);
#endif
quickpanel_uic_close_quickpanel(true, 1);
}
{
DBG("_minictrl_remove [%s]", name);
+
minicontrol_viewer_send_event(name, MINICONTROL_EVENT_REQUEST_HIDE, NULL);
if (s_info.prov_table) {
if (responding_service_handle != NULL) {
DBG("responding_service_handle : %s", responding_service_handle);
- ret = quickpanel_uic_launch_app(NULL, responding_service_handle);
+ ret = quickpanel_common_launch_app(NULL, responding_service_handle);
} else if (flag_launch == 1) {
char *text_count = NULL;
notification_get_text(noti, NOTIFICATION_TEXT_TYPE_EVENT_COUNT, &text_count);
}
if (single_service_handle != NULL && multi_service_handle == NULL) {
- ret = quickpanel_uic_launch_app(NULL, single_service_handle);
+ ret = quickpanel_common_launch_app(NULL, single_service_handle);
} else if (single_service_handle == NULL && multi_service_handle != NULL) {
- ret = quickpanel_uic_launch_app(NULL, multi_service_handle);
+ ret = quickpanel_common_launch_app(NULL, multi_service_handle);
} else if (single_service_handle != NULL && multi_service_handle != NULL) {
if (count <= 1) {
- ret = quickpanel_uic_launch_app(NULL, single_service_handle);
+ ret = quickpanel_common_launch_app(NULL, single_service_handle);
} else {
- ret = quickpanel_uic_launch_app(NULL, multi_service_handle);
+ ret = quickpanel_common_launch_app(NULL, multi_service_handle);
}
} else { //single_service_handle == NULL && multi_service_handle == NULL
DBG("there is no execution option in notification");
}
- quickpanel_uic_launch_app_inform_result(caller_pkgname, ret);
+ quickpanel_common_inform_launch_app_result(caller_pkgname, ret);
}
_activenoti_hide(data , 1);
if (pressed_area == NOTI_PRESS_BUTTON_1 && responding_service_handle != NULL) {
DBG("");
quickpanel_uic_close_quickpanel(true, 1);
- ret = quickpanel_uic_launch_app(NULL, responding_service_handle);
+ ret = quickpanel_common_launch_app(NULL, responding_service_handle);
} else if (flag_launch == 1) {
/* Hide quickpanel */
quickpanel_uic_close_quickpanel(true, 1);
if (single_service_handle != NULL && multi_service_handle == NULL) {
DBG("");
- ret = quickpanel_uic_launch_app(NULL, single_service_handle);
+ ret = quickpanel_common_launch_app(NULL, single_service_handle);
}
if (single_service_handle == NULL && multi_service_handle != NULL) {
DBG("");
- ret = quickpanel_uic_launch_app(NULL, multi_service_handle);
+ ret = quickpanel_common_launch_app(NULL, multi_service_handle);
}
if (single_service_handle != NULL && multi_service_handle != NULL) {
DBG("");
if (count <= 1) {
- ret = quickpanel_uic_launch_app(NULL, single_service_handle);
+ ret = quickpanel_common_launch_app(NULL, single_service_handle);
} else {
- ret = quickpanel_uic_launch_app(NULL, multi_service_handle);
+ ret = quickpanel_common_launch_app(NULL, multi_service_handle);
}
}
- quickpanel_uic_launch_app_inform_result(pkgname, ret);
+ quickpanel_common_inform_launch_app_result(pkgname, ret);
}
if (flag_delete == 1 && type == NOTIFICATION_TYPE_NOTI) {
quickpanel_media_play_feedback();
- quickpanel_uic_launch_app(QP_SETTING_PKG_NOTI, NULL);
+ quickpanel_common_launch_app(QP_SETTING_PKG_NOTI, NULL);
quickpanel_uic_close_quickpanel(true, 1);
}
#define QP_WINDOW_PRIO 300
+#define APP_CONTROL_OPERATION_CANCEL_NOTIFICATION "http://tizen.org/appcontrol/operation/cancel_notification"
+
+#define PACKAGE_INDICATOR "org.tizen.indicator"
+
// TODO : Due to not ready of the Secured Lockscreen, hide secured feature implementation.
//#define _SECURED_LOCKSCREEN
DBG("quickpanel is closed");
ad->is_opened = 0;
+ quickpanel_common_send_message_to_app(PACKAGE_INDICATOR, APP_CONTROL_OPERATION_CANCEL_NOTIFICATION, NULL, NULL);
quickpanel_util_time_timer_enable_set(0);
quickpanel_keyboard_closing_fini(ad);
quickpanel_modules_closed(data);
static void _long_press_cb(void *data)
{
- quickpanel_setting_icon_handler_longpress(PACKAGE_SETTING_MENU, NULL);
+ quickpanel_setting_icon_handler_longpress(PACKAGE_SETTING_MENU, NULL, NULL);
}
static void _view_update(Evas_Object *view, int state, int flag_extra_1, int flag_extra_2)
static void _long_press_cb(void *data)
{
- quickpanel_setting_icon_handler_longpress(PACKAGE_SETTING_MENU, NULL);
+ quickpanel_setting_icon_handler_longpress(PACKAGE_SETTING_MENU, NULL, NULL);
}
static void _gps_syspopup_launch(int is_on)
static void _long_press_cb(void *data)
{
-
- bundle *kb = bundle_create();
- if (kb != NULL) {
- bundle_add(kb, "viewtype", "main");
-
- quickpanel_setting_icon_handler_longpress(PACKAGE_SETTING_MENU, kb);
-
- bundle_free(kb);
- } else {
- ERR("failed to create the bunlde");
- }
-
+ quickpanel_setting_icon_handler_longpress(PACKAGE_SETTING_MENU, "viewtype", "main");
}
static void _view_update(Evas_Object *view, int state, int flag_extra_1, int flag_extra_2)
static void _long_press_cb(void *data)
{
- quickpanel_setting_icon_handler_longpress(PACKAGE_SETTING_MENU, NULL);
+ quickpanel_setting_icon_handler_longpress(PACKAGE_SETTING_MENU, NULL, NULL);
}
static void _long_press_cb(void *data)
{
if (quickpanel_common_ui_is_package_exist(PACKAGE_SETTING_MENU)) {
- quickpanel_setting_icon_handler_longpress(PACKAGE_SETTING_MENU, NULL);
+ 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);
+ quickpanel_setting_icon_handler_longpress(PACKAGE_SETTING_MENU_PTN, NULL, NULL);
}
}
int ret = APP_CONTROL_ERROR_NONE;
ret = app_control_create(&service);
- if (ret != APP_CONTROL_ERROR_NONE) {
+ if (ret != APP_CONTROL_ERROR_NONE || service == NULL) {
ERR("Failed to create app_control[%d]", ret);
return;
}
retif(appid == NULL, , "Invalid parameter!");
ret = app_control_create(&service);
- if (ret != APP_CONTROL_ERROR_NONE) {
+ if (ret != APP_CONTROL_ERROR_NONE || service == NULL) {
ERR("Failed to create app_control[%d]", ret);
return;
}
return QP_OK;
}
-HAPI void quickpanel_setting_icon_handler_longpress(const char *pkgname, void *data)
+HAPI void quickpanel_setting_icon_handler_longpress(const char *pkgname, const char *key, const char *value)
{
int ret;
- ret = quickpanel_uic_launch_ug_by_appcontrol(pkgname, data);
- quickpanel_uic_launch_app_inform_result(pkgname, ret);
+ 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);
}
#endif
{
DBG("_button_clicked_cb");
int ret = 0;
- quickpanel_uic_launch_ug_by_appcontrol(VOICE_CONTOL_REF_APP, NULL);
- quickpanel_uic_launch_app_inform_result(VOICE_CONTOL_REF_APP, ret);
+ ret = quickpanel_common_send_message_to_app(VOICE_CONTOL_REF_APP, NULL, NULL, NULL);
+ quickpanel_common_inform_launch_app_result(VOICE_CONTOL_REF_APP, ret);
quickpanel_uic_close_quickpanel(true, 1);
}