1 /* |
|
2 * Copyright (c) 2004-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: The base class for engines |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __LANDMARKS_ENGINE_BASE_H__ |
|
20 #define __LANDMARKS_ENGINE_BASE_H__ |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <EPos_Landmarks.h> |
|
25 |
|
26 |
|
27 class CPosLandmarkDatabase; |
|
28 class CPosLandmarkSearch; |
|
29 class CLandmarksLmOpWrapper; |
|
30 |
|
31 |
|
32 |
|
33 /** |
|
34 * Abstract base class for sub engines. |
|
35 * |
|
36 */ |
|
37 class CLandmarksEngineBase : public CActive |
|
38 { |
|
39 public: // Constructors and destructor |
|
40 |
|
41 /** |
|
42 * Destructor. |
|
43 */ |
|
44 ~CLandmarksEngineBase(); |
|
45 |
|
46 public: // New functions |
|
47 |
|
48 /** |
|
49 * SetPrio updates the @ref iPriority data member. |
|
50 * |
|
51 * @param aPriority the priority to set |
|
52 */ |
|
53 void SetPrio(CActive::TPriority aPriority); |
|
54 |
|
55 protected: // From CActive |
|
56 |
|
57 /** |
|
58 * RunL should be implemented by sub classes. |
|
59 */ |
|
60 virtual void RunL() = 0; |
|
61 |
|
62 /** |
|
63 * DoCancel should be implemented by sub classes. |
|
64 */ |
|
65 virtual void DoCancel() = 0; |
|
66 |
|
67 /** |
|
68 * RunError should be implemented by sub classes in case RunL might |
|
69 * leave. |
|
70 */ |
|
71 virtual TInt RunError(TInt aError) = 0; |
|
72 |
|
73 protected: // New functions |
|
74 |
|
75 /** |
|
76 * C++ constructor. |
|
77 * |
|
78 * @param aDb an instance of the default landmark database |
|
79 */ |
|
80 CLandmarksEngineBase(CPosLandmarkDatabase& aDb); |
|
81 |
|
82 /** |
|
83 * By default Symbian 2nd phase constructor is private. |
|
84 */ |
|
85 void ConstructL(); |
|
86 |
|
87 /** |
|
88 * SetPriorityAndSetActive updates the priority of this active object |
|
89 * if necessary and sets it to active. This method should be used by sub |
|
90 * classes rather than CActive::SetActive() |
|
91 */ |
|
92 void SetPriorityAndSetActive(); |
|
93 |
|
94 protected: // Data |
|
95 |
|
96 //! The default landmark database |
|
97 CPosLandmarkDatabase& iDb; |
|
98 |
|
99 //! Used for searching the database |
|
100 CPosLandmarkSearch* iSearcher; |
|
101 |
|
102 //! An active object wrapping a CPosLmOperation object |
|
103 CLandmarksLmOpWrapper* iLmOpWrapper; |
|
104 |
|
105 private: // Data |
|
106 |
|
107 //! Used when setting priority of this active object |
|
108 CActive::TPriority iPriority; |
|
109 }; |
|
110 |
|
111 |
|
112 #endif // __LANDMARKS_ENGINE_BASE_H__ |
|
113 |
|
114 |
|