diff options
Diffstat (limited to 'include/phone-ug.h')
-rwxr-xr-x | include/phone-ug.h | 171 |
1 files changed, 171 insertions, 0 deletions
diff --git a/include/phone-ug.h b/include/phone-ug.h new file mode 100755 index 0000000..e608458 --- /dev/null +++ b/include/phone-ug.h @@ -0,0 +1,171 @@ +/* +* Copyright 2012 Samsung Electronics Co., Ltd +* +* Licensed under the Flora License, Version 1.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://floralicense.org/license/ +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +#ifndef __PHONE_UG_H__ +#define __PHONE_UG_H__ + +/** + * @defgroup PHONE_UG PHONE UI-gadget + * @ingroup SLP_UG + * @addtogroup PHONE_UG + * @{ + * + * Phone UI-gadget + * \n This header file contains the declaration & description for Phone UG. + * + * @section Header To use Them: + * @code + * #include <phone-ug.h> + * @endcode + * + * @section example Example: + * @code + #include <stdio.h> + #include <ui-gadget.h> + #include <phone-ug.h> + * @endcode + * + void phonelog_ug () + { + bundle *bd; + char buf[16]; + + bd = bundle_create(); + if(NULL == bd) { + ERR("bundle_create() Failed"); + return; + } + + snprintf(buf, sizeof(buf), "%d", PH_UG_REQUEST_LOG_CHECK); + bundle_add(bd, PH_UG_BUNDLE_TYPE, buf); + + cbs.layout_cb = ug_layout_cb; + cbs.result_cb = NULL; + cbs.destroy_cb = ug_destroy_cb; + + ug = ug_create(NULL, UG_PHONE_LOG, UG_MODE_FULLVIEW, bd, &cbs); + if(NULL == ug) + ERR("ug_create() Failed"); + + bundle_free(bd); + } + * @endcode + */ + +/** + * The name of phonelog UG + */ +#define UG_DIALER_LOG "dialer-efl" + +/** + * The name of dialer UG + * @see #PH_UG_LOG_TYPES + */ +#define UG_PHONE_LOG "phonelog-efl" + +/** + * The name of phoneui UG + */ +#define UG_PHONEUI_LOG "phoneui-efl" + +/** + * types of #UG_PHONEUI + */ +enum PHUI_UG_LIST_TYPES{ + PH_UG_REQUEST_SELECT = 11,/**< . */ + PH_UG_REQUEST_SELECT_NUMBER = 12,/**< . */ + PH_UG_REQUEST_SELECT_EMAIL = 13,/**< . */ + PH_UG_REQUEST_SELECT_NUMBER_OR_EMAIL = 17,/**< . */ + + PH_UG_REQUEST_SET_WITH_NUM = 21,/**< . */ + PH_UG_REQUEST_SET_WITH_EMAIL = 22,/**< . */ + PH_UG_REQUEST_SET_WITH_WEB = 23,/**< . */ + PH_UG_REQUEST_SET_WITH_IMG = 24,/**< . */ + PH_UG_REQUEST_SET_WITH_RINGTONE = 25,/**< . */ + + PH_UG_REQUEST_CHECK = 31,/**< . */ + PH_UG_REQUEST_CHECK_FOR_NUMBER = 32,/**< . */ + PH_UG_REQUEST_CHECK_FOR_EMAIL = 33,/**< . */ + PH_UG_REQUEST_CHECK_FOR_NUMBER_OR_EMAIL = 34,/**< . */ + + PH_UG_REQUEST_LAUNCH_VOICECALL = 51,/**< . */ +}; + +/** + * The name of speeddial UG + */ +#define UG_SPEEDDIAL_LOG "speeddial-efl" + + +/** + * types of #PH_UG_LOG_TYPES + */ +enum PH_UG_LOG_TYPES{ + PH_UG_REQUEST_LOG_CHECK = 11, + PH_UG_REQUEST_LOG_SELECT = 12, +}; + +/** + * The key of request bundle for type. + * \n Value : convert id to string by using \%d. + */ +#define PH_UG_BUNDLE_TYPE "type" + +/** + * The key of result bundle for phonelog index + * \n The contact index on #PH_UG_REQUEST_LOG_SELECT + * \n Value : convert id to integer by using atoi() + * \n Recommends to destroy Phone UG at ug_cbs.destroy_cb.(not ug_cbs.result_cb) + * \n In ug_cbs.result_cb, ug_destroy() should not be called. + */ +#define PH_UG_BUNDLE_RESULT_PLOG_ID "plog_id" + +/** + * The key of result bundle for a list of phonelog index + * \n The phonelog index on #PH_UG_REQUEST_LOG_CHECK + * \n Value : convert string to a integer array by using g_base64_decode() + * \n Recommends to destroy Phone UG at ug_cbs.destroy_cb.(not ug_cbs.result_cb) + * \n In ug_cbs.result_cb, ug_destroy() should not be called. + * @par example + * @code + void phonelog_result_cb(struct ui_gadget *ug, bundle *result, void *data) + { + if(NULL == ug || NULL == data) + return; + + if(result) { + const char *val; + int *list, len, i; + + val = bundle_get_val(result, PH_UG_BUNDLE_RESULT_PLOG_ID_LIST); + list = (int *)g_base64_decode(val, &len); + + for(i=0;i<len/sizeof(int);i++) + printf("selected contact = %d", list[i]); + + g_free(list); + } + } + * + * @endcode + */ +#define PH_UG_BUNDLE_RESULT_PLOG_ID_LIST "get_select_list" // TODO : change to "plog_id_list" + +/** + * @} + */ + +#endif //__PHONE_UG_H__ |