2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __PHONE_UG_H__
18 #define __PHONE_UG_H__
21 * @defgroup PHONE_UG PHONE UI-gadget
23 * @addtogroup PHONE_UG
27 * \n This header file contains the declaration & description for Phone UG.
29 * @section Header To use Them:
31 * #include <phone-ug.h>
34 * @section example Example:
37 #include <ui-gadget.h>
48 ERR("bundle_create() Failed");
52 snprintf(buf, sizeof(buf), "%d", PH_UG_REQUEST_LOG_CHECK);
53 bundle_add(bd, PH_UG_BUNDLE_TYPE, buf);
55 cbs.layout_cb = ug_layout_cb;
57 cbs.destroy_cb = ug_destroy_cb;
59 ug = ug_create(NULL, UG_PHONE_LOG, UG_MODE_FULLVIEW, bd, &cbs);
61 ERR("ug_create() Failed");
69 * The name of phonelog UG
71 #define UG_DIALER_LOG "dialer-efl"
74 * The name of dialer UG
75 * @see #PH_UG_LOG_TYPES
77 #define UG_PHONE_LOG "phonelog-efl"
80 * The name of phoneui UG
82 #define UG_PHONEUI_LOG "phoneui-efl"
85 * types of #UG_PHONEUI
87 enum PHUI_UG_LIST_TYPES{
88 PH_UG_REQUEST_SELECT = 11,/**< . */
89 PH_UG_REQUEST_SELECT_NUMBER = 12,/**< . */
90 PH_UG_REQUEST_SELECT_EMAIL = 13,/**< . */
91 PH_UG_REQUEST_SELECT_NUMBER_OR_EMAIL = 17,/**< . */
93 PH_UG_REQUEST_SET_WITH_NUM = 21,/**< . */
94 PH_UG_REQUEST_SET_WITH_EMAIL = 22,/**< . */
95 PH_UG_REQUEST_SET_WITH_WEB = 23,/**< . */
96 PH_UG_REQUEST_SET_WITH_IMG = 24,/**< . */
97 PH_UG_REQUEST_SET_WITH_RINGTONE = 25,/**< . */
99 PH_UG_REQUEST_CHECK = 31,/**< . */
100 PH_UG_REQUEST_CHECK_FOR_NUMBER = 32,/**< . */
101 PH_UG_REQUEST_CHECK_FOR_EMAIL = 33,/**< . */
102 PH_UG_REQUEST_CHECK_FOR_NUMBER_OR_EMAIL = 34,/**< . */
104 PH_UG_REQUEST_LAUNCH_VOICECALL = 51,/**< . */
108 * The name of speeddial UG
110 #define UG_SPEEDDIAL_LOG "speeddial-efl"
114 * types of #PH_UG_LOG_TYPES
116 enum PH_UG_LOG_TYPES{
117 PH_UG_REQUEST_LOG_CHECK = 11,
118 PH_UG_REQUEST_LOG_SELECT = 12,
122 * The key of request bundle for type.
123 * \n Value : convert id to string by using \%d.
125 #define PH_UG_BUNDLE_TYPE "type"
128 * The key of result bundle for phonelog index
129 * \n The contact index on #PH_UG_REQUEST_LOG_SELECT
130 * \n Value : convert id to integer by using atoi()
131 * \n Recommends to destroy Phone UG at ug_cbs.destroy_cb.(not ug_cbs.result_cb)
132 * \n In ug_cbs.result_cb, ug_destroy() should not be called.
134 #define PH_UG_BUNDLE_RESULT_PLOG_ID "plog_id"
137 * The key of result bundle for a list of phonelog index
138 * \n The phonelog index on #PH_UG_REQUEST_LOG_CHECK
139 * \n Value : convert string to a integer array by using g_base64_decode()
140 * \n Recommends to destroy Phone UG at ug_cbs.destroy_cb.(not ug_cbs.result_cb)
141 * \n In ug_cbs.result_cb, ug_destroy() should not be called.
144 void phonelog_result_cb(struct ui_gadget *ug, bundle *result, void *data)
146 if(NULL == ug || NULL == data)
153 val = bundle_get_val(result, PH_UG_BUNDLE_RESULT_PLOG_ID_LIST);
154 list = (int *)g_base64_decode(val, &len);
156 for(i=0;i<len/sizeof(int);i++)
157 printf("selected contact = %d", list[i]);
165 #define PH_UG_BUNDLE_RESULT_PLOG_ID_LIST "get_select_list" // TODO : change to "plog_id_list"
171 #endif //__PHONE_UG_H__