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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
|
/*
* Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
*
* This file is part of ug-contacts-efl
*
* Written by Youngjae Shin <yj99.shin@samsung.com>
* Donghee Ye <donghee.ye@samsung.com>
* Sunggoo Kim <sung.goo.kim@samsung.com>
*
* PROPRIETARY/CONFIDENTIAL
*
* This software is the confidential and proprietary information of
* SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered
* into with SAMSUNG ELECTRONICS.
* SAMSUNG make no representations or warranties about the suitability
* of the software, either express or implied, including but not limited
* to the implied warranties of merchantability, fitness for a particular
* purpose, or non-infringement. SAMSUNG shall not be liable for any
* damages suffered by licensee as a result of using, modifying or
* distributing this software or its derivatives.
*
*/
#ifndef __CONTACTS_COMMON_H__
#define __CONTACTS_COMMON_H__
#include <time.h>
#include <libintl.h>
#include <ui-gadget.h>
#include <contacts-svc.h>
#include <unicode/udat.h>
#include "contacts-ug.h"
#include "ct-path.h"
#define CT_TIMECHECK
#ifdef CT_TIMECHECK
double ct_correction, ct_startT;
double ct_set_start_time(void);
double ct_exec_time(double start);
int ct_init_time(void);
#define CT_TIME_CHECK \
DBG("time = %f ms\n", ct_set_start_time());
#define CT_START_TIME_CHECK \
ct_init_time();\
ct_startT = ct_set_start_time();
#define CT_END_TIME_CHECK(fmt, arg...) \
DBG(fmt" time = %f ms\n", ##arg, ct_exec_time(ct_startT));
#else //CT_TIMECHECK
#define CT_START_TIME_CHECK
#define CT_END_TIME_CHECK(arg)
#endif //CT_TIMECHECK
#if !defined(LOCALEDIR)
# define LOCALEDIR "/opt/ug/res/locale"
#endif
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
typedef void* PTHREAD_FN;
typedef struct {
int position;
int skipped_count;
char index[4];
char prev_index[4];
Elm_Object_Item *item;
} ct_list_index_data;
typedef struct {
int cnt;
int cnt_loop;
int cnt_checked_total;
int result;
bool alive;
bool completed;
pthread_t thread;
Ecore_Timer *timer;
Evas_Object *progressbar;
Evas_Object *layout;
} ct_progress_info;
typedef struct {
void *user_data;
Evas_Smart_Cb cb;
char *icon_path;
} ctr_btn_info;
typedef struct {
Evas_Object *win;
Evas_Object *navi;
Evas_Object *popup;
Evas_Object *genlist;
Elm_Object_Item *navi_it;
Elm_Object_Item *btn_op;
int count;
int grp_id;
int base_ab;
char *name_old;
bool is_rename;
bool is_move_copy_view;
ctr_btn_info ctr_btn_info;
} ct_group_edit_data;
typedef struct {
Evas_Object *win;
Evas_Object *box;
Evas_Object *cbar;
Evas_Object *navi;
Evas_Object *content;
Elm_Object_Item *navi_item;
Evas_Object *layout;
Evas_Object *popup;
int ug_request;
char *title;
const char *ug_data;
struct ui_gadget *ug;
Elm_Theme *th;
bool is_background;
cts_order_type order_sorting;
cts_order_type order_display;
Evas_Object *fast_index;
Evas_Object *genlist;
int list_op;
int base_ab;
int base_ab_mode;
int base_grp;
int readed_n;
Eina_List *list;
Eina_List *list_sdn;
Ecore_Idler *list_idler;
Ecore_Timer *update_timer;
ct_list_index_data *list_skipped_index;
Evas_Object *searchbar;
char *search_str;
char *search_normalize;
Evas_Object *select_all_checkbox;
int list_mode;
int edit_op;
int cnt_total;
int cnt_checked;
int cnt_list;
int cnt_max;
int selected_contact;
Eina_Bool select_all_checked;
ct_progress_info *p_info;
ct_group_edit_data *cgedit_d;
}ct_list_data;
typedef struct {
Evas_Object *win;
Evas_Object *navi;
Evas_Object *base;
Evas_Object *genlist;
GSList *expand_ab;
ct_list_data *clist_d;
} ct_group_data;
typedef struct {
Evas_Object *win;
Evas_Object *base;
Evas_Object *navi;
Elm_Object_Item *navi_item;
Elm_Object_Item *prev_navi_item;
Evas_Object *popup;
Evas_Object *genlist;
cts_order_type order_display;
bool is_shortcut;
bool has_detail;
bool has_input;
int touch_x;
int touch_y;
int base_grp;
int base_ab;
int base_ab_mode;
char *base_ab_name;
int contact_id;
char* vcard;
struct ui_gadget *ug;
int view_creat_ver;
CTSstruct *contact;
ct_list_data *clist_d;
UDateFormat* formatter;
}ct_detail_data;
typedef struct {
Evas_Object *box;
Evas_Object *scroller;
Elm_Object_Item *pre_item;
Evas_Object *ly_baseinfo;
Evas_Object *ly_baseinfo_middle;
Evas_Object *ly_baseinfo_suffix;
Evas_Object *ly_baseinfo_nick;
Evas_Object *ly_baseinfo_company;
Evas_Object *ly_number_first;
Evas_Object *ly_number_last;
Evas_Object *ly_number_default;
Evas_Object *ly_number_set_default;
Evas_Object *ly_number_set_default_separator;
Evas_Object *ly_email_first;
Evas_Object *ly_email_last;
Evas_Object *ly_addr_first;
Evas_Object *ly_addr_last;
Evas_Object *ly_group;
Evas_Object *ly_addrbook;
Evas_Object *ly_birthday;
bool saved;
int view_create_ver;
int cnt_addr;
int cnt_num;
int idx_append;
int contact_id;
CTSstruct *contact;
ct_detail_data *cdetail_d;
struct ui_gadget *src_ug;
struct ui_gadget *crop_ug;
}ct_input_data;
typedef struct {
Evas_Object *ly_main;
Evas_Object *ly_content;
CTSvalue *value;
Evas_Object *data;
}ct_input_typed_data;
typedef struct {
Evas_Object *navi_content;
Evas_Object *genlist;
ct_input_data *cinput_d;
}ct_assign_group_data;
typedef struct {
Evas_Object *navi;
Evas_Object *popup;
Evas_Object *notify;
Evas_Object *radio_grp;
Evas_Object *genlist;
Evas_Object *select_all_check;
Eina_Bool select_all_checked;
int id_ab;
int mode;
char *path;
char *name_ab;
struct ui_gadget *ug;
Eina_List *list_id_ab;
ct_progress_info *p_info;
}ct_setting_data;
typedef struct {
int id;
int type;
int mode;
char *name;
Eina_Bool checked;
Elm_Object_Item *item;
} ct_ab_popup_data;
// for removing build warning ////////////////////////////////////
char* contacts_svc_value_steal_str(CTSvalue* value, int field);
////////////////////////////////////////////////////////
enum {
CT_VIEW_DETAIL,
CT_VIEW_INPUT,
CT_VIEW_ETC,
};
const char* ctui_get_default_contact_img(int view_type);
int ctui_get_display_name(CTSvalue *name, char *dest, int dest_len);
void ctui_get_number_type_str(int cts_num_type, char *dest, int dest_len);
Evas_Object* ctui_create_base_layout(Evas_Object *parent, bool is_fullview);
Evas_Object* ctui_create_popup(Evas_Object *parent, const char *desc, double timeout);
Evas_Object* ctui_progressbar_popup(Evas_Object *parent, ct_progress_info *p_info, const char *title);
void ctui_progress_popup_hide_cb(void *data, Evas_Object *obj, void *event_info);
void ctui_ld_to_dd(ct_list_data *clist_d, ct_detail_data *cdetail_d);
void ctui_ug_layout_cb(struct ui_gadget *ug, enum ug_mode mode, void *priv);
void ctui_ug_destroy_cb(struct ui_gadget *ug, void *priv);
void ctui_ug_destroy_me_cb(void *data, Evas_Object *obj, void *event_info);
void ctui_ug_return_id(struct ui_gadget *ug, int ct_id, int num_id, int email_id);
enum {
CTUG_MSG_INVALID = 0,
CTUG_MSG_KEY_END = 1,
};
void ctui_msg_ug(struct ui_gadget *parent, const char *number, const int idx, const char *attach);
void ctui_voice_call(const int id, const char* number);
Evas_Object* ctui_new_confirm_popup(Evas_Object *win, const char* description);
Evas_Object* ctui_naviframe_btn(Evas_Object *parent, const char *label);
Evas_Object* ctui_addrbook_popup(Evas_Object *parent, Evas_Smart_Cb gl_sel_cb,
void *data, int mode_filter, Evas_Smart_Cb response_cb, void *response_cb_data);
void ctui_cbar_item_clear(Evas_Object *toolbar);
void ctui_entry_limit_size_set(Evas_Object *entry);
Evas_Object* ctui_create_btn(Evas_Object *parent, const char *label);
void ctui_genlist_append_separator_10px(Evas_Object *genlist);
void ctui_genlist_append_separator_20px(Evas_Object *genlist);
void ctui_cbar_btn_disabled_set(Evas_Object *cbar, Eina_Bool disabled);
char* ctui_entry_markup_to_utf8(const char *s);
void ctui_entry_entry_set(Evas_Object *entry, const char *s);
Evas_Object* ctui_create_notify(Evas_Object *parent);
Evas_Object* ctui_show_notify(Evas_Object *parent, const char *msg, double timeout);
void ctui_hide_notify(Evas_Object *parent);
Evas_Object* ctui_set_bg(Evas_Object *parent);
void ctui_back_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info);
void ctui_list_detail_genlist_append_separator_line_20px(Evas_Object *genlist);
Evas_Object* ctui_create_nocontents(Evas_Object *parent, const char* label);
Evas_Object* ctui_create_popup_button(Evas_Object *popup, int index, const char* label, Evas_Smart_Cb cb, void *cb_data);
Evas_Object* ctui_create_editfield(Evas_Object *parent, const char *title, const char *guide, bool multiline);
void ct_toolbar_disalbed_item_append(Evas_Object *toolbar, int cnt);
void ctui_list_ug_hide_cb(void *data, Evas_Object *obj, void *event_info);
enum {
CTTEXT_TYPE_MOBILE,
CTTEXT_TYPE_TELEPHONE,
CTTEXT_TYPE_FAX,
CTTEXT_TYPE_OTHER,
CTTEXT_TYPE_HOME,
CTTEXT_TYPE_WORK,
CTTEXT_TYPE_CAR,
CTTEXT_TYPE_PAGER,
CTTEXT_TYPE_ASSISTANT,
}; //CT_GET_TEXT_NUM_TYPE
enum {
CTTEXT_ALL_CONTACTS,
CTTEXT_NOT_ASSIGNED,
CTTEXT_SDN,
CTTEXT_PHONE,
CTTEXT_GROUP,
CTTEXT_DEFAULT,
CTTEXT_RINGTONE,
CTTEXT_WEBSITE,
CTTEXT_INSTANT_MESSENGER,
CTTEXT_EMAIL,
CTTEXT_NUMBER,
CTTEXT_NOTE,
CTTEXT_POSTAL_ADDRESS,
CTTEXT_DETAILS,
CTTEXT_COMPANY,
CTTEXT_BIRTHDAY,
CTTEXT_ADDED_TO_HOME,
CTTEXT_ORDER_DISPLAY_NAME,
CTTEXT_OWN_NUMBER,
CTTEXT_FIRSTNAME,
CTTEXT_LASTNAME,
CTTEXT_MIDDLE,
CTTEXT_SUFFIX,
CTTEXT_NICKNAME,
CTTEXT_REMOVE_GROUP_ONLY,
CTTEXT_REMOVE_GROUP_WITH_MEMBER,
CTTEXT_SELECT_EXPORT_ADDRBOOK,
CTTEXT_IMPORT_CONTACT_TO,
CTTEXT_SELECT_CONTACTS,
CTTEXT_POSTAL_CODE,
CTTEXT_COUNTRY,
CTTEXT_PROVINCE,
CTTEXT_CITY,
CTTEXT_STREET,
CTTEXT_SAVED_IN,
CTTEXT_COPIED,
CTTEXT_EXPORTED,
CTTEXT_DELETING_CONTACTS,
CTTEXT_MOVING_CONTACTS,
CTTEXT_COPYING_CONTACTS,
CTTEXT_IMPORTING_SIM_CONTACTS,
CTTEXT_IMPORTING_SD_CONTACTS,
CTTEXT_BACKUP_CONTACTS_TO,
CTTEXT_IMPORTED,
CTTEXT_NA,
CTTEXT_NO_SIM,
}; //CT_GET_TEXT_BASIC
enum {
CTTEXT_NONAME,
CTTEXT_INVALID_EMAIL,
CTTEXT_SAVE_FAIL,
CTTEXT_ERR_DB_LOCKED,
CTTEXT_ADD_FAIL_EXIST,
CTTEXT_ALREADY_EXIST,
CTTEXT_NO_GROUP,
CTTEXT_NO_NUMBER,
CTTEXT_NO_EMAIL,
CTTEXT_NO_CONTACTS,
CTTEXT_IMPORT_SIM_NO_DATA,
CTTEXT_EXCEED_LIMIT,
CTTEXT_INITIALISING_TRY_LATER_ING,
CTTEXT_DATA_NOT_EXIST,
CTTEXT_INVALID_NUMBER,
};//CT_GET_TEXT_ERR
enum {
CTTEXT_SET_DEFAULT_NUM,
CTTEXT_IMAGE,
CTTEXT_TAKE_A_PHOTO,
CTTEXT_DELETE_PHOTO,
CTTEXT_ADD_TO_HOME,
CTTEXT_SAVE_CONTACT_TO,
CTTEXT_IMPORT_SIM_CONTACTS,
CTTEXT_FIRSTLAST,
CTTEXT_LASTFIRST,
CTTEXT_SEND_NAME_CARD,
CTTEXT_CONFIRM_DELETE_CONTACT,
CTTEXT_NEW_GROUP,
CTTEXT_SELECT_GROUP,
CTTEXT_EXPORT_CONTACTS,
CTTEXT_IMPORT_CONTACTS,
}; //CT_GET_TEXT_BASE_OP
enum {
CT_GET_TEXT_BASIC,
CT_GET_TEXT_ERR,
CT_GET_TEXT_BASE_OP,
CT_GET_TEXT_NUM_TYPE,
CT_GET_TEXT_EMAIL_TYPE,
CT_GET_TEXT_POSTAL_TYPE,
CT_GET_TEXT_EVENT_TYPE,
CT_GET_TEXT_IM_TYPE,
CT_GET_TEXT_MONTH,
CT_GET_TEXT_ACC_TYPE,
};
const char* ctui_get_text(int op, int type);
#define T_(op, type) ctui_get_text(op, type)
enum {
CT_SYS_SK_OK,
CT_SYS_SK_SAVE,
CT_SYS_SK_EDIT,
CT_SYS_SK_DONE,
CT_SYS_SK_DELETE,
CT_SYS_SK_CANCEL,
CT_SYS_BODY_CREATE,
CT_SYS_BODY_MOVE,
CT_SYS_BODY_COPY,
CT_SYS_BODY_CALL,
CT_SYS_BODY_MESSAGE,
CT_SYS_BODY_VIDEO_CALL,
CT_SYS_BODY_UNKNOWN,
CT_SYS_BODY_PHONE,
CT_SYS_BODY_SELECT_ALL,
CT_SYS_BODY_SEARCH,
CT_SYS_BODY_BLUETOOTH,
CT_SYS_BODY_EMAIL,
CT_SYS_BODY_CONTACTS,
CT_SYS_POP_SELECTED,
CT_SYS_POP_SUCCESS,
CT_SYS_POP_FAILED,
CT_SYS_POP_CLOSE,
CT_SYS_POP_ERROR,
CT_SYS_POP_DELETED,
CT_SYS_POP_REMOVED,
CT_SYS_POP_MOVED,
CT_SYS_POP_ADDED,
CT_SYS_POP_NOT_ENOUGH_MEMORY,
CT_SYS_POP_FILE_NOT_FOUND,
};
const char* ctui_get_system_string(int type);
#define S_(text) ctui_get_system_string(text)
#endif //__CONTACTS_COMMON_H__
|