williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@2
|
5 |
* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@2
|
7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description: CPosLmCategoryManager class
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#ifndef CPOSLMCATEGORYMANAGER_H
|
williamr@2
|
20 |
#define CPOSLMCATEGORYMANAGER_H
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#include <e32base.h>
|
williamr@2
|
23 |
#include "epos_cposlandmarkdatabase.h"
|
williamr@2
|
24 |
#include "epos_cposlandmarkcategory.h"
|
williamr@2
|
25 |
#include "epos_cposlmitemiterator.h"
|
williamr@2
|
26 |
#include "epos_cposlmoperation.h"
|
williamr@2
|
27 |
|
williamr@2
|
28 |
/**
|
williamr@2
|
29 |
* Category management for a landmark database.
|
williamr@2
|
30 |
*
|
williamr@2
|
31 |
* A landmark database can contain a number of categories which can be
|
williamr@2
|
32 |
* assigned to the landmarks in the database. A landmark can be associated
|
williamr@2
|
33 |
* with multiple categories, e.g. a landmark can be a "Restaurant" and a "Pub".
|
williamr@2
|
34 |
* Categories also enable filtered searches, e.g. a client could search for
|
williamr@2
|
35 |
* nearby restaurants.
|
williamr@2
|
36 |
*
|
williamr@2
|
37 |
* This class contains functions for managing landmark categories. This includes
|
williamr@2
|
38 |
* reading, listing, creating and updating landmark categories.
|
williamr@2
|
39 |
*
|
williamr@2
|
40 |
* @p NetworkServices capability is required for remote databases.
|
williamr@2
|
41 |
*
|
williamr@2
|
42 |
* @lib eposlandmarks.lib
|
williamr@2
|
43 |
* @since S60 3.0
|
williamr@2
|
44 |
*/
|
williamr@2
|
45 |
class CPosLmCategoryManager : public CBase
|
williamr@2
|
46 |
{
|
williamr@2
|
47 |
public:
|
williamr@2
|
48 |
|
williamr@2
|
49 |
/**
|
williamr@2
|
50 |
* Specifies the sort preference for landmark categories.
|
williamr@2
|
51 |
*/
|
williamr@2
|
52 |
enum TCategorySortPref
|
williamr@2
|
53 |
{
|
williamr@2
|
54 |
ECategorySortOrderNone = 0 /**<
|
williamr@2
|
55 |
Categories not sorted */,
|
williamr@2
|
56 |
ECategorySortOrderNameAscending /**<
|
williamr@2
|
57 |
Sorted ascending by category name. */,
|
williamr@2
|
58 |
ECategorySortOrderNameDescending /**<
|
williamr@2
|
59 |
Sorted descending by category name. */
|
williamr@2
|
60 |
};
|
williamr@2
|
61 |
|
williamr@2
|
62 |
public:
|
williamr@2
|
63 |
|
williamr@2
|
64 |
/**
|
williamr@2
|
65 |
* Two-phased constructor.
|
williamr@2
|
66 |
*
|
williamr@2
|
67 |
* The client takes ownership of the category manager.
|
williamr@2
|
68 |
*
|
williamr@2
|
69 |
* @param[in] aLandmarkDatabase The landmark database to manage categories in.
|
williamr@2
|
70 |
* @returns A new instance of this class.
|
williamr@2
|
71 |
*/
|
williamr@2
|
72 |
IMPORT_C static CPosLmCategoryManager* NewL(
|
williamr@2
|
73 |
CPosLandmarkDatabase& aLandmarkDatabase
|
williamr@2
|
74 |
);
|
williamr@2
|
75 |
|
williamr@2
|
76 |
/**
|
williamr@2
|
77 |
* Destructor.
|
williamr@2
|
78 |
*/
|
williamr@2
|
79 |
IMPORT_C virtual ~CPosLmCategoryManager();
|
williamr@2
|
80 |
|
williamr@2
|
81 |
public:
|
williamr@2
|
82 |
|
williamr@2
|
83 |
/**
|
williamr@2
|
84 |
* Reads a landmark category from the database.
|
williamr@2
|
85 |
*
|
williamr@2
|
86 |
* @pre Database is initialized (see @ref CPosLandmarkDatabase::IsInitializingNeeded).
|
williamr@2
|
87 |
*
|
williamr@2
|
88 |
* The client takes ownership of the returned category object.
|
williamr@2
|
89 |
*
|
williamr@2
|
90 |
* This function requires @p ReadUserData capability.
|
williamr@2
|
91 |
*
|
williamr@2
|
92 |
* @param aCategoryId The ID of the landmark category to read.
|
williamr@2
|
93 |
* @returns The requested landmark category. The category object is put
|
williamr@2
|
94 |
* on the cleanup stack.
|
williamr@2
|
95 |
*
|
williamr@2
|
96 |
* @leave KErrNotFound The landmark category does not exist in the database.
|
williamr@2
|
97 |
* @leave KErrPosLmNotInitialized Database is not yet initialized.
|
williamr@2
|
98 |
*/
|
williamr@2
|
99 |
virtual CPosLandmarkCategory* ReadCategoryLC( TPosLmItemId aCategoryId ) = 0;
|
williamr@2
|
100 |
|
williamr@2
|
101 |
/**
|
williamr@2
|
102 |
* Returns an object for iterating the landmark categories in the
|
williamr@2
|
103 |
* database.
|
williamr@2
|
104 |
*
|
williamr@2
|
105 |
* @pre Database is initialized (see @ref CPosLandmarkDatabase::IsInitializingNeeded).
|
williamr@2
|
106 |
*
|
williamr@2
|
107 |
* The iterator object is reset, so that the first
|
williamr@2
|
108 |
* @ref CPosLmItemIterator::NextL call will return the first landmark
|
williamr@2
|
109 |
* category.
|
williamr@2
|
110 |
*
|
williamr@2
|
111 |
* The client takes ownership of the returned iterator object.
|
williamr@2
|
112 |
*
|
williamr@2
|
113 |
* This function requires @p ReadUserData capability.
|
williamr@2
|
114 |
*
|
williamr@2
|
115 |
* @param[in] aSortPref How to sort the categories. Default is no sorting.
|
williamr@2
|
116 |
* @return The landmark iterator.
|
williamr@2
|
117 |
*
|
williamr@2
|
118 |
* @leave KErrPosLmNotInitialized Database is not yet initialized.
|
williamr@2
|
119 |
*
|
williamr@2
|
120 |
* @panic "Landmarks Client"-EPosInvalidEnumValue
|
williamr@2
|
121 |
* Client specified invalid sort preference.
|
williamr@2
|
122 |
*/
|
williamr@2
|
123 |
virtual CPosLmItemIterator* CategoryIteratorL(
|
williamr@2
|
124 |
TCategorySortPref aSortPref = ECategorySortOrderNone
|
williamr@2
|
125 |
) = 0;
|
williamr@2
|
126 |
|
williamr@2
|
127 |
/**
|
williamr@2
|
128 |
* Returns an object for iterating referenced landmark categories in
|
williamr@2
|
129 |
* the database.
|
williamr@2
|
130 |
*
|
williamr@2
|
131 |
* @pre Database is initialized (see @ref CPosLandmarkDatabase::IsInitializingNeeded).
|
williamr@2
|
132 |
*
|
williamr@2
|
133 |
* A category is referenced if there are landmarks in the database which
|
williamr@2
|
134 |
* contains this category.
|
williamr@2
|
135 |
*
|
williamr@2
|
136 |
* The iterator object is reset, so that the first
|
williamr@2
|
137 |
* @ref CPosLmItemIterator::NextL call will return the first landmark
|
williamr@2
|
138 |
* category.
|
williamr@2
|
139 |
*
|
williamr@2
|
140 |
* The client takes ownership of the returned iterator object.
|
williamr@2
|
141 |
*
|
williamr@2
|
142 |
* This function requires @p ReadUserData capability.
|
williamr@2
|
143 |
*
|
williamr@2
|
144 |
* @param[in] aSortPref How to sort the categories. Default is no sorting.
|
williamr@2
|
145 |
* @return The landmark iterator.
|
williamr@2
|
146 |
*
|
williamr@2
|
147 |
* @leave KErrPosLmNotInitialized Database is not yet initialized.
|
williamr@2
|
148 |
*
|
williamr@2
|
149 |
* @panic "Landmarks Client"-EPosInvalidEnumValue
|
williamr@2
|
150 |
* Client specified invalid sort preference.
|
williamr@2
|
151 |
*/
|
williamr@2
|
152 |
virtual CPosLmItemIterator* ReferencedCategoryIteratorL(
|
williamr@2
|
153 |
TCategorySortPref aSortPref = ECategorySortOrderNone
|
williamr@2
|
154 |
) = 0;
|
williamr@2
|
155 |
|
williamr@2
|
156 |
/**
|
williamr@2
|
157 |
* Adds a landmark category to the database and returns its ID.
|
williamr@2
|
158 |
*
|
williamr@2
|
159 |
* @pre Database is initialized (see @ref CPosLandmarkDatabase::IsInitializingNeeded).
|
williamr@2
|
160 |
*
|
williamr@2
|
161 |
* Note: Clients are not allowed to create global categories.
|
williamr@2
|
162 |
*
|
williamr@2
|
163 |
* This function requires @p ReadUserData and @p WriteUserData
|
williamr@2
|
164 |
* capabilities.
|
williamr@2
|
165 |
*
|
williamr@2
|
166 |
* @post Category is added to the database and category object
|
williamr@2
|
167 |
* has database item set (CPosLandmarkCategory::CategoryId()).
|
williamr@2
|
168 |
*
|
williamr@2
|
169 |
* @param[in,out] aCategory The landmark category to add.
|
williamr@2
|
170 |
* @return The ID of the new category.
|
williamr@2
|
171 |
*
|
williamr@2
|
172 |
* @leave KErrArgument 1) Input category does not have a name set or
|
williamr@2
|
173 |
* 2) if a global category is set in the category object.
|
williamr@2
|
174 |
* @leave KErrAlreadyExists A category with the same name
|
williamr@2
|
175 |
* already exists in the database.
|
williamr@2
|
176 |
* @leave KErrAccessDenied The database is read-only.
|
williamr@2
|
177 |
* @leave KErrPosLmNotInitialized Database is not yet initialized.
|
williamr@2
|
178 |
*/
|
williamr@2
|
179 |
virtual TPosLmItemId AddCategoryL(
|
williamr@2
|
180 |
CPosLandmarkCategory& aCategory
|
williamr@2
|
181 |
) = 0;
|
williamr@2
|
182 |
|
williamr@2
|
183 |
/**
|
williamr@2
|
184 |
* Updates a landmark category in the database.
|
williamr@2
|
185 |
*
|
williamr@2
|
186 |
* @pre Database is initialized (see @ref CPosLandmarkDatabase::IsInitializingNeeded).
|
williamr@2
|
187 |
*
|
williamr@2
|
188 |
* Note: Clients are not allowed to change the global category identifier in
|
williamr@2
|
189 |
* the category object.
|
williamr@2
|
190 |
*
|
williamr@2
|
191 |
* This function requires @p ReadUserData and @p WriteUserData
|
williamr@2
|
192 |
* capabilities.
|
williamr@2
|
193 |
*
|
williamr@2
|
194 |
* @param[in] aCategory The new landmark category data.
|
williamr@2
|
195 |
*
|
williamr@2
|
196 |
* @leave KErrArgument 1) Input category does not have a name set or
|
williamr@2
|
197 |
* 2) if a global category identifier is changed in the category object.
|
williamr@2
|
198 |
* @leave KErrAlreadyExists A category with the same name
|
williamr@2
|
199 |
* already exists in the database.
|
williamr@2
|
200 |
* @leave KErrAccessDenied The database is read-only.
|
williamr@2
|
201 |
* @leave KErrPosLmNotInitialized Database is not yet initialized.
|
williamr@2
|
202 |
*/
|
williamr@2
|
203 |
virtual void UpdateCategoryL(
|
williamr@2
|
204 |
const CPosLandmarkCategory& aCategory
|
williamr@2
|
205 |
) = 0;
|
williamr@2
|
206 |
|
williamr@2
|
207 |
/**
|
williamr@2
|
208 |
* Removes a landmark category from the database.
|
williamr@2
|
209 |
*
|
williamr@2
|
210 |
* @pre Database is initialized (see @ref CPosLandmarkDatabase::IsInitializingNeeded).
|
williamr@2
|
211 |
*
|
williamr@2
|
212 |
* If the landmark category does not exist in the database, nothing
|
williamr@2
|
213 |
* happens.
|
williamr@2
|
214 |
*
|
williamr@2
|
215 |
* This call will also remove the category from all landmarks which
|
williamr@2
|
216 |
* contained it.
|
williamr@2
|
217 |
*
|
williamr@2
|
218 |
* The function returns an operation object which can be run in either
|
williamr@2
|
219 |
* synchronous or asynchronous mode. If it is run in asynchronous mode
|
williamr@2
|
220 |
* the client can supervise the progress of the operation.
|
williamr@2
|
221 |
*
|
williamr@2
|
222 |
* If the @ref CPosLmOperation object is deleted before the operation
|
williamr@2
|
223 |
* is complete, it is possible that the category has not been removed,
|
williamr@2
|
224 |
* but some landmarks may no longer contain this category
|
williamr@2
|
225 |
*
|
williamr@2
|
226 |
* The client takes ownership of the returned operation object.
|
williamr@2
|
227 |
*
|
williamr@2
|
228 |
* While removing the category, this operation will acquire a
|
williamr@2
|
229 |
* write-lock on the database.
|
williamr@2
|
230 |
*
|
williamr@2
|
231 |
* This function requires @p ReadUserData and @p WriteUserData
|
williamr@2
|
232 |
* capabilities.
|
williamr@2
|
233 |
*
|
williamr@2
|
234 |
* @param aCategoryId The ID of the landmark category to delete.
|
williamr@2
|
235 |
* @returns A handle to the operation.
|
williamr@2
|
236 |
*
|
williamr@2
|
237 |
* @leave KErrAccessDenied The database is read-only.
|
williamr@2
|
238 |
* @leave KErrPosLmNotInitialized Database is not yet initialized.
|
williamr@2
|
239 |
*/
|
williamr@2
|
240 |
virtual CPosLmOperation* RemoveCategoryL( TPosLmItemId aCategoryId ) = 0;
|
williamr@2
|
241 |
|
williamr@2
|
242 |
/**
|
williamr@2
|
243 |
* Remove a set of landmark categories from the database.
|
williamr@2
|
244 |
*
|
williamr@2
|
245 |
* @pre Database is initialized (see @ref CPosLandmarkDatabase::IsInitializingNeeded).
|
williamr@2
|
246 |
*
|
williamr@2
|
247 |
* If any of the landmark categories does not exist in the database, it
|
williamr@2
|
248 |
* is ignored.
|
williamr@2
|
249 |
*
|
williamr@2
|
250 |
* This call will also remove the categories from all landmarks which
|
williamr@2
|
251 |
* contained them.
|
williamr@2
|
252 |
*
|
williamr@2
|
253 |
* The function returns an operation object which can be run in either
|
williamr@2
|
254 |
* synchronous or asynchronous mode. If it is run in asynchronous mode
|
williamr@2
|
255 |
* the client can supervise the progress of the operation.
|
williamr@2
|
256 |
*
|
williamr@2
|
257 |
* If the @ref CPosLmOperation object is deleted before the operation
|
williamr@2
|
258 |
* is complete, it is possible that only a subset of the landmark
|
williamr@2
|
259 |
* categories have been deleted.
|
williamr@2
|
260 |
*
|
williamr@2
|
261 |
* The client takes ownership of the returned operation object.
|
williamr@2
|
262 |
*
|
williamr@2
|
263 |
* If the database is read only, the returned operation will fail with error
|
williamr@2
|
264 |
* code @p KErrAccessDenied.
|
williamr@2
|
265 |
*
|
williamr@2
|
266 |
* This call will also remove the categories from all landmarks which
|
williamr@2
|
267 |
* contained them.
|
williamr@2
|
268 |
*
|
williamr@2
|
269 |
* While removing the category, this operation will acquire a
|
williamr@2
|
270 |
* write-lock on the database.
|
williamr@2
|
271 |
*
|
williamr@2
|
272 |
* This function requires @p ReadUserData and @p WriteUserData
|
williamr@2
|
273 |
* capabilities.
|
williamr@2
|
274 |
*
|
williamr@2
|
275 |
* @param aCategoryIdArray The IDs of the landmark categories to delete.
|
williamr@2
|
276 |
* @returns A handle to the operation.
|
williamr@2
|
277 |
*
|
williamr@2
|
278 |
* @leave KErrPosLmNotInitialized Database is not yet initialized.
|
williamr@2
|
279 |
*/
|
williamr@2
|
280 |
virtual CPosLmOperation* RemoveCategoriesL(
|
williamr@2
|
281 |
const RArray<TPosLmItemId>& aCategoryIdArray
|
williamr@2
|
282 |
) = 0;
|
williamr@2
|
283 |
|
williamr@2
|
284 |
/**
|
williamr@2
|
285 |
* Adds a category to a set of landmarks.
|
williamr@2
|
286 |
*
|
williamr@2
|
287 |
* @pre Database is initialized (see @ref CPosLandmarkDatabase::IsInitializingNeeded).
|
williamr@2
|
288 |
*
|
williamr@2
|
289 |
* If any of the specified landmarks does not exist, the category will
|
williamr@2
|
290 |
* be added to the other landmarks. No error will be reported though.
|
williamr@2
|
291 |
*
|
williamr@2
|
292 |
* If the category is already contained in one of the landmarks, nothing
|
williamr@2
|
293 |
* will be further added to that landmark.
|
williamr@2
|
294 |
*
|
williamr@2
|
295 |
* The function returns an operation object which can be run in either
|
williamr@2
|
296 |
* synchronous or asynchronous mode. If it is run in asynchronous mode
|
williamr@2
|
297 |
* the client can supervise the progress of the operation.
|
williamr@2
|
298 |
*
|
williamr@2
|
299 |
* If the @ref CPosLmOperation object is deleted before the operation
|
williamr@2
|
300 |
* is complete, it is possible that the category has only been added
|
williamr@2
|
301 |
* to a subset of the landmarks.
|
williamr@2
|
302 |
*
|
williamr@2
|
303 |
* The client takes ownership of the returned operation object.
|
williamr@2
|
304 |
*
|
williamr@2
|
305 |
* Note: There is no need to call
|
williamr@2
|
306 |
* @p CPosLandmarkDatabase::UpdateLandmark for this change to take
|
williamr@2
|
307 |
* place.
|
williamr@2
|
308 |
*
|
williamr@2
|
309 |
* If the database is read only, the returned operation will fail with error
|
williamr@2
|
310 |
* code @p KErrAccessDenied.
|
williamr@2
|
311 |
*
|
williamr@2
|
312 |
* While adding the category to the landmarks, this operation will
|
williamr@2
|
313 |
* acquire a write-lock on the database.
|
williamr@2
|
314 |
*
|
williamr@2
|
315 |
* This function requires @p ReadUserData and @p WriteUserData
|
williamr@2
|
316 |
* capabilities.
|
williamr@2
|
317 |
*
|
williamr@2
|
318 |
* @param[in] aCategoryId The category to add to the set of landmarks.
|
williamr@2
|
319 |
* @param[in] aLandmarkIdArray The landmarks to add the category to.
|
williamr@2
|
320 |
* @returns A handle to the operation.
|
williamr@2
|
321 |
*
|
williamr@2
|
322 |
* @leave KErrNotFound The specified category does not exist in database.
|
williamr@2
|
323 |
* @leave KErrPosLmNotInitialized Database is not yet initialized.
|
williamr@2
|
324 |
*/
|
williamr@2
|
325 |
virtual CPosLmOperation* AddCategoryToLandmarksL(
|
williamr@2
|
326 |
TPosLmItemId aCategoryId,
|
williamr@2
|
327 |
RArray<TPosLmItemId>& aLandmarkIdArray
|
williamr@2
|
328 |
) = 0;
|
williamr@2
|
329 |
|
williamr@2
|
330 |
/**
|
williamr@2
|
331 |
* Removes a category from a set of landmarks.
|
williamr@2
|
332 |
*
|
williamr@2
|
333 |
* @pre Database is initialized (see @ref CPosLandmarkDatabase::IsInitializingNeeded).
|
williamr@2
|
334 |
*
|
williamr@2
|
335 |
* If any of the specified landmarks does not exist, the category will
|
williamr@2
|
336 |
* be removed from the other landmarks. No error will be reported though.
|
williamr@2
|
337 |
*
|
williamr@2
|
338 |
* If the category is not found in one of the landmarks, nothing will
|
williamr@2
|
339 |
* happen for that landmark.
|
williamr@2
|
340 |
*
|
williamr@2
|
341 |
* The function returns an operation object which can be run in either
|
williamr@2
|
342 |
* synchronous or asynchronous mode. If it is run in asynchronous mode
|
williamr@2
|
343 |
* the client can supervise the progress of the operation.
|
williamr@2
|
344 |
*
|
williamr@2
|
345 |
* If the @ref CPosLmOperation object is deleted before the operation
|
williamr@2
|
346 |
* is complete, it is possible that the category has only been removed
|
williamr@2
|
347 |
* from a subset of the landmarks.
|
williamr@2
|
348 |
*
|
williamr@2
|
349 |
* The client takes ownership of the returned operation object.
|
williamr@2
|
350 |
*
|
williamr@2
|
351 |
* If the database is read only, the returned operation will fail with error
|
williamr@2
|
352 |
* code @p KErrAccessDenied.
|
williamr@2
|
353 |
*
|
williamr@2
|
354 |
* While removing the category from the landmarks, this operation will
|
williamr@2
|
355 |
* acquire a write-lock on the database.
|
williamr@2
|
356 |
*
|
williamr@2
|
357 |
* This function requires @p ReadUserData and @p WriteUserData
|
williamr@2
|
358 |
* capabilities.
|
williamr@2
|
359 |
*
|
williamr@2
|
360 |
* @param[in] aCategoryId The category to remove from the set of landmarks.
|
williamr@2
|
361 |
* @param[in] aLandmarkIdArray The landmarks to remove the category from.
|
williamr@2
|
362 |
* @returns A handle to the operation.
|
williamr@2
|
363 |
*
|
williamr@2
|
364 |
* @leave KErrNotFound The specified category does not exist in database.
|
williamr@2
|
365 |
* @leave KErrPosLmNotInitialized Database is not yet initialized.
|
williamr@2
|
366 |
*/
|
williamr@2
|
367 |
virtual CPosLmOperation* RemoveCategoryFromLandmarksL(
|
williamr@2
|
368 |
TPosLmItemId aCategoryId,
|
williamr@2
|
369 |
RArray<TPosLmItemId>& aLandmarkIdArray
|
williamr@2
|
370 |
) = 0;
|
williamr@2
|
371 |
|
williamr@2
|
372 |
/**
|
williamr@2
|
373 |
* Gets a category by name.
|
williamr@2
|
374 |
*
|
williamr@2
|
375 |
* @pre Database is initialized (see @ref CPosLandmarkDatabase::IsInitializingNeeded).
|
williamr@2
|
376 |
*
|
williamr@2
|
377 |
* The category name must be unique in the database, so there cannot be
|
williamr@2
|
378 |
* multiple matches.
|
williamr@2
|
379 |
*
|
williamr@2
|
380 |
* This function only looks for an exact match.
|
williamr@2
|
381 |
*
|
williamr@2
|
382 |
* This function requires @p ReadUserData capability.
|
williamr@2
|
383 |
*
|
williamr@2
|
384 |
* @param[in] aCategoryName The name of the category to get.
|
williamr@2
|
385 |
* @return @p KPosLmNullItemId if the category was not found, otherwise
|
williamr@2
|
386 |
* the ID of the category item in the database.
|
williamr@2
|
387 |
*
|
williamr@2
|
388 |
* @leave KErrPosLmNotInitialized Database is not yet initialized.
|
williamr@2
|
389 |
*/
|
williamr@2
|
390 |
virtual TPosLmItemId GetCategoryL(
|
williamr@2
|
391 |
const TDesC& aCategoryName
|
williamr@2
|
392 |
) = 0;
|
williamr@2
|
393 |
|
williamr@2
|
394 |
/**
|
williamr@2
|
395 |
* Gets the ID of a global category.
|
williamr@2
|
396 |
*
|
williamr@2
|
397 |
* @pre Database is initialized (see @ref CPosLandmarkDatabase::IsInitializingNeeded).
|
williamr@2
|
398 |
*
|
williamr@2
|
399 |
* This function requires @p ReadUserData capability.
|
williamr@2
|
400 |
*
|
williamr@2
|
401 |
* @param[in] aGlobalCategory The global category to look for.
|
williamr@2
|
402 |
* @return @p KPosLmNullItemId if the category was not found, otherwise
|
williamr@2
|
403 |
* the ID of the category item in the database.
|
williamr@2
|
404 |
*
|
williamr@2
|
405 |
* @leave KErrPosLmNotInitialized Database is not yet initialized.
|
williamr@2
|
406 |
*/
|
williamr@2
|
407 |
virtual TPosLmItemId GetGlobalCategoryL(
|
williamr@2
|
408 |
TPosLmGlobalCategory aGlobalCategory
|
williamr@2
|
409 |
) = 0;
|
williamr@2
|
410 |
|
williamr@2
|
411 |
/**
|
williamr@2
|
412 |
* Gets the predefined name of a global category.
|
williamr@2
|
413 |
*
|
williamr@2
|
414 |
* @pre Database is initialized (see @ref CPosLandmarkDatabase::IsInitializingNeeded).
|
williamr@2
|
415 |
*
|
williamr@2
|
416 |
* @param[in] aGlobalCategory The global category to get a name for.
|
williamr@2
|
417 |
* @return The name of the global category or @p NULL if the category
|
williamr@2
|
418 |
* is not recognized.
|
williamr@2
|
419 |
*
|
williamr@2
|
420 |
* @leave KErrPosLmNotInitialized Database is not yet initialized.
|
williamr@2
|
421 |
*/
|
williamr@2
|
422 |
virtual HBufC* GlobalCategoryNameL(
|
williamr@2
|
423 |
TPosLmGlobalCategory aGlobalCategory
|
williamr@2
|
424 |
) = 0;
|
williamr@2
|
425 |
|
williamr@2
|
426 |
/**
|
williamr@2
|
427 |
* Resets the information for all global categories.
|
williamr@2
|
428 |
*
|
williamr@2
|
429 |
* @pre Database is initialized (see @ref CPosLandmarkDatabase::IsInitializingNeeded).
|
williamr@2
|
430 |
*
|
williamr@2
|
431 |
* Global categories usually has a default name and icon. The client
|
williamr@2
|
432 |
* can change the name and icon. This function resets the name and
|
williamr@2
|
433 |
* icon to the default ones.
|
williamr@2
|
434 |
*
|
williamr@2
|
435 |
* The function returns an operation object which can be run in either
|
williamr@2
|
436 |
* synchronous or asynchronous mode. If it is run in asynchronous mode
|
williamr@2
|
437 |
* the client can supervise the progress of the operation.
|
williamr@2
|
438 |
*
|
williamr@2
|
439 |
* If the @ref CPosLmOperation object is deleted before the operation
|
williamr@2
|
440 |
* is complete, it is possible that that only a subset of the global
|
williamr@2
|
441 |
* categories have been resetted.
|
williamr@2
|
442 |
*
|
williamr@2
|
443 |
* The client takes ownership of the returned operation object.
|
williamr@2
|
444 |
*
|
williamr@2
|
445 |
* While resetting, this operation will acquire a write-lock on the
|
williamr@2
|
446 |
* database.
|
williamr@2
|
447 |
*
|
williamr@2
|
448 |
* This function requires @p ReadUserData and @p WriteUserData
|
williamr@2
|
449 |
* capabilities.
|
williamr@2
|
450 |
*
|
williamr@2
|
451 |
* @returns A handle to the operation.
|
williamr@2
|
452 |
*
|
williamr@2
|
453 |
* @leave KErrAccessDenied The database is read-only.
|
williamr@2
|
454 |
* @leave KErrPosLmNotInitialized Database is not yet initialized.
|
williamr@2
|
455 |
*/
|
williamr@2
|
456 |
virtual CPosLmOperation* ResetGlobalCategoriesL() = 0;
|
williamr@2
|
457 |
|
williamr@2
|
458 |
protected:
|
williamr@2
|
459 |
|
williamr@2
|
460 |
// C++ constructor.
|
williamr@2
|
461 |
IMPORT_C CPosLmCategoryManager();
|
williamr@2
|
462 |
|
williamr@2
|
463 |
private:
|
williamr@2
|
464 |
|
williamr@2
|
465 |
// Prohibit copy constructor
|
williamr@2
|
466 |
CPosLmCategoryManager( const CPosLmCategoryManager& );
|
williamr@2
|
467 |
// Prohibit assigment operator
|
williamr@2
|
468 |
CPosLmCategoryManager& operator= ( const CPosLmCategoryManager& );
|
williamr@2
|
469 |
|
williamr@2
|
470 |
private:
|
williamr@2
|
471 |
|
williamr@2
|
472 |
// Implementation UID
|
williamr@2
|
473 |
TUid iDtorIdKey;
|
williamr@2
|
474 |
|
williamr@2
|
475 |
};
|
williamr@2
|
476 |
|
williamr@2
|
477 |
#endif // CPOSLMCATEGORYMANAGER_H
|
williamr@2
|
478 |
|
williamr@2
|
479 |
|