diff options
Diffstat (limited to 'include')
-rwxr-xr-x | include/contacts-ug.h | 266 | ||||
-rwxr-xr-x | include/phone-ug.h | 171 |
2 files changed, 437 insertions, 0 deletions
diff --git a/include/contacts-ug.h b/include/contacts-ug.h new file mode 100755 index 0000000..78bd7e7 --- /dev/null +++ b/include/contacts-ug.h @@ -0,0 +1,266 @@ +/* +* 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 __CONTACTS_UG_H__ +#define __CONTACTS_UG_H__ + +/** + * @defgroup CONTACTS_UG Contacts UI-gadget + * @ingroup SLP_UG + * @addtogroup CONTACTS_UG + * @{ + * + * Contacts UI-gadget + * \n This header file contains the declaration & description for Contacts UG. + * + * @section Header To use Them: + * @code + * #include <contacts-ug.h> + * @endcode + * + * @section example Example: + * @code + #include <stdio.h> + #include <ui-gadget.h> + #include <contacts-ug.h> + + void contacts_detail_ug(int contact_id) + { + bundle *bd; + char buf[16]; + + bd = bundle_create(); + if(NULL == bd) { + ERR("bundle_create() Failed"); + return; + } + + snprintf(buf, sizeof(buf), "%d", CT_UG_REQUEST_DETAIL); + bundle_add(bd, CT_UG_BUNDLE_TYPE, buf); + snprintf(buf, sizeof(buf), "%d", contact_id); + bundle_add(bd, CT_UG_BUNDLE_ID, buf); + + cbs.layout_cb = ug_layout_cb; + cbs.result_cb = NULL; + cbs.destroy_cb = ug_destroy_cb; + + ug = ug_create(NULL, UG_CONTACTS_DETAILS, UG_MODE_FULLVIEW, bd, &cbs); + if(NULL == ug) + ERR("ug_create() Failed"); + + bundle_free(bd); + } + * @endcode + * + */ + +/** + * The name of details/new/edit UG + * @see #CT_UG_DETAILS_TYPES + */ +#define UG_CONTACTS_DETAILS "contacts-details-efl" + +/** + * The name of list UG + * @see #CT_UG_LIST_TYPES + */ +#define UG_CONTACTS_LIST "contacts-list-efl" + +/** + * The name of setting UG + */ +#define UG_CONTACTS_SETTINGS "contacts-settings-efl" + +/** + * types of #UG_CONTACTS_DETAILS + */ +enum CT_UG_DETAILS_TYPES{ + CT_UG_REQUEST_DETAIL = 0,/**< . */ + + CT_UG_REQUEST_EDIT = 11,/**< . */ + + CT_UG_REQUEST_ADD = 21,/**< . */ + CT_UG_REQUEST_ADD_WITH_NUM = 22,/**< . */ + CT_UG_REQUEST_ADD_WITH_EMAIL = 23,/**< . */ + CT_UG_REQUEST_ADD_WITH_WEB = 24,/**< . */ +}; + +/** + * types of #UG_CONTACTS_LIST + */ +enum CT_UG_LIST_TYPES{ + CT_UG_REQUEST_LIST = 0,/**< . */ + CT_UG_REQUEST_LIST_WITH_BACK = 1,/**< . */ + + CT_UG_REQUEST_SELECT_PERSON = 11,/**< . */ + CT_UG_REQUEST_SELECT_NUMBER = 12,/**< . */ + CT_UG_REQUEST_SELECT_EMAIL = 13,/**< . */ + CT_UG_REQUEST_SELECT_VCARD = 14,/**< . */ + CT_UG_REQUEST_SELECT_CONTACT_ADD_TO_HOME = 15,/**< . */ + CT_UG_REQUEST_SELECT_GROUP_ADD_TO_HOME = 16,/**< . */ + CT_UG_REQUEST_SELECT_NUMBER_OR_EMAIL = 17,/**< . */ + CT_UG_REQUEST_SELECT_GROUP = 18, /**< . */ + + CT_UG_REQUEST_UPDATE_CONTACT = 20,/**< . */ + CT_UG_REQUEST_UPDATE_WITH_NUM = 21,/**< . */ + CT_UG_REQUEST_UPDATE_WITH_EMAIL = 22,/**< . */ + CT_UG_REQUEST_UPDATE_WITH_WEB = 23,/**< . */ + + CT_UG_REQUEST_CHECK = 31,/**< . */ + CT_UG_REQUEST_CHECK_FOR_NUMBER = 32,/**< . */ + CT_UG_REQUEST_CHECK_FOR_EMAIL = 33,/**< . */ + CT_UG_REQUEST_CHECK_FOR_NUMBER_OR_EMAIL = 34,/**< . */ + + CT_UG_REQUEST_SAVE_IMG = 41,/**< . */ + CT_UG_REQUEST_SAVE_RINGTONE = 42,/**< . */ + + CT_UG_REQUEST_SHARE_CONTACT_INFO = 61,/**< . */ +}; + +#define CT_UG_BUNDLE_ACCOUNTID "account_id" +#define CT_UG_BUNDLE_PERSON_ID "ct_person_id" + +/** + * The key of request bundle for type. + * \n Value : convert id to string by using \%d. + */ +#define CT_UG_BUNDLE_TYPE "type" + +/** + * The key of request bundle for contact index + * \n Value : convert id to string by using \%d + * \n Use on #CT_UG_REQUEST_DETAIL, #CT_UG_REQUEST_EDIT + */ +#define CT_UG_BUNDLE_ID "person_id" + +/** + * The key of request bundle for vcard stream. + * \n Value : vcard stream.(It is not a filepath.) + * \n Use only on #CT_UG_REQUEST_ADD. + */ +#define CT_UG_BUNDLE_VCARD "ct_vcard" + +/** + * The key of request bundle for number + * \n Use on #CT_UG_REQUEST_ADD_WITH_NUM, #CT_UG_REQUEST_UPDATE_WITH_NUM + * \n Value : (string)number + */ +#define CT_UG_BUNDLE_NUM "ct_num" + +/** + * The key of request bundle for email + * \n Use on #CT_UG_REQUEST_ADD_WITH_EMAIL, #CT_UG_REQUEST_UPDATE_WITH_EMAIL + * \n (string)email address + */ +#define CT_UG_BUNDLE_EMAIL "ct_email" + +/** + * The key of request bundle for web + * \n Use on #CT_UG_REQUEST_ADD_WITH_WEB, #CT_UG_REQUEST_UPDATE_WITH_WEB + * \n Value : (string)web address + */ +#define CT_UG_BUNDLE_WEB "ct_web" + +/** + * The key of request bundle for path(ringtone or img) + * \n Use on #CT_UG_REQUEST_SAVE_IMG, #CT_UG_REQUEST_SAVE_RINGTONE + * \n Value : (string)absolutely path + */ +#define CT_UG_BUNDLE_PATH "ct_path" + +/** + * The key of request bundle for maximum number to select. + * \n Use on #CT_UG_REQUEST_CHECK + * \n Value : convert maximum number to string by using \%d (0 is ALL) + */ +#define CT_UG_BUNDLE_MAX "ct_max" + +/** + * The key of result bundle for contact index + * \n The contact index on #CT_UG_REQUEST_ADD , CT_UG_REQUEST_ADD_XXX + * \n The contact index on #CT_UG_REQUEST_SELECT_PERSON + * \n Value : convert id to integer by using atoi() + * \n Recommends to destroy Contacts UG at ug_cbs.destroy_cb.(not ug_cbs.result_cb) + * \n In ug_cbs.result_cb, ug_destroy() should not be called. + */ +#define CT_UG_BUNDLE_RESULT_PERSON_ID "person_id" + +/** + * The key of result bundle for the index of number value + * \n The number value index on #CT_UG_REQUEST_SELECT_NUMBER + * \n Value : convert id to integer by using atoi() + * \n Recommends to destroy Contacts UG at ug_cbs.destroy_cb.(not ug_cbs.result_cb) + * \n In ug_cbs.result_cb, ug_destroy() should not be called. + */ +#define CT_UG_BUNDLE_RESULT_NUMBER_ID "num_id" + +/** + * The key of result bundle for the index of email value + * \n The email value index on #CT_UG_REQUEST_SELECT_EMAIL + * \n Value : convert id to integer by using atoi() + * \n Recommends to destroy Contacts UG at ug_cbs.destroy_cb.(not ug_cbs.result_cb) + * \n In ug_cbs.result_cb, ug_destroy() should not be called. + */ +#define CT_UG_BUNDLE_RESULT_EMAIL_ID "email_id" + +/** + * The key of result bundle for the index of group value + * \n The group value index on #CT_UG_REQUEST_SELECT_GROUP + * \n Value : convert id to integer by using atoi() + * \n Recommends to destroy Contacts UG at ug_cbs.destroy_cb.(not ug_cbs.result_cb) + * \n In ug_cbs.result_cb, ug_destroy() should not be called. + */ +#define CT_UG_BUNDLE_RESULT_GROUP_ID "group_id" + +/** + * The key of result bundle for a list of contact index + * \n The contact index on #CT_UG_REQUEST_CHECK + * \n Value : convert string to a integer array by using g_base64_decode() + * \n Recommends to destroy Contacts 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 contacts_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, CT_UG_BUNDLE_RESULT_PERSON_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 CT_UG_BUNDLE_RESULT_PERSON_ID_LIST "person_id_list" +#define CT_UG_BUNDLE_RESULT_NUMBER_ID_LIST "num_id_list" +#define CT_UG_BUNDLE_RESULT_EMAIL_ID_LIST "email_id_list" +#define CT_UG_BUNDLE_RESULT_PERSON_INFO "person_info" +/** + * @} + */ + +#endif //__CONTACTS_UG_H__ 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__ |