Fix city list too large prblem
[apps/home/libug-worldclock-efl.git] / include / worldclock_types.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_TYPES_H__
20 #define __DEF_WORLDCLOCK_TYPES_H__
21
22 #include <Elementary.h>
23 #include "worldclock_const.h"
24
25 typedef void (*Wcl_Return_Cb) (void *, Eina_Bool);
26 typedef int (*Wcl_Ctrlbar_Visible_Set) (Eina_Bool);
27
28 typedef enum {
29         WCL_CALLER_IS_APP_IT_SELF = 0,
30         WCL_CALLER_IS_SHARED_LIBRARY,
31         WCL_CALLER_IS_UI_GADGET,
32
33         WCL_CALLER_IS_UNKNOW,
34 } Wcl_Caller;
35
36 typedef enum {
37         WCL_SORT_BY_NAME = 0,
38         WCL_SORT_BY_TIMEZONE,
39
40         WCL_UNKNOW_SORT_TYPE,
41 } Wcl_Addlist_Sort_Type;
42
43 typedef enum {
44         WCL_SELECT_IN_UNSELECTED = 0,
45         WCL_SELECT_IN_ALL,
46         WCL_SELECT_IF_HAS_TZPATH,
47
48         WCL_SELECTION_UNKNOW_FLAG,
49 } Wcl_Selection_Flag;
50
51 typedef enum {
52         WCL_SEARCH_BY_ALL_KEYWORDS = 0,
53         WCL_SEARCH_BY_CITY_NAME,
54         WCL_SEARCH_BY_COUNTRY_NAME,
55         WCL_SEARCH_BY_TIMEZONE,
56
57         WCL_UNKNOWN_SEARCH_TYPE,
58 } Wcl_Search_Type;
59
60 typedef enum {
61         WCL_DST_OFF = -1,
62         WCL_DST_AUTO = 0,
63         WCL_DST_1_HOUR,
64         WCL_DST_2_HOURS,
65
66         WCL_DST_TYPES_COUNT,
67
68         WCL_DST_UNKNOWN_TYPE,
69 } Wcl_DST_Type;
70
71 typedef struct _cs {            /* city set */
72         int index;              /* record index in db */
73         char city[CITY_BUF_SIZE];       /* city name */
74         char country[COUNTRY_BUF_SIZE]; /* country name */
75         char timezone[TIMEZONE_BUF_SIZE];       /* timezone */
76         int dst_type;           /* dst type */
77         int dst_enabled;        /* dst disable flag */
78         int selected;           /* selected or not */
79         int sequence;           /* sequence number in mainlist */
80         char tz_path[TZPATH_BUF_SIZE];  /* TZ path of city */
81
82         int dst;                /* dst value */
83         volatile time_t now_time;       /* the current time of city */
84 } Wcl_CitySet;
85
86 #endif                          // __DEF_WORLDCLOCK_TYPES_H__