00001 /* 00002 * ============================================================================ 00003 * Name : AknProgressDialog.h 00004 * Part of : Avkon 00005 * 00006 * Description: 00007 * CAknProgressDialog should be used when the progress of the process 00008 * can be traced and the length of the process is known. If that's not 00009 * the case please use CAknWaitDialog. 00010 * Version: 00011 * 00012 * Copyright © 2002 Nokia Corporation. 00013 * This material, including documentation and any related 00014 * computer programs, is protected by copyright controlled by 00015 * Nokia Corporation. All rights are reserved. Copying, 00016 * including reproducing, storing, adapting or translating, any 00017 * or all of this material requires the prior written consent of 00018 * Nokia Corporation. This material also contains confidential 00019 * information which may not be disclosed to others without the 00020 * prior written consent of Nokia Corporation. 00021 * ============================================================================ 00022 */ 00023 00024 #ifndef __AKN_PROGRESS_DIALOG__ 00025 #define __AKN_PROGRESS_DIALOG__ 00026 00027 #include <aknnotedialog.h> 00028 #include <aknprogresstimer.h> 00029 00030 class CEikProgressInfo; 00031 00037 class MProgressDialogCallback 00038 { 00039 public: 00044 virtual void DialogDismissedL( TInt aButtonId ) = 0; 00045 }; 00046 00047 00129 class CAknProgressDialog : public CAknNoteDialog 00130 { 00131 public: 00142 IMPORT_C CAknProgressDialog(TInt aFinalValue,TInt anIncrement,TInt anInterval, CEikDialog** aSelfPtr); 00143 00152 IMPORT_C CAknProgressDialog(CEikDialog** aSelfPtr); 00153 00165 IMPORT_C CAknProgressDialog(CEikDialog** aSelfPtr,TBool aVisibilityDelayOff); 00166 00170 IMPORT_C virtual ~CAknProgressDialog(); 00171 00176 IMPORT_C virtual TInt RunLD(); 00177 00181 IMPORT_C CEikProgressInfo* GetProgressInfoL(); 00182 00186 IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); 00187 00192 IMPORT_C void ProcessFinishedL(); 00193 00199 IMPORT_C void SetCallback( MProgressDialogCallback* aCallback ); 00200 00206 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); 00207 00208 protected: 00212 enum TProgressDialogState 00213 { 00214 EProcessOnDisplayOff, 00215 EProcessOnDisplayOn, 00216 EProcessOffDisplayOff, 00217 EProcessOffDisplayOn, 00218 EProcessOffDisplayOnCanBeDismissed, 00219 EProcessOnDisplayOnCanBeDismissed 00220 }; 00221 00225 IMPORT_C void PreLayoutDynInitL(void); 00226 00232 static TInt DialogTimerCallback(TAny* aPtr); 00233 00237 TInt DialogTimerEvent(); 00238 00246 IMPORT_C TBool OkToExitL(TInt aButtonId); 00247 00248 private: 00252 IMPORT_C void* ExtensionInterface( TUid aInterface ); 00253 00254 protected: 00256 CPeriodic* iProgressDialogTimer; 00258 TProgressDialogState iState; 00260 TTimerModel iModel; 00262 MProgressDialogCallback* iCallback; 00265 TBool iVisibilityDelayOff; 00266 00267 private: 00268 // Boolean to declare whether the progress is handled by 00269 // an internal timer 00270 TBool iInternalTimerControl; 00271 // Timer to handle progress if iInternalTimerControl is 00272 // set to ETrue 00273 CAknProgressTimer* iProgressTimer; 00274 00275 TInt iSpare[4]; 00276 00277 private: 00278 IMPORT_C virtual void CEikDialog_Reserved_1(); 00279 IMPORT_C virtual void CEikDialog_Reserved_2(); 00280 private: 00281 IMPORT_C virtual void CAknNoteDialog_Reserved(); 00282 }; 00283 00284 #endif