2 * Copyright 2012 Samsung Electronics Co., Ltd
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
8 * http://www.tizenopensource.org/license
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.
17 #ifndef __DEF_WORLDCLOCK_DATA_H_
18 #define __DEF_WORLDCLOCK_DATA_H_
20 #include <Elementary.h>
23 #include "worldclock_types.h"
26 * Get home city from vconf module
28 * @return NULL if meet error
29 * Pointer to the home city
31 Wcl_CitySet *worldclock_data_get_local_city();
34 * Get all select cities into given city list
36 * @return NULL if meet error
37 * Pointer to the result selection list
39 Eina_List *worldclock_data_get_all_added_city();
42 * Get all appendable cities into given city list
44 * @param[in] selectFlag selection flag which used for judge selection type
46 * @return NULL if meet error
47 * Pointer to the result selection list
49 Eina_List *worldclock_data_get_default_city_list(Wcl_Selection_Flag selectFlag);
52 * Search cities according to search_txt, and return search result
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
59 * @return NULL if meet error
60 * Pointer to the result selection list
62 Eina_List *worldclock_data_get_search_city_list(const char *search_txt,
63 Wcl_Search_Type search_type,
64 Wcl_Selection_Flag selectFlag);
67 * Update data of given city to database
69 * @param[in] p_record data of given city
71 * @return EINA_FALSE if meet error
72 * EINA_TRUE if update successfully
74 Eina_Bool worldclock_data_update_db_record(Wcl_CitySet *p_record);
77 * Get data of given city to database
79 * @param[in] p_record data of given city
81 * @return EINA_FALSE if meet error
82 * EINA_TRUE if load successfully
84 Eina_Bool worldclock_data_get_city_status_from_db(Wcl_CitySet *p_record);
87 * Try to open data base
89 * @return EINA_FALSE if open database failed
90 * EINA_TRUE if open database successfully
92 Eina_Bool worldclock_data_open_database();
95 * Try to close data base
97 * @return EINA_FALSE if open database failed
98 * EINA_TRUE if open database successfully
100 Eina_Bool worldclock_data_close_database();
103 * Get count of all selected cities
105 * @return -1 if open database failed
106 * Number of all selected city
108 int worldclock_data_get_selected_city_num();
111 * Copy given city data to aimed city
113 * @param[in] src_city the source city record
114 * @param[out] dst_city the aimed city record
118 void worldclock_data_cityset_copy(Wcl_CitySet *dst_city,
119 const Wcl_CitySet *src_city);
121 #endif /* __DEF_WORLDCLOCK_DATA_H_ */