|
1 /* |
|
2 * Copyright (c) 2006 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: Definition of MNcdFavoriteManager interface |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef M_NCDFAVORITEMANAGER_H |
|
20 #define M_NCDFAVORITEMANAGER_H |
|
21 |
|
22 #include "catalogsbase.h" |
|
23 #include "ncdinterfaceids.h" |
|
24 |
|
25 class MNcdNode; |
|
26 |
|
27 /** |
|
28 * Favorite manager interface. |
|
29 * |
|
30 * This interface describes a favorite manager. Favorite manager |
|
31 * provides methods for favorite node management. |
|
32 * |
|
33 * |
|
34 */ |
|
35 class MNcdFavoriteManager : public virtual MCatalogsBase |
|
36 { |
|
37 |
|
38 public: |
|
39 |
|
40 /** |
|
41 * Unique identifier for the interface, required for all MCatalogsBase interfaces. |
|
42 * |
|
43 * |
|
44 */ |
|
45 enum { KInterfaceUid = ENcdFavoriteManagerUid }; |
|
46 |
|
47 /** |
|
48 * Get the number of favorite nodes. |
|
49 * |
|
50 * |
|
51 * @return The number of favorite nodes. |
|
52 */ |
|
53 virtual TInt FavoriteNodeCount() const = 0; |
|
54 |
|
55 /** |
|
56 * Get a favorite node by the given index. |
|
57 * |
|
58 * |
|
59 * @param aIndex The node index. |
|
60 * @return The favorite node. |
|
61 * @leave KErrNotFound If the index is out of range. |
|
62 */ |
|
63 virtual MNcdNode* FavoriteNodeL( TInt aIndex ) const = 0; |
|
64 |
|
65 /** |
|
66 * Get the index of a favorite node in the favorite list. |
|
67 * |
|
68 * Note that the actual favorite node may be different node but |
|
69 * it has the same metadata. That is, asking a favorite node |
|
70 * with FavoriteNodeL with the index returned by this method may |
|
71 * return a node with different id and namespace. |
|
72 * |
|
73 * |
|
74 * @param aNamespace Namespace of the node. |
|
75 * @param aId Id of the node. |
|
76 * @leave KErrNotFound If the node is not favorite, in other error |
|
77 * cases system wide error code. |
|
78 */ |
|
79 virtual TInt FavoriteIndexL( |
|
80 const TDesC& aNamespace, const TDesC& aId ) const = 0; |
|
81 |
|
82 /** |
|
83 * Removes all the favorite nodes. |
|
84 * |
|
85 * |
|
86 * @exception Leave System wide error code. |
|
87 */ |
|
88 virtual void ClearFavoritesL() = 0; |
|
89 |
|
90 protected: // Destruction |
|
91 |
|
92 /** |
|
93 * Destructor. |
|
94 * |
|
95 * @see MCatalogsBase::~MCatalogsBase |
|
96 */ |
|
97 virtual ~MNcdFavoriteManager() {} |
|
98 }; |
|
99 |
|
100 #endif // M_NCDFAVORITEMANAGER_H |