apply FSL(Flora Software License)
[apps/home/libug-worldclock-efl.git] / include / worldclock_data.h
1 /*
2   * Copyright 2012  Samsung Electronics Co., Ltd
3   * 
4   * Licensed under the Flora License, Version 1.0 (the "License");
5   * you may not use this file except in compliance with the License.
6   * You may obtain a copy of the License at
7   * 
8   *     http://www.tizenopensource.org/license
9   * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16
17 #ifndef __DEF_WORLDCLOCK_DATA_H_
18 #define __DEF_WORLDCLOCK_DATA_H_
19
20 #include <Elementary.h>
21 #include <utilX.h>
22
23 #include "worldclock_types.h"
24
25 /**
26  * Get home city from vconf module
27  *
28  * @return    NULL if meet error
29  *            Pointer to the home city
30  */
31 Wcl_CitySet *worldclock_data_get_local_city();
32
33 /**
34  * Get all select cities into given city list
35  *
36  * @return    NULL if meet error
37  *            Pointer to the result selection list
38  */
39 Eina_List *worldclock_data_get_all_added_city();
40
41 /**
42  * Get all appendable cities into given city list
43  *
44  * @param[in]   selectFlag    selection flag which used for judge selection type
45  *
46  * @return    NULL if meet error
47  *            Pointer to the result selection list
48  */
49 Eina_List *worldclock_data_get_default_city_list(Wcl_Selection_Flag selectFlag);
50
51 /**
52  * Search cities according to search_txt, and return search result
53  *
54  * @param[in]  data
55  * @param[in]  search_type   the search type which will search in this function
56  *                           search_type: 1->by city name, 2->by country name, 3->by gmt
57  * @param[in]  selectFlag    selection flag which used for judge selection type
58  *
59  * @return    NULL if meet error
60  *            Pointer to the result selection list
61  */
62 Eina_List *worldclock_data_get_search_city_list(const char *search_txt,
63                                                 Wcl_Search_Type search_type,
64                                                 Wcl_Selection_Flag selectFlag);
65
66 /**
67  * Update data of given city to database
68  *
69  * @param[in]  p_record      data of given city
70  *
71  * @return    EINA_FALSE if meet error
72  *            EINA_TRUE if update successfully
73  */
74 Eina_Bool worldclock_data_update_db_record(Wcl_CitySet *p_record);
75
76 /**
77  * Get data of given city to database
78  *
79  * @param[in]  p_record      data of given city
80  *
81  * @return    EINA_FALSE if meet error
82  *            EINA_TRUE if load successfully
83  */
84 Eina_Bool worldclock_data_get_city_status_from_db(Wcl_CitySet *p_record);
85
86 /**
87  * Try to open data base
88  *
89  * @return    EINA_FALSE if open database failed
90  *            EINA_TRUE if open database successfully
91  */
92 Eina_Bool worldclock_data_open_database();
93
94 /**
95  * Try to close data base
96  *
97  * @return    EINA_FALSE if open database failed
98  *            EINA_TRUE if open database successfully
99  */
100 Eina_Bool worldclock_data_close_database();
101
102 /**
103  * Get count of all selected cities
104  *
105  * @return    -1 if open database failed
106  *            Number of all selected city
107  */
108 int worldclock_data_get_selected_city_num();
109
110 /**
111  * Copy given city data to aimed city
112  *
113  * @param[in]   src_city     the source city record
114  * @param[out]  dst_city     the aimed city record
115  *
116  * @return
117  */
118 void worldclock_data_cityset_copy(Wcl_CitySet *dst_city,
119                                   const Wcl_CitySet *src_city);
120
121 #endif                          /* __DEF_WORLDCLOCK_DATA_H_ */