Tizen 2.1 base
[apps/core/preloaded/my-account.git] / include / myaccount_ug_common.h
1 /*\r
2  * Copyright 2012  Samsung Electronics Co., Ltd\r
3  *\r
4  * Licensed under the Flora License, Version 1.0 (the License);\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  * http://floralicense.org/license/\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an AS IS BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 \r
17 #ifndef _MYACCOUNT_UG_COMMON_H_\r
18 #define _MYACCOUNT_UG_COMMON_H_\r
19 \r
20 #include <Ecore_X.h>\r
21 #include <Evas.h>\r
22 #include <account.h>\r
23 #include <app.h>\r
24 #include <app_manager.h>\r
25 #include <vconf.h>\r
26 #include <package-manager.h>\r
27 \r
28 #define ENABLE_NOTI\r
29 \r
30 typedef enum {\r
31         MYACCOUNT_TYPE_ANONYMOUS,\r
32         MYACCOUNT_TYPE_OTHER\r
33 }MyAccountProviderType;\r
34 \r
35 typedef enum {\r
36         MYACCOUNT_REQUEST_SIGNIN = 0,\r
37         MYACCOUNT_REQUEST_VIEW\r
38 }MyAccountRequestViewType;\r
39 \r
40 void *myaccount_init_appdata();\r
41 \r
42 void myaccount_destroy_appdata();\r
43 \r
44 void *myaccount_get_appdata();\r
45 \r
46 void myaccount_common_get_icon_by_name(char *account_name,\r
47                                                                                         char *icon_path);\r
48 \r
49 void myaccount_common_lowercase(char* src, char* dest);\r
50 \r
51 Evas_Object *myaccount_common_progress_add(Evas_Object *parent);\r
52 \r
53 Evas_Object *myaccount_common_create_modal_popup(Evas_Object *parent);\r
54 \r
55 void myaccount_common_delete_modal_popup(Evas_Object *popup);\r
56 \r
57 Eina_Bool myaccount_common_modal_popup_timer_cb(gpointer data);\r
58 \r
59 bool myaccount_samsung_callback(char* result_code, char* user_id, void *user_data);\r
60 \r
61 \r
62 int myaccount_common_launch_application(MyAccountRequestViewType\r
63                                                                                                         request_type,\r
64                                                                                                         char *package_name,\r
65                                                                                                         char *username,\r
66                                                                                                         char *email_sp,\r
67                                                                                                         int account_id,\r
68                                                                                                         void *data );\r
69 \r
70 int myaccount_common_get_all_account_cnt(int *count);\r
71 \r
72 void myaccount_common_handle_notification();\r
73 \r
74 void myaccount_common_vconf_notification_cb(keynode_t *key, void *user_data);\r
75 \r
76 void myaccount_common_listen_pkgmgr_for_pkg_uninstall();\r
77 \r
78 #define MA_UG_NAME "ug-setting-myaccount-efl"\r
79 \r
80 #define MA_IMAGE_EDJ_NAME "/usr/ug/res/edje/ug-setting-myaccount-efl/myaccount_edc_images.edj"\r
81 \r
82 #define BUFSIZE 1024\r
83 \r
84 #define MA_SNPRINTF(dest,size,format,arg...)    \\r
85         do { \\r
86                         snprintf(dest,size-1,format,##arg); \\r
87         }while(0)\r
88         /*      If the same pointer is passed to free twice,    known as a double free. To avoid this, set pointers to\r
89 NULL after passing      them to free: free(NULL) is safe (it does nothing).\r
90          */\r
91 \r
92 #define MA_STRNCPY(dest,src,size)       \\r
93                 do { \\r
94                         if(src != NULL && dest != NULL && size > 0) \\r
95                         {       \\r
96                                 strncpy(dest,src,size-1); \\r
97                         }       \\r
98                 }while(0);\r
99 \r
100 #define MA_MEMFREE(ptr) \\r
101                 if (ptr != NULL) {      \\r
102                         free(ptr);      \\r
103                         ptr = NULL; \\r
104                 }       \\r
105 \r
106 #endif /* _MYACCOUNT_UG_COMMON_H_ */\r
107 \r