Fix city list too large prblem
[apps/home/libug-worldclock-efl.git] / include / worldclock_data.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_DATA_H_
20 #define __DEF_WORLDCLOCK_DATA_H_
21
22 #include <Elementary.h>
23 #include <utilX.h>
24
25 #include "worldclock_types.h"
26
27 /**
28  * Get home city from vconf module
29  *
30  * @return    NULL if meet error
31  *            Pointer to the home city
32  */
33 Wcl_CitySet *worldclock_ug_data_get_local_city();
34
35 /**
36  * Get all select cities into given city list
37  *
38  * @return    NULL if meet error
39  *            Pointer to the result selection list
40  */
41 Eina_List *worldclock_ug_data_get_all_added_city();
42
43 /**
44  * Get all appendable cities into given city list
45  *
46  * @param[in]   selectFlag    selection flag which used for judge selection type
47  *
48  * @return    NULL if meet error
49  *            Pointer to the result selection list
50  */
51 Eina_List *worldclock_ug_data_get_default_city_list(Wcl_Selection_Flag selectFlag);
52
53 /**
54  * Search cities according to search_txt, and return search result
55  *
56  * @param[in]  data
57  * @param[in]  search_type   the search type which will search in this function
58  *                           search_type: 1->by city name, 2->by country name, 3->by gmt
59  * @param[in]  selectFlag    selection flag which used for judge selection type
60  *
61  * @return    NULL if meet error
62  *            Pointer to the result selection list
63  */
64 Eina_List *worldclock_ug_data_get_search_city_list(const char *search_txt,
65                                                 Wcl_Search_Type search_type,
66                                                 Wcl_Selection_Flag selectFlag);
67
68 /**
69  * Update data of given city to database
70  *
71  * @param[in]  p_record      data of given city
72  *
73  * @return    EINA_FALSE if meet error
74  *            EINA_TRUE if update successfully
75  */
76 Eina_Bool worldclock_ug_data_update_db_record(Wcl_CitySet *p_record);
77
78 /**
79  * Get data of given city to database
80  *
81  * @param[in]  p_record      data of given city
82  *
83  * @return    EINA_FALSE if meet error
84  *            EINA_TRUE if load successfully
85  */
86 Eina_Bool worldclock_ug_data_get_city_status_from_db(Wcl_CitySet *p_record);
87
88 /**
89  * Try to open data base
90  *
91  * @return    EINA_FALSE if open database failed
92  *            EINA_TRUE if open database successfully
93  */
94 Eina_Bool worldclock_ug_data_open_database();
95
96 /**
97  * Try to close data base
98  *
99  * @return    EINA_FALSE if open database failed
100  *            EINA_TRUE if open database successfully
101  */
102 Eina_Bool worldclock_ug_data_close_database();
103
104 /**
105  * Get count of all selected cities
106  *
107  * @return    -1 if open database failed
108  *            Number of all selected city
109  */
110 int worldclock_ug_data_get_selected_city_num();
111
112 /**
113  * Copy given city data to aimed city
114  *
115  * @param[in]   src_city     the source city record
116  * @param[out]  dst_city     the aimed city record
117  *
118  * @return
119  */
120 void worldclock_ug_data_cityset_copy(Wcl_CitySet *dst_city,
121                                   const Wcl_CitySet *src_city);
122
123 #endif                          /* __DEF_WORLDCLOCK_DATA_H_ */