26de5c589e23ca00eb8f06a24da3f553108c9f56
[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 <bundle.h>
31 #include <ui-gadget-module.h>
32 #include <package-manager.h>
33 #include <account.h>
34 #include <efl_assist.h>
35
36 #include "Eina.h"
37
38
39 #ifndef LOG_TAG
40 #define LOG_TAG "MYACCOUNT"
41 #endif
42
43 #include <dlog.h>
44
45
46 #ifdef __cplusplus
47 extern "C" {
48 #endif /* __cplusplus */
49
50
51 #ifndef PREFIX
52 #  define PREFIX "/usr"
53 #endif
54
55 #define MYACCOUNT_VERBOSE(fmt, arg...) \
56                 LOGD(": [%s (%d)]" fmt ,  __FUNCTION__, __LINE__, ##arg);
57 #define MYACCOUNT_DBUG(fmt, arg...) \
58                 LOGD(": [%s (%d)]" fmt ,  __FUNCTION__, __LINE__, ##arg);
59 #define MYACCOUNT_WARNING(fmt, arg...) \
60                 LOGW(": [%s (%d)]" fmt ,  __FUNCTION__, __LINE__, ##arg);
61 #define MYACCOUNT_ERROR(fmt, arg...) \
62                 LOGE(": [%s (%d)]" fmt ,  __FUNCTION__, __LINE__, ##arg);
63 #define MYACCOUNT_FATAL(fmt, arg...) \
64                 LOGF(": [%s (%d)]" fmt ,  __FUNCTION__, __LINE__, ##arg);
65
66 #define MYACCOUNT_SLOGD(fmt, arg...) \
67                 SECURE_LOGD(": [%s (%d)]" fmt ,  __FUNCTION__, __LINE__, ##arg);
68 #define MYACCOUNT_SLOGI(fmt, arg...) \
69                 SECURE_LOGD(": [%s (%d)]" fmt ,  __FUNCTION__, __LINE__, ##arg);
70 #define MYACCOUNT_SLOGE(fmt, arg...) \
71                 SECURE_LOGD(": [%s (%d)]" fmt ,  __FUNCTION__, __LINE__, ##arg);
72
73 #define _EDJ(obj) elm_layout_edje_get(obj)
74 /*#define dgettext_noop(s)      (s) */
75 /*#define N_(s)                 dgettext_noop(s)*/
76
77 #define PACKAGE "myaccount"
78 //#define LOCALEDIR PREFIX"/usr/ug/res/locale"
79
80 //#define IMAGE_PATH "/usr/ug/res/images/ug-setting-myaccount-efl"
81
82 #define TIZEN_EMAIL_CSC_FILE_PATH "/opt/system/csc-default/data/csc-default-data-email-account.ini"
83 #define TIZEN_EMAIL_CSC_SP_COUNT_KEY "email_account:count"
84 #define TIZEN_EMAIL_CSC_SP_NAME_PREFIX "email_account:name_"
85
86 /*#define MYACCOUNT_EDJ_PATH PREFIX"/share/edje/"*/
87 //#define MYACCOUNT_EDJ_PATH PREFIX"/usr/ug/res/edje/myaccount"
88 //#define MYACCOUNT_EDJ_NAME MYACCOUNT_EDJ_PATH"/myaccount.edj"
89 #define MYACCOUNT_GRP_MAIN "main"
90 #define SAMSUNG_ACCOUNT_APPID "gr47by21a5.SamsungAccount"
91 #define TIZEN_ACCOUNT_APPID "t5ek35st3l.TizenAccount"
92 #define TIZEN_EMAIL_APPID "email-setting-efl"
93 #define EXCHANGE_UI_APPID "activesync-ui"
94 #define GOOGLE_ACCOUNT_APPID "com.samsung.google-service-account"
95 #define DROPBOX_APPID "com.samsung.dropbox"
96
97 typedef enum {
98         eMYACCOUNT_ACCOUNT_LIST,
99         eMYACCOUNT_ADD_ACCOUNT,
100 } myaccount_mode_e;
101
102
103 typedef struct appdata {
104         Evas_Object *base;
105         ui_gadget_h ug;
106
107         Evas_Object *navi_bar;
108         Evas_Object *win_main;
109         Evas_Object *conformant;
110         Elm_Object_Item *navi_it;
111         myaccount_mode_e eMode;
112         Elm_Win_Indicator_Mode indi_mode;
113         Elm_Win_Indicator_Opacity_Mode indi_o_mode;
114         bool overlap_mode;
115
116         /* For accounts list*/
117         Evas_Object *layout_main;
118         Evas_Object *account_genlist;
119         Evas_Object *help_label;
120         Evas_Object *r_title_sk;
121         Evas_Object *modal_popup;
122         Ecore_Timer *progress_timer;
123         Evas_Object *auto_sync_check;
124         Evas_Object *refresh_btn;
125         Evas_Object *refresh_icon;
126         Evas_Object *cancel_sync_icon;
127         Elm_Object_Item *nf_it;
128         GList* account_info_list;
129         GList* sorted_account_list;
130
131         Evas_Object *bg;
132         Elm_Theme* theme;
133         /* For addaccount view*/
134         Evas_Object *layout_addaccount;
135         Evas_Object *ly;
136         Evas_Object *add_genlist;
137         bool item_selected_state;
138         GList* sorted_sp_list;
139         Elm_Object_Item *add_nf_it;
140         int prev_app_cnt;
141
142         /* to hold info about key lock*/
143         int lock_priv_state;
144         int lock_curr_state;
145         ui_gadget_h ug_called;
146         Ecore_X_Window win_id;
147
148         /* For application launch */
149         Ecore_Timer *relaunch_timer;
150         app_control_h appsvc_handle;
151
152         /* to block fast double-click */
153         Ecore_Timer *clickblock_timer;
154
155         /* languuage state */
156         char* current_language;
157
158         /*package manager client handle */
159         pkgmgr_client *pc;
160
161         /* extra data from ug caller */
162         char *capability_filter;
163         char *caller_userdata;
164         char *called_from;
165         account_subscribe_h account_subscribe;
166
167         Ea_Theme_Color_Table *color_table;
168         Eina_List *font_table;
169         Evas_Object *popup;
170 }myaccount_appdata;
171
172 int myaccount_account_info_update(struct appdata *ad);
173 void myaccount_destroy_data();
174 #ifdef __cplusplus
175 }
176 #endif /* __cplusplus */
177
178
179 #endif /* _MYACCOUNT_H_ */
180