|
1 /* |
|
2 * Copyright (c) 2004 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: LandmarksUi Content File - Base class for landmark list provider |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef CLMKLISTPROVIDERBASE_H |
|
26 #define CLMKLISTPROVIDERBASE_H |
|
27 |
|
28 // INCLUDES |
|
29 #include "MLmkListProviderObserver.h" |
|
30 #include <e32base.h> // CBase |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 class CLmkUiItemBase; |
|
34 class MLmkSelectorIconMgr; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * CLmkListProviderBase class |
|
40 */ |
|
41 class CLmkListProviderBase : public CBase |
|
42 { |
|
43 public: // Constructors and destructor |
|
44 /** |
|
45 * Don't delete during asynchronous operation, otherwise |
|
46 * observer(s) won't be notified! |
|
47 */ |
|
48 ~CLmkListProviderBase(); |
|
49 |
|
50 public: // New functions |
|
51 /** |
|
52 * Asynchronous initialization. |
|
53 */ |
|
54 virtual void InitializeL() = 0; |
|
55 |
|
56 /** |
|
57 * Return item at the specified position within the array. |
|
58 * @param aIndex |
|
59 * @return CLmkUiItemBase pointer |
|
60 */ |
|
61 virtual CLmkUiItemBase* ItemAtL( TInt aIndex ) = 0; |
|
62 |
|
63 /** |
|
64 * Returns the number of elements held in the array. |
|
65 * @return TInt |
|
66 */ |
|
67 virtual TInt ItemCount() const = 0; |
|
68 |
|
69 virtual TBool StartSearchingLandmarksL(const TDesC& aSearchPattern, |
|
70 TBool aSearchOnlyInPreviousMatches) = 0; |
|
71 |
|
72 /** |
|
73 * Add observer |
|
74 * @param aObserver |
|
75 */ |
|
76 IMPORT_C void AddObserverL( MLmkListProviderObserver& aObserver ); |
|
77 |
|
78 /** |
|
79 * Remove observer |
|
80 * @return KErrNotFound if observer wasn't found, KErrNone otherwise |
|
81 */ |
|
82 IMPORT_C TInt RemoveObserver( MLmkListProviderObserver& aObserver ); |
|
83 |
|
84 /** |
|
85 * Must be called in order to have icons available. Can be called |
|
86 * repeatedly to take new icon mgr into use. |
|
87 * @param aIconMgr |
|
88 */ |
|
89 IMPORT_C void SetIconMgrL( MLmkSelectorIconMgr& aIconMgr ); |
|
90 |
|
91 protected: // New functions |
|
92 /** |
|
93 * Notify observer |
|
94 * @param aEvent |
|
95 */ |
|
96 void NotifyObservers( TLmkListProviderEventType aEvent ); |
|
97 |
|
98 /** |
|
99 * Notify errors to observer |
|
100 * @param aError |
|
101 */ |
|
102 void NotifyError( TInt aError ); |
|
103 |
|
104 protected: // Constructors and destructor |
|
105 /** |
|
106 * C++ default constructor. |
|
107 * @return newly instantiated object |
|
108 */ |
|
109 CLmkListProviderBase(); |
|
110 |
|
111 /** |
|
112 * Symbian 2nd phase constructor |
|
113 */ |
|
114 void BaseConstructL(); |
|
115 |
|
116 protected: // Data |
|
117 ///Ref: |
|
118 MLmkSelectorIconMgr* iIconMgr; |
|
119 |
|
120 private: // Data |
|
121 // observers not own |
|
122 RPointerArray<MLmkListProviderObserver> iObservers; |
|
123 }; |
|
124 |
|
125 #endif // CLMKLISTPROVIDERBASE_H |
|
126 |
|
127 // End of File |