|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
00001 /* 00002 * ============================================================================== 00003 * Name : LandmarksEngineBase.h 00004 * Part of : Landmark Reference Application 00005 * Interface : - 00006 * Description : The base class for engines 00007 * Version : 1.0 00008 * 00009 * Copyright (c) 2004-2006 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. 00013 * ============================================================================== 00014 */ 00015 00016 #ifndef __LANDMARKS_ENGINE_BASE_H__ 00017 #define __LANDMARKS_ENGINE_BASE_H__ 00018 00019 // INCLUDES 00020 #include <e32base.h> 00021 #include <EPos_Landmarks.h> 00022 00023 // FORWARD DECLARATIONS 00024 class CPosLandmarkDatabase; 00025 class CPosLandmarkSearch; 00026 class CLandmarksLmOpWrapper; 00027 00028 // CLASS DECLARATION 00029 00030 /** 00031 * Abstract base class for sub engines. 00032 * 00033 */ 00034 class CLandmarksEngineBase : public CActive 00035 { 00036 public: // Constructors and destructor 00037 00038 /** 00039 * Destructor. 00040 */ 00041 ~CLandmarksEngineBase(); 00042 00043 public: // New functions 00044 00045 /** 00046 * SetPrio updates the @ref iPriority data member. 00047 * 00048 * @param aPriority the priority to set 00049 */ 00050 void SetPrio(CActive::TPriority aPriority); 00051 00052 protected: // From CActive 00053 00054 /** 00055 * RunL should be implemented by sub classes. 00056 */ 00057 virtual void RunL() = 0; 00058 00059 /** 00060 * DoCancel should be implemented by sub classes. 00061 */ 00062 virtual void DoCancel() = 0; 00063 00064 /** 00065 * RunError should be implemented by sub classes in case RunL might 00066 * leave. 00067 */ 00068 virtual TInt RunError(TInt aError) = 0; 00069 00070 protected: // New functions 00071 00072 /** 00073 * C++ constructor. 00074 * 00075 * @param aDb an instance of the default landmark database 00076 */ 00077 CLandmarksEngineBase(CPosLandmarkDatabase& aDb); 00078 00079 /** 00080 * By default Symbian 2nd phase constructor is private. 00081 */ 00082 void ConstructL(); 00083 00084 /** 00085 * SetPriorityAndSetActive updates the priority of this active object 00086 * if necessary and sets it to active. This method should be used by sub 00087 * classes rather than CActive::SetActive() 00088 */ 00089 void SetPriorityAndSetActive(); 00090 00091 protected: // Data 00092 00093 //! The default landmark database 00094 CPosLandmarkDatabase& iDb; 00095 00096 //! Used for searching the database 00097 CPosLandmarkSearch* iSearcher; 00098 00099 //! An active object wrapping a CPosLmOperation object 00100 CLandmarksLmOpWrapper* iLmOpWrapper; 00101 00102 private: // Data 00103 00104 //! Used when setting priority of this active object 00105 CActive::TPriority iPriority; 00106 }; 00107 00108 00109 #endif // __LANDMARKS_ENGINE_BASE_H__ 00110 00111 // End of File 00112
|
© Nokia 2006 |