|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
00001 /* 00002 * ============================================================================== 00003 * Name : LandmarksLmOpWrapper.h 00004 * Part of : Landmark Reference Application 00005 * Interface : - 00006 * Description : See class description below 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_LM_OP_WRAPPER_H__ 00017 #define __LANDMARKS_LM_OP_WRAPPER_H__ 00018 00019 // INCLUDES 00020 #include <e32base.h> 00021 00022 // FORWARD DECLARATIONS 00023 class CLandmarksListContainer; 00024 class CAknNavigationDecorator; 00025 class CLandmarksEngine; 00026 class CPosLmOperation; 00027 00028 // CLASS DECLARATION 00029 00030 /** 00031 * Active class that wraps an instance of CPosLmOperation. 00032 * The wrapped CPosLmOperation instance is executed incrementally. 00033 * Execution progress can be reported. 00034 * This class is designed to be utilized by active objects. 00035 */ 00036 class CLandmarksLmOpWrapper: public CActive 00037 { 00038 public: // Constructors and destructor 00039 00040 /** 00041 * C++ default constructor. 00042 * 00043 */ 00044 CLandmarksLmOpWrapper(); 00045 00046 /** 00047 * Destructor. 00048 */ 00049 ~CLandmarksLmOpWrapper(); 00050 00051 public: // New Functions 00052 00053 /** 00054 * Starts execution of the supplied operation. 00055 * 00056 * @param aLmOperation operation to execute. Ownership of the operation 00057 * is transferred to this instance. 00058 * @param aStatus the request status to complete when execution of the 00059 * supplied LmOperation is finished. 00060 * @param aReportProgress ETrue if progress should be reported 00061 * (incremental execution), EFalse otherwise. 00062 */ 00063 void StartOperation( 00064 CPosLmOperation* aLmOperation, 00065 TRequestStatus& aStatus, 00066 TBool aReportProgress = EFalse); 00067 00068 /** 00069 * Returns a pointer to the wrapped CPosLmOperation object. 00070 * This object keeps ownership of the operation. 00071 * 00072 * @return a pointer to a CPosLmOperation instance 00073 */ 00074 CPosLmOperation* LmOperationPtr(); 00075 00076 /** 00077 * Executes the next step of the incremental operation. Typically 00078 * called when progress of the CPosLmOperaiotion is reported. 00079 * 00080 * @param aStatus the request status to complete when execution of the 00081 * next step is finished. 00082 */ 00083 void ExecuteNextStep(TRequestStatus& aStatus); 00084 00085 /** 00086 * Return the current progress of the CPosLmnOperation. 00087 * 00088 * @return a number between 0-100. 100 means that the operation is 00089 * completed 00090 */ 00091 TInt Progress(); 00092 00093 protected: // from CActive 00094 00095 /** 00096 * Implements cancellation of an outstanding request. 00097 */ 00098 void DoCancel(); 00099 00100 /** 00101 * Handles an active object’s request completion event. 00102 */ 00103 void RunL(); 00104 00105 private: 00106 00107 /** 00108 * Executes the next step of the incremental operation. 00109 */ 00110 void ExecuteNextStep(); 00111 00112 private: // Data 00113 00114 //! the wrapped CPosLmOperation that is executed 00115 CPosLmOperation* iLmOperation; 00116 00117 //! contains a value between 0-1 and indicates the progress 00118 TReal32 iProgress; 00119 00120 //! the req. status of the caller executing the operation 00121 TRequestStatus* iCallerStatus; 00122 00123 //! indicates if progress should be reported or not 00124 TBool iReportProgress; 00125 00126 }; 00127 00128 00129 #endif // __LANDMARKS_LM_OP_WRAPPER_H__ 00130 00131 // End of File 00132
|
© Nokia 2006 |