00001 /* 00002 * ============================================================================== 00003 * Name : CDownloadMgrUiUserInteractions.h 00004 * Part of : Download Manager / UI Lib 00005 * Interface : UI Lib, User Interaction and Dialogs 00006 * Description : Supports user interaction dialogs for downloads 00007 * Version : - 00008 * 00009 * Copyright © 2002-2004 Nokia. All rights reserved. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia. All rights are reserved. Copying, including 00013 * reproducing, storing, adapting or translating, any 00014 * or all of this material requires the prior written consent of 00015 * Nokia. This material also contains confidential 00016 * information which may not be disclosed to others without the 00017 * prior written consent of Nokia. 00018 * ============================================================================== 00019 */ 00020 00021 00022 #ifndef CDOWNLOADMGRUIUSERINTERACTIONS_H 00023 #define CDOWNLOADMGRUIUSERINTERACTIONS_H 00024 00025 // INCLUDES 00026 #include <CDownloadMgrUiBase.h> 00027 #include <DownloadMgrClient.h> 00028 #include <vwsdef.h> 00029 00030 // CONSTANTS 00031 00032 // DATA TYPES 00033 enum TClientAppExitType 00034 { 00035 ETerminatedByUser, 00036 ETerminatedBySystem 00037 }; 00038 00039 // FORWARD DECLARATIONS 00040 class CUserInteractionsUtils; 00041 class CDownloadMgrUiLibRegistry; 00042 class CAsyncEventHandlerArray; 00043 class CEikAppUi; 00044 class CUserInteractionsExtension; 00045 00046 // CLASS DECLARATION 00047 00060 NONSHARABLE_CLASS( CDownloadMgrUiUserInteractions ) : 00061 public CDownloadMgrUiBase, 00062 public MHttpDownloadMgrObserver 00063 { 00064 public: // Constructors and destructor 00065 00069 static CDownloadMgrUiUserInteractions* NewL 00070 ( CDownloadMgrUiLibRegistry& aRegistryModel ); 00071 00075 virtual ~CDownloadMgrUiUserInteractions(); 00076 00077 public: // New functions 00078 00085 IMPORT_C TBool OkToExitL(); 00086 00101 IMPORT_C TInt PrepareToExit( CEikAppUi& aAppUi, 00102 TClientAppExitType aExitType, 00103 TVwsViewId aViewId, 00104 TUid aCustomMessageId, 00105 const TDesC8& aViewActivationMsg ); 00106 00116 IMPORT_C TInt PrepareToExit( TUint32 aAppUid, 00117 TUint32 aViewId, 00118 TUint32 aCustomMessageId ); 00119 00127 IMPORT_C void HandleDownloadL( RHttpDownload& aDownload ); 00128 00133 TInt DownloadConfirmationsShown() const; 00134 00140 TBool IsUiBusy() const; 00141 00146 TBool IsCodServiceFlowRunning() const; 00147 00153 TBool IsCodServiceFlowRunning( RHttpDownload& aDownload ) const; 00154 00160 TBool IsCodServiceFlowRunningL() const; 00161 00168 TBool IsCodServiceFlowRunningL( RHttpDownload& aDownload ) const; 00169 00176 void PostponeCodHandlingL( RHttpDownload& aDownload ); 00177 00183 TBool IsPostponed( RHttpDownload& aDownload ) const; 00184 00188 void SchedulePostponedDownloadL(); 00189 00190 public: // Functions from CDownloadMgrUiBase 00191 00193 enum TDownloadMgrUiUserInteractionsAttr 00194 { 00195 EAttrSuppressDownloadConfirmation 00196 }; 00197 00198 IMPORT_C virtual void GetIntAttributeL( const TUint aAttribute, TInt32& aValue ); 00199 IMPORT_C virtual void GetBoolAttributeL( const TUint aAttribute, TBool& aValue ); 00200 IMPORT_C virtual void GetStringAttributeL( const TUint aAttribute, TDes16& aValue ); 00201 IMPORT_C virtual void GetStringAttributeL( const TUint aAttribute, TDes8& aValue ); 00202 IMPORT_C virtual void SetIntAttributeL( const TUint aAttribute, TInt32 aValue ); 00203 IMPORT_C virtual void SetBoolAttributeL( const TUint aAttribute, TBool aValue ); 00204 IMPORT_C virtual void SetStringAttributeL( const TUint aAttribute, const TDesC16& aValue ); 00205 IMPORT_C virtual void SetStringAttributeL( const TUint aAttribute, const TDesC8& aValue ); 00206 00207 protected: // Constructors 00208 00212 CDownloadMgrUiUserInteractions( CDownloadMgrUiLibRegistry& aRegistryModel ); 00213 00217 void ConstructL(); 00218 00219 protected: // New functions 00220 00221 // Event handler functions 00222 00228 void HandleCompletionWithQueryL( RHttpDownload& aDownload, 00229 TBool aIsUiBusy, 00230 TBool aIsSupported, 00231 TBool aIsDrm, 00232 TBool aDrmRightsOnPhone ); 00233 00238 void PrepareToExitL( CEikAppUi* aAppUi, 00239 TClientAppExitType aExitType, 00240 TVwsViewId aViewId, 00241 TUid aCustomMessageId, 00242 const TDesC8& aViewActivationMsg ); 00243 00248 TBool IsStandAloneAppRunning(); 00249 00254 void DeleteEventHandlerShowingDlConfirmation( RHttpDownload& aDownload ); 00255 00260 void DeleteEventHandlers( RHttpDownload& aDownload ); 00261 00267 void HandleNormalDownloadL( RHttpDownload& aDownload ); 00268 00274 TBool CodDownloadL( RHttpDownload& aDownload ) const; 00275 00276 protected: // Functions from MHttpDownloadMgrObserver 00277 00278 virtual void HandleDMgrEventL( RHttpDownload& aDownload, 00279 THttpDownloadEvent aEvent ); 00280 00281 private: // Data 00282 00283 CUserInteractionsExtension* iExtension; 00284 00285 CUserInteractionsUtils* iUiUtils; 00287 CAsyncEventHandlerArray* iEventHandlerArray; 00288 00289 private: // Friend classes 00290 00291 friend class CUserInteractionsExtension; 00292 }; 00293 00294 #endif /* CDOWNLOADMGRUIUSERINTERACTIONS_H */