summaryrefslogtreecommitdiff
path: root/include/phone-ug.h
blob: e608458d72126c2b4fc79721960781ec69affbd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
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__