summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSunggoo Kim <sung.goo.kim@samsung.com>2012-08-21 18:17:42 +0900
committerSunggoo Kim <sung.goo.kim@samsung.com>2012-08-21 18:17:42 +0900
commit41b2478dc578156bb904201f8f6e2d9d35c26f9f (patch)
tree88f4757f2e2bf498b67889f0901bf9f0fcb13057 /include
parente9d80f84b140bb86fe9e7bc025ec1de25f6b1cad (diff)
downloadphone-contacts-41b2478dc578156bb904201f8f6e2d9d35c26f9f.tar.gz
phone-contacts-41b2478dc578156bb904201f8f6e2d9d35c26f9f.tar.bz2
phone-contacts-41b2478dc578156bb904201f8f6e2d9d35c26f9f.zip
migration
Diffstat (limited to 'include')
-rwxr-xr-xinclude/contacts-ug.h249
-rwxr-xr-xinclude/phone-ug.h26
-rwxr-xr-xinclude/phone.h56
3 files changed, 288 insertions, 43 deletions
diff --git a/include/contacts-ug.h b/include/contacts-ug.h
new file mode 100755
index 0000000..3394159
--- /dev/null
+++ b/include/contacts-ug.h
@@ -0,0 +1,249 @@
+/*
+ * 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://www.tizenopensource.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_CONTACT = 11,/**< . */
+ CT_UG_REQUEST_SELECT_NUMBER = 12,/**< . */
+ CT_UG_REQUEST_SELECT_EMAIL = 13,/**< . */
+ CT_UG_REQUEST_SELECT_VCARD = 14,/**< . */
+
+ 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_SAVE_IMG = 41,/**< . */
+ CT_UG_REQUEST_SAVE_RINGTONE = 42,/**< . */
+};
+
+#define CT_UG_BUNDLE_ACCOUNTID "account_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 "ct_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_CONTACT
+ * \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_CONTACT_ID "ct_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 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_CONTACT_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_CONTACT_ID_LIST "ct_id_list"
+#define CT_UG_BUNDLE_RESULT_NUMBER_ID_LIST "num_id_list"
+#define CT_UG_BUNDLE_RESULT_EMAIL_ID_LIST "email_id_list"
+
+/**
+ * @}
+ */
+
+#endif //__CONTACTS_UG_H__
diff --git a/include/phone-ug.h b/include/phone-ug.h
index c145474..d72abfe 100755
--- a/include/phone-ug.h
+++ b/include/phone-ug.h
@@ -81,6 +81,32 @@
*/
#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_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_LAUNCH_VOICECALL = 51,/**< . */
+};
+
+/**
+ * The name of speeddial UG
+ */
+#define UG_SPEEDDIAL_LOG "speeddial-efl"
+
/**
* types of #PH_UG_LOG_TYPES
diff --git a/include/phone.h b/include/phone.h
index 6674091..1d6e917 100755
--- a/include/phone.h
+++ b/include/phone.h
@@ -27,6 +27,8 @@
# define PACKAGE "phone"
#endif
+#define PHONE_PKG "org.tizen.phone"
+
#define _EDJ(obj) (Evas_Object *)elm_layout_edje_get(obj)
#define PH_DLOG_OUT
@@ -38,8 +40,8 @@
#define DLOG(prio, fmt, arg...) \
do { SLOG(prio, LOG_TAG, fmt, ##arg); } while (0)
#define INFO(fmt, arg...) SLOGI(fmt, ##arg)
-#define ERR(fmt, arg...) SLOGE("%s:" fmt, __FUNCTION__, ##arg)
-#define DBG(fmt, arg...) SLOGD("%s:" fmt, __FUNCTION__, ##arg)
+#define ERR(fmt, arg...) SLOGE("%s[%d]:" fmt, __FUNCTION__, __LINE__, ##arg)
+#define DBG(fmt, arg...) SLOGD("%s[%d]:" fmt, __FUNCTION__, __LINE__, ##arg)
#else //PH_DLOG_OUT
#define PRT(prio, fmt, arg...) \
do { fprintf((prio?stderr:stdout), "[Phone]" fmt"\n", ##arg); } while (0)
@@ -52,45 +54,14 @@
#endif //PH_DLOG_OUT
#ifdef PH_DEBUGGING
-#define PH_FN_CALL DBG(">>>>>>>>%s called", __FUNCTION__)
-#define PH_FN_END DBG("<<<<<<<<%s ended", __FUNCTION__)
-#define PH_DBG DBG
-#define p_warn_if(expr, fmt, arg...) do { \
- if (expr) { \
- DBG("(%s) -> "fmt, #expr, ##arg); \
- } \
-} while (0)
-#define p_ret_if(expr) do { \
- if (expr) { \
- DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
- return; \
- } \
-} while (0)
-#define p_retv_if(expr, val) do { \
- if (expr) { \
- DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
- return (val); \
- } \
-} while (0)
-#define p_retm_if(expr, fmt, arg...) do { \
- if (expr) { \
- ERR(fmt, ##arg); \
- DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
- return; \
- } \
-} while (0)
-#define p_retvm_if(expr, val, fmt, arg...) do { \
- if (expr) { \
- ERR(fmt, ##arg); \
- DBG("(%s) -> %s() return", #expr, __FUNCTION__); \
- return (val); \
- } \
-} while (0)
-#else //PH_DEBUGGING
+#define PH_FN_CALL DBG(">>>>>>>> called")
+#define PH_FN_END DBG("<<<<<<<< ended")
+#define PH_DBG(fmt, arg...) DBG(fmt, ##arg)
+#else /* PH_DEBUGGING */
#define PH_FN_CALL
#define PH_FN_END
-//#define PH_DBG DBG
#define PH_DBG(...)
+#endif /* PH_DEBUGGING */
#define p_warn_if(expr, fmt, arg...) do { \
if (expr) { \
@@ -99,11 +70,13 @@
} while (0)
#define p_ret_if(expr) do { \
if (expr) { \
+ ERR("(%s)", #expr); \
return; \
} \
} while (0)
#define p_retv_if(expr, val) do { \
if (expr) { \
+ ERR("(%s)", #expr); \
return (val); \
} \
} while (0)
@@ -120,12 +93,9 @@
} \
} while (0)
-#endif //PH_DEBUGGING
-
#define SAFE_STR(src) (src)?src:""
-#define STR_BLANK(src) (src)?" ":"", SAFE_STR(src)
-
-#define SAFE_STRDUP(src) (NULL != src)?strdup(src):NULL
+#define STR_BLANK(str, src) (str && src)?" ":"", SAFE_STR(src)
+#define SAFE_STRDUP(src) (src)?strdup(src):NULL
#define FREEandSTRDUP(dest, src) \
do{ \
free(dest); dest=NULL;\