4 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Youngae Kang <youngae.kang@samsung.com>, Yunhan Kim <yhan.kim@samsung.com>,
7 * Genie Kim <daejins.kim@samsung.com>, Minjune Kim <sena06.kim@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
22 #ifndef __LOCATION_POI_INFO_H__
23 #define __LOCATION_POI_INFO_H__
25 #include <location/location-types.h>
26 #include <location/location-position.h>
27 #include <location/location-address.h>
30 * @file location-poi-info.h
31 * @brief This file contains the internal definitions and structures related to POI information.
32 * @addtogroup LocationTypes
39 * @brief This represents one POI information such as name, type of POI, etc.
41 typedef struct _LocationPOIDetail {
42 gchar *name; // Name of a POI
43 gchar *type; // Type of a POI (e.g. cafe)
44 LocationAddress *address; // Address of a POI
45 LocationPosition *position; // Position of a POI
46 gchar *phone_number; // Phone number of a POI
47 GHashTable *properties; // GHashTable with detailed characteristics of a POI.
51 * @brief This represents a number of POI informations.
53 struct _LocationPOIInfo
56 LocationPOIDetail *poi_detail;
59 GType location_poiinfo_get_type (void);
60 #define LOCATION_TYPE_POIINFO (location_poiinfo_get_type ())
63 * @brief Create a new GHashTable for properties in a #LocationPOIDetail.
65 * @pre #location_init should be called before.\n
68 * @return a new GHashTable.
69 * @retval NULL if error occured
71 GHashTable *location_poiinfo_detail_properties_new (void);
74 * @brief Free a GHashTable for properties in a #LocationPOIDetail.
76 * @pre #location_init should be called before.\n
78 * @param [in] properties - a #GHashTable.
81 void location_poiinfo_detail_properties_free (GHashTable* properties);
84 * @brief Insert a new key and value into a GHashTable for properties in a #LocationPOIDetail.
86 * @pre #location_init should be called before.\n
88 * @param [in] properties - a #GHashTable in a #LocationPOIDetail.
89 * @param [in] key - a key to insert (e.g. URL)
90 * @param [in] value - the value to associate with the key. (e.g. http://www.samsung.com)
94 * FALSE - if error occured\n
96 gboolean location_poiinfo_detail_properties_insert (GHashTable* properties, const gchar* key, const gchar* value);
99 * @brief Makes a copy of GHashTable for properties in a #LocationPOIDetail.
101 * @pre #location_init should be called before.\n
103 * @param [in] properties - a #GHashTable
104 * @return a new #GHashTable
105 * @retval NULL if error occured
107 GHashTable *location_poiinfo_detail_properties_copy (const GHashTable *properties);
110 * @brief Create a new #LocationPOIInfo with given number of #LocationPOIDetail.
112 * @pre #location_init should be called before.\n
114 * @param [in] num_of_poi - number of #LocationPOIDetail.
115 * @return a new #LocationPOIInfo
116 * @retval NULL if error occured
118 LocationPOIInfo* location_poiinfo_new (int num_of_poi);
121 * @brief Free a #LocationPOIInfo.
123 * @pre #location_init should be called before.\n
125 * @param [in] poi_info - a #LocationPOIInfo.
128 void location_poiinfo_free(LocationPOIInfo* poi_info);
131 * @brief Makes a copy of #LocationPOIInfo
133 * @pre #location_init should be called before.\n
135 * @param [in] poi_info - a #LocationPOIInfo
136 * @return a new #LocationPOIInfo
137 * @retval NULL if error occured
139 LocationPOIInfo *location_poiinfo_copy (const LocationPOIInfo* poi_info);
142 * @brief Get elements of #LocationPOIDetail with given index in #LocationPOIInfo.
144 * @pre #location_init should be called before.\n
146 * @param [in] poi_info - a #LocationPOIInfo
147 * @param [in] index - index of #LocationPOIDetail in #LocationPOIInfo
148 * @param [out] name - a name of a #LocationPOIDetail
149 * @param [out] type - a type of a #LocationPOIDetail
150 * @param [out] address - a address of a #LocationPOIDetail
151 * @param [out] position - a position of a#LocationPOIDetail
152 * @param [out] phone_number - a phone number of #LocationPOIDetail
153 * @param [out] properties - a GHashTable with properties of #LocationPOIDetail
156 * TRUE - if success\n
157 * FALSE - if error occured\n
159 gboolean location_poiinfo_get_poi_detail(LocationPOIInfo *poi_info, guint index, gchar** name, gchar** type, LocationAddress** address, LocationPosition** position, gchar** phone_number, GHashTable** properties);
162 * @brief Set elements of #LocationPOIDetail with given index in #LocationPOIInfo.
164 * @pre #location_init should be called before.\n
166 * @param [in] poi_info - a #LocationPOIInfo
167 * @param [in] index - index of #LocationPOIDetail in #LocationPOIInfo
168 * @param [in] name - a name of a #LocationPOIDetail
169 * @param [in] type - a type of a #LocationPOIDetail
170 * @param [in] address - a address of a #LocationPOIDetail
171 * @param [in] position - a position of a #LocationPOIDetail
172 * @param [in] phone_number - a phone number of a #LocationPOIDetail
173 * @param [in] properties - a GHashTable with properties of a #LocationPOIDetail, can be NULL if a POI have no additional properties
176 * TRUE - if success\n
177 * FALSE - if error occured\n
179 gboolean location_poiinfo_set_poi_detail(LocationPOIInfo *poi_info, guint index, const gchar* name, const gchar* type, const LocationAddress* address, const LocationPosition* position, const gchar* phone_number, const GHashTable* properties);