|
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 - |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 #ifndef CLMKSEARCHEDLMLISTPROVIDER_H |
|
27 #define CLMKSEARCHEDLMLISTPROVIDER_H |
|
28 |
|
29 // INCLUDES |
|
30 #include "CLmkLmItemListProvider.h" |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 class CPosLmPartialReadParameters; |
|
34 class CPosLmSearchCriteria; |
|
35 class CPosLandmarkSearch; |
|
36 class CPosLmOperation; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * CLmkSearchedLmListProvider class |
|
42 */ |
|
43 class CLmkSearchedLmListProvider : public CLmkLmItemListProvider |
|
44 { |
|
45 public: // Constructors and destructor |
|
46 |
|
47 /** |
|
48 * Creates a provider that considers all items in a database. |
|
49 * @param aDb landmark database reference |
|
50 * @param aCriteria reference to used search criteria |
|
51 * @return newly instantiated object |
|
52 */ |
|
53 static CLmkSearchedLmListProvider* NewL( CPosLandmarkDatabase& aDb, |
|
54 CPosLmSearchCriteria& aCriteria ); |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 ~CLmkSearchedLmListProvider(); |
|
60 |
|
61 public: // From CLmkListProviderBase |
|
62 CLmkUiItemBase* ItemAtL( TInt aIndex ); |
|
63 |
|
64 protected: // From MLmkAOOperationObserver |
|
65 void HandleOperationL( TOperationTypes aType, |
|
66 TReal32 aProgress, |
|
67 TInt aStatus ); |
|
68 |
|
69 protected: // From MLmkDbObserver |
|
70 void HandleDatabaseEvent( TPosLmEvent& aEvent ); |
|
71 |
|
72 protected: // From CLmkLmItemListProvider |
|
73 void PrepareListL(); |
|
74 TBool PrepareListL(const TDesC& aSearchPattern, |
|
75 TBool aSearchOnlyInPreviousMatches); |
|
76 void RemoveLandmarksL(const RArray<TPosLmItemId>& aSelectedItems ) ; |
|
77 |
|
78 protected: // New methods |
|
79 /** |
|
80 * Read items to array |
|
81 */ |
|
82 void ReadItemsToArrayL(); |
|
83 |
|
84 /** |
|
85 * * Prepare items for deletion |
|
86 * iType must be set before using this method |
|
87 */ |
|
88 void PrepareForDeleteL(); |
|
89 |
|
90 /** |
|
91 * * Starts the second search to seach the data with owned category |
|
92 */ |
|
93 void StartSecondSearchL(); |
|
94 |
|
95 private: // Constructors and destructor |
|
96 /** |
|
97 * C++ default constructor. |
|
98 * @return newly instantiated object |
|
99 */ |
|
100 CLmkSearchedLmListProvider(); |
|
101 |
|
102 /** |
|
103 * C++ constructor. |
|
104 * @param aDb |
|
105 * @param aCriteria |
|
106 * @return newly instantiated object |
|
107 */ |
|
108 CLmkSearchedLmListProvider( CPosLandmarkDatabase& aDb, |
|
109 CPosLmSearchCriteria& aCriteria ); |
|
110 |
|
111 /** |
|
112 * By default Symbian 2nd phase constructor is private. |
|
113 */ |
|
114 void ConstructL(); |
|
115 |
|
116 private: // Data |
|
117 ///Ref: |
|
118 CPosLmSearchCriteria& iCriteria; |
|
119 |
|
120 ///Own: |
|
121 CPosLmPartialReadParameters* iReadParams; |
|
122 |
|
123 ///Own: |
|
124 CPosLandmarkSearch* iSearch; |
|
125 |
|
126 ///Own: |
|
127 CLmkAOOperation* iSearchAO; |
|
128 TBool iCatDelete; |
|
129 TBool iCatUpdate; |
|
130 |
|
131 TBool iIsSecondSearchStarted; |
|
132 }; |
|
133 |
|
134 #endif // CLMKSEARCHEDLMLISTPROVIDER_H |
|
135 |
|
136 // End of File |