|
1 /* |
|
2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description:handles icon paths in the database. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef POSLMICONHANDLER_H |
|
20 #define POSLMICONHANDLER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CPosLmLocalDbAccess; |
|
27 |
|
28 // CLASS DECLARATION |
|
29 |
|
30 /** |
|
31 * Class containing static functions that handles icon paths in the database. |
|
32 */ |
|
33 class PosLmIconHandler |
|
34 { |
|
35 |
|
36 public: // New functions |
|
37 |
|
38 /** |
|
39 * Gets the icon path id from the landmark database for the specified |
|
40 * icon path. If the icon path does not exist it will be added to |
|
41 * the database. |
|
42 * |
|
43 * @param aDbAccess A database access. |
|
44 * @param aIconPath Icon path. |
|
45 * @param aIconPathId The icon id for the specified icon path. |
|
46 */ |
|
47 static void GetIconPathIdL( |
|
48 /* IN */ CPosLmLocalDbAccess& aDbAccess, |
|
49 /* IN */ const TDesC& aIconPath, |
|
50 /* OUT */ TUint32& aIconPathId |
|
51 ); |
|
52 |
|
53 /** |
|
54 * Gets the icon path from the landmark database with the specified |
|
55 * icon path id. |
|
56 * |
|
57 * @param aDbAccess A database access. |
|
58 * @param aIconPathId Icon path id. |
|
59 * @param aIconPath Icon path. Enough memory must be allocated by user |
|
60 * to hold the icon path (preferably buffer of KMaxFileName size). |
|
61 * @return KErrNone if found. KErrNotFound if not found. |
|
62 */ |
|
63 static TInt GetIconPathL( |
|
64 /* IN */ CPosLmLocalDbAccess& aDbAccess, |
|
65 /* IN */ TUint32 aIconPathId, |
|
66 /* OUT */ TDes& aIconPath |
|
67 ); |
|
68 |
|
69 /** |
|
70 * Removes an icon path from the landmark database if it is not used by |
|
71 * any category or landmark. |
|
72 * |
|
73 * @param aDbAccess A database access. |
|
74 * @param aIconId Icon path id. |
|
75 */ |
|
76 static void RemoveIconIfNotUsedL( |
|
77 /* IN */ CPosLmLocalDbAccess& aDbAccess, |
|
78 /* IN */ const TUint32& aIconPathId |
|
79 ); |
|
80 |
|
81 private: |
|
82 |
|
83 /** |
|
84 * Adds an icon path to the landmark database. |
|
85 * |
|
86 * @param aDbAccess A database access. |
|
87 * @param aIconPath The icon path to add. |
|
88 * @param aIconPathid Icon path id of the added icon path. |
|
89 */ |
|
90 static void AddIconPathL( |
|
91 /* IN */ CPosLmLocalDbAccess& aDbAccess, |
|
92 /* IN */ const TDesC& aIconPath, |
|
93 /* OUT */ TUint32& aIconPathId |
|
94 ); |
|
95 |
|
96 }; |
|
97 |
|
98 #endif // POSLMICONHANDLER_H |
|
99 |
|
100 // End of File |