Fix city list too large prblem
[apps/home/libug-worldclock-efl.git] / include / worldclock.h
1 /*
2 *
3 * Copyright 2012  Samsung Electronics Co., Ltd
4 *
5 * Licensed under the Flora License, Version 1.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 *    http://www.tizenopensource.org/license
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 */
18
19 #ifndef __DEF_WORLDCLOCK_H__
20 #define __DEF_WORLDCLOCK_H__
21
22 #include <Elementary.h>
23 #include <utilX.h>
24 #include <Ecore_IMF.h>
25 #include <ui-gadget.h>
26
27 #include "worldclock_const.h"
28 #include "worldclock_types.h"
29
30 typedef enum {
31         WCL_PAGE_MAIN = 0x01,
32         WCL_PAGE_DEL,
33         WCL_PAGE_ADD,
34         WCL_PAGE_DETAIL,
35         WCL_PAGE_MAX,
36 } WCL_PAGE_TYPE;
37
38 struct appdata {
39         int root_w;
40         int root_h;
41         int root_x;
42         int root_y;
43
44         //the caller
45         Wcl_Caller caller;
46         //the selection flag
47         Wcl_Selection_Flag selectionFlag;
48
49         //For strore added city list
50         Eina_List *eina_list;
51         //For store the default country list
52         Eina_List *default_list;
53
54         /* Add city List */
55         //For save current search content
56         char search_text[BUF_SIZE];
57         //mark sort by name or gmt
58         Wcl_Addlist_Sort_Type sort;
59         WCL_PAGE_TYPE page;
60         Evas_Object *popup;
61         Evas_Object *popup_content;
62
63         Ecore_IMF_Context *imf_context;
64
65         /* public used widget */
66         Evas_Object *win;
67         Evas *evas;
68         Evas_Object *bg;
69
70         /* fake item */
71         Evas_Object *fake_ly;
72         Evas_Object *fake_layout;
73         Evas_Object *fake_image;
74         Evas_Object *fake_item;
75         Evas_Object *fake_softkey;
76         Ecore_Timer *fake_view_timer;
77
78         // window layout
79         Evas_Object *ly_main;
80         // window layout
81         Evas_Object *layout_main;
82         Evas_Object *parent;
83
84         /* main layout */
85         Evas_Object *main_ly;
86         Evas_Object *main_layout;
87         Evas_Object *main_genlist;
88         Evas_Object *main_edit_button;
89         Evas_Object *main_add_button;
90         Elm_Object_Item *eci_btn_lft_main, *eci_btn_rht_main;
91
92         /* add layout */
93         // window layout
94         Evas_Object *add_ly;
95         Evas_Object *add_layout;
96         Evas_Object *add_search_bar;
97         Evas_Object *add_genlist;
98         Evas_Object *add_index;
99         Evas_Object *add_sortbar;
100         Evas_Object *add_selectioninfo;
101         Evas_Object *add_selectioninfo_layout;
102
103         /* edit layout */
104         Evas_Object *edit_ly;
105         Evas_Object *edit_layout;
106         Evas_Object *edit_genlist;
107         Evas_Object *edit_selectall;
108         Evas_Object *edit_toolbar;
109         Evas_Object *edit_reorder_item;
110         Evas_Object *edit_selectioninfo;
111         Evas_Object *edit_selectioninfo_layout;
112         Evas_Object *edit_done_button;
113         Evas_Object *edit_delete_button;
114         Elm_Object_Item *edit_delete_toolitem;
115         Elm_Object_Item *eci_btn_lft_edit, *eci_btn_rht_edit;
116
117         /* detail layout */
118         Evas_Object *detail_ly;
119         Evas_Object *detail_layout;
120         Evas_Object *detail_genlist;
121         Evas_Object *detail_radiobox;
122
123         /* timer */
124         Ecore_Timer *main_view_timer;
125         Ecore_Timer *add_view_quit_timer;
126         Ecore_Timer *add_view_update_timer;
127         Ecore_Timer *add_view_update_last_timer;
128         Ecore_Timer *edit_view_timer;
129
130         /* Home City */
131         Wcl_CitySet *home_cs;
132
133         Elm_Theme *m_th;
134
135         Evas_Object *navi_bar;
136
137         Evas_Object *ctrl_bar;
138         Elm_Object_Item *item[4];
139         Evas_Object *sub_view[4];
140
141         Wcl_Ctrlbar_Visible_Set controlbar_cb;
142
143         ui_gadget_h ug;
144         service_h ug_bundle;
145         // return a Wcl_CitySet, used in ug
146         Wcl_CitySet *return_data;
147 };
148
149 #endif                          /* __DEF_WORLDCLOCK_H_ */