tizen 2.4 release
[apps/home/my-account.git] / include / myaccount_ug.h
1 /*
2  *  my-account
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Wonyoung Lee <wy1115.lee@samsung.com>, Tarun Kumar <tarun.kr@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #ifndef _MYACCOUNT_H_
23 #define _MYACCOUNT_H_
24
25
26 #include <glib.h>
27 #include <Elementary.h>
28 #include <stdio.h>
29 #include <vconf-keys.h>
30 #include <ui-gadget-module.h>
31 #include <package-manager.h>
32 #include <account.h>
33 #include <efl_extension.h>
34
35 #include "Eina.h"
36
37
38 #ifndef LOG_TAG
39 #define LOG_TAG "MYACCOUNT"
40 #endif
41
42 #include <dlog.h>
43
44
45 #ifdef __cplusplus
46 extern "C" {
47 #endif /* __cplusplus */
48
49
50 #ifndef PREFIX
51 #  define PREFIX "/usr"
52 #endif
53
54 #define MYACCOUNT_VERBOSE(fmt, arg...) \
55                 LOGD(": [%s (%d)]" fmt ,  __FUNCTION__, __LINE__, ##arg);
56 #define MYACCOUNT_DBUG(fmt, arg...) \
57                 LOGD(": [%s (%d)]" fmt ,  __FUNCTION__, __LINE__, ##arg);
58 #define MYACCOUNT_WARNING(fmt, arg...) \
59                 LOGW(": [%s (%d)]" fmt ,  __FUNCTION__, __LINE__, ##arg);
60 #define MYACCOUNT_ERROR(fmt, arg...) \
61                 LOGE(": [%s (%d)]" fmt ,  __FUNCTION__, __LINE__, ##arg);
62 #define MYACCOUNT_FATAL(fmt, arg...) \
63                 LOGF(": [%s (%d)]" fmt ,  __FUNCTION__, __LINE__, ##arg);
64
65 #define MYACCOUNT_SLOGD(fmt, arg...) \
66                 SECURE_LOGD(": [%s (%d)]" fmt ,  __FUNCTION__, __LINE__, ##arg);
67 #define MYACCOUNT_SLOGI(fmt, arg...) \
68                 SECURE_LOGD(": [%s (%d)]" fmt ,  __FUNCTION__, __LINE__, ##arg);
69 #define MYACCOUNT_SLOGE(fmt, arg...) \
70                 SECURE_LOGD(": [%s (%d)]" fmt ,  __FUNCTION__, __LINE__, ##arg);
71
72 #define _EDJ(obj) elm_layout_edje_get(obj)
73 /*#define dgettext_noop(s)      (s) */
74 /*#define N_(s)                 dgettext_noop(s)*/
75
76 #define PACKAGE "myaccount"
77 //#define LOCALEDIR PREFIX"/usr/ug/res/locale"
78
79 //#define IMAGE_PATH "/usr/ug/res/images/ug-setting-myaccount-efl"
80
81 #define TIZEN_EMAIL_CSC_FILE_PATH "/opt/system/csc-default/data/csc-default-data-email-account.ini"
82 #define TIZEN_EMAIL_CSC_SP_COUNT_KEY "email_account:count"
83 #define TIZEN_EMAIL_CSC_SP_NAME_PREFIX "email_account:name_"
84
85 /*#define MYACCOUNT_EDJ_PATH PREFIX"/share/edje/"*/
86 //#define MYACCOUNT_EDJ_PATH PREFIX"/usr/ug/res/edje/myaccount"
87 //#define MYACCOUNT_EDJ_NAME MYACCOUNT_EDJ_PATH"/myaccount.edj"
88 #define MYACCOUNT_GRP_MAIN "main"
89 #define SAMSUNG_ACCOUNT_APPID "gr47by21a5.SamsungAccount"
90 #define TIZEN_ACCOUNT_APPID "t5ek35st3l.TizenAccount"
91 #define TIZEN_EMAIL_APPID "email-setting-efl"
92 #define EXCHANGE_UI_APPID "activesync-ui"
93 #define GOOGLE_ACCOUNT_APPID "com.samsung.google-service-account"
94 #define DROPBOX_APPID "com.samsung.dropbox"
95
96 typedef enum {
97         eMYACCOUNT_ACCOUNT_LIST,
98         eMYACCOUNT_ADD_ACCOUNT,
99 } myaccount_mode_e;
100
101
102 typedef struct appdata {
103         Evas_Object *base;
104         ui_gadget_h ug;
105
106         Evas_Object *navi_bar;
107         Evas_Object *win_main;
108         Evas_Object *conformant;
109         Elm_Object_Item *navi_it;
110         myaccount_mode_e eMode;
111         Elm_Win_Indicator_Mode indi_mode;
112         Elm_Win_Indicator_Opacity_Mode indi_o_mode;
113         bool overlap_mode;
114
115         /* For accounts list*/
116         Evas_Object *layout_main;
117         Evas_Object *account_genlist;
118         Evas_Object *help_label;
119         Evas_Object *r_title_sk;
120         Evas_Object *modal_popup;
121         Ecore_Timer *progress_timer;
122         Evas_Object *auto_sync_check;
123         Evas_Object *refresh_btn;
124         Evas_Object *refresh_icon;
125         Evas_Object *cancel_sync_icon;
126         Elm_Object_Item *nf_it;
127         GList* account_info_list;
128         GList* sorted_account_list;
129
130         Evas_Object *bg;
131         Elm_Theme* theme;
132         /* For addaccount view*/
133         Evas_Object *layout_addaccount;
134         Evas_Object *ly;
135         Evas_Object *add_genlist;
136         bool item_selected_state;
137         GList* sorted_sp_list;
138         Elm_Object_Item *add_nf_it;
139         int prev_app_cnt;
140
141         /* to hold info about key lock*/
142         int lock_priv_state;
143         int lock_curr_state;
144         ui_gadget_h ug_called;
145         Ecore_X_Window win_id;
146
147         /* For application launch */
148         Ecore_Timer *relaunch_timer;
149         app_control_h appsvc_handle;
150
151         /* to block fast double-click */
152         Ecore_Timer *clickblock_timer;
153
154         /* languuage state */
155         char* current_language;
156
157         /*package manager client handle */
158         pkgmgr_client *pc;
159
160         /* extra data from ug caller */
161         char *capability_filter;
162         char *caller_userdata;
163         char *called_from;
164         account_subscribe_h account_subscribe;
165
166         Evas_Object *popup;
167 }myaccount_appdata;
168
169 int myaccount_account_info_update(struct appdata *ad);
170 void myaccount_destroy_data();
171 #ifdef __cplusplus
172 }
173 #endif /* __cplusplus */
174
175
176 #endif /* _MYACCOUNT_H_ */
177