3 * Copyright 2012 Samsung Electronics Co., Ltd
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
9 * http://www.tizenopensource.org/license
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.
19 #ifndef __DEF_WORLDCLOCK_DATA_H_
20 #define __DEF_WORLDCLOCK_DATA_H_
22 #include <Elementary.h>
25 #include "worldclock_types.h"
28 * Get home city from vconf module
30 * @return NULL if meet error
31 * Pointer to the home city
33 Wcl_CitySet *worldclock_ug_data_get_local_city();
36 * Get all select cities into given city list
38 * @return NULL if meet error
39 * Pointer to the result selection list
41 Eina_List *worldclock_ug_data_get_all_added_city();
44 * Get all appendable cities into given city list
46 * @param[in] selectFlag selection flag which used for judge selection type
48 * @return NULL if meet error
49 * Pointer to the result selection list
51 Eina_List *worldclock_ug_data_get_default_city_list(Wcl_Selection_Flag selectFlag);
54 * Search cities according to search_txt, and return search result
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
61 * @return NULL if meet error
62 * Pointer to the result selection list
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);
69 * Update data of given city to database
71 * @param[in] p_record data of given city
73 * @return EINA_FALSE if meet error
74 * EINA_TRUE if update successfully
76 Eina_Bool worldclock_ug_data_update_db_record(Wcl_CitySet *p_record);
79 * Get data of given city to database
81 * @param[in] p_record data of given city
83 * @return EINA_FALSE if meet error
84 * EINA_TRUE if load successfully
86 Eina_Bool worldclock_ug_data_get_city_status_from_db(Wcl_CitySet *p_record);
89 * Try to open data base
91 * @return EINA_FALSE if open database failed
92 * EINA_TRUE if open database successfully
94 Eina_Bool worldclock_ug_data_open_database();
97 * Try to close data base
99 * @return EINA_FALSE if open database failed
100 * EINA_TRUE if open database successfully
102 Eina_Bool worldclock_ug_data_close_database();
105 * Get count of all selected cities
107 * @return -1 if open database failed
108 * Number of all selected city
110 int worldclock_ug_data_get_selected_city_num();
113 * Copy given city data to aimed city
115 * @param[in] src_city the source city record
116 * @param[out] dst_city the aimed city record
120 void worldclock_ug_data_cityset_copy(Wcl_CitySet *dst_city,
121 const Wcl_CitySet *src_city);
123 #endif /* __DEF_WORLDCLOCK_DATA_H_ */