caknmemoryselectiondialogmultidrive.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name        : CAknMemorySelectionDialogMultiDrive.h
00004 *  Part of     : Common File Dialogs / CommonDialogs.dll
00005 *  Description : New memory selection dialog to support multiple drives.
00006 *  Version     : %version: 1 % << Don't touch! Updated by Synergy at check-out.
00007 *
00008 *  Copyright 2007 Nokia.  All rights reserved.
00009 *  This material, including documentation and any related computer
00010 *  programs, is protected by copyright controlled by Nokia.  All
00011 *  rights are reserved.  Copying, including reproducing, storing,
00012 *  adapting or translating, any or all of this material requires the
00013 *  prior written consent of Nokia.  This material also contains
00014 *  confidential information which may not be disclosed to others
00015 *  without the prior written consent of Nokia.
00016 * ============================================================================
00017 * Template version: 4.1
00018 */
00019 
00020 
00021 #ifndef C_AKNMEMORYSELECTIONDIALOGMULTIDRIVE_H
00022 #define C_AKNMEMORYSELECTIONDIALOGMULTIDRIVE_H
00023 
00024 #include <CAknCommonDialogsBase.h>
00025 #include <badesca.h> // CDesCArray
00026 #include <f32file.h> // TDriveNumber
00027 
00028 class CAknMemorySelectionModelMultiDrive;
00029 class CAknMemorySelectionEventHandler;
00030 class MAknMemorySelectionObserver;
00031 class TDriveInfo;
00032 class CAknIconArray;
00033 
00043 NONSHARABLE_CLASS( CAknMemorySelectionDialogMultiDrive )
00044     : public CAknCommonDialogsBase
00045     {
00046 public:
00047 
00048 
00049 // Constructors and destructors
00050 
00061     IMPORT_C static CAknMemorySelectionDialogMultiDrive* NewL(
00062         TCommonDialogType aDialogType,
00063         TBool aShowUnavailableDrives );
00064 
00065 
00078     IMPORT_C static CAknMemorySelectionDialogMultiDrive* NewL(
00079         TCommonDialogType aDialogType,
00080         TInt aResourceId,
00081         TBool aShowUnavailableDrives );
00082 
00097     IMPORT_C static CAknMemorySelectionDialogMultiDrive* NewL(
00098         TCommonDialogType aDialogType,
00099         TInt aResourceId,
00100         TBool aShowUnavailableDrives,
00101         TInt aIncludedMedias );
00102 
00103     IMPORT_C virtual ~CAknMemorySelectionDialogMultiDrive();
00104 
00105 // New functions
00106 
00113     IMPORT_C void SetTitleL( const TDesC& aText );
00114 
00121     IMPORT_C void SetLeftSoftkeyL( const TDesC& aText );
00122 
00128     IMPORT_C void SetRightSoftkeyL( const TDesC& aText );
00129 
00137     IMPORT_C void GetItem( TInt aIndex, TDes& aItem );
00138 
00139 
00150     IMPORT_C virtual TReturnKey ExecuteL( TDriveNumber& aSelectedDrive );
00151 
00166     IMPORT_C virtual TReturnKey ExecuteL(
00167         TDriveNumber& aSelectedDrive,
00168         TDes* aRootPath, TDes* aDefaultFolder );
00169 
00176     IMPORT_C static TBool RunDlgLD( TDriveNumber& aSelectedDrive );
00177 
00185     IMPORT_C static TBool RunDlgLD(
00186         TDriveNumber& aSelectedDrive, const TDesC& aTitle );
00187 
00194     IMPORT_C static TBool RunDlgLD(
00195         TDriveNumber& aSelectedDrive,
00196         TInt aResourceId,
00197         TDes* aRootPath = NULL,
00198         TDes* aDefaultFolder = NULL );
00199 
00206     TInt NumberOfItems() const;
00207 
00225     TInt GetDrivePaths( TDriveNumber aDrive,
00226                         TDes* aRootPath,
00227                         TDes* aDefaultFolder );
00228 
00248     TInt GetDrivePaths( TInt aLbxIndex,
00249                         TDes* aRootPath,
00250                         TDes* aDefaultFolder );
00251 
00281     IMPORT_C TInt AddDrivePathsL( const TDesC& aRootPath,
00282                                   const TDesC& aDefaultFolder );
00283     
00293     IMPORT_C TInt FindIndexByDrive( const TDriveNumber& aDrive );
00294     
00301     TDriveNumber FindDriveByIndex( const TInt aIndex );
00302     
00309     TBool HasUnavailbleMMC();
00310     
00311 protected:
00312 
00313 // Constructors and destructors
00314 
00315     CAknMemorySelectionDialogMultiDrive( TCommonDialogType aDialogType );
00316 
00324     virtual void ConstructFromResourceL(
00325         TInt aResourceId,
00326         TBool aShowUnavailableDrives );
00327 
00337     virtual void ConstructFromResourceL(
00338         TInt aResourceId,
00339         TBool aShowUnavailableDrives,
00340         TInt aIncludedMedias );
00341         
00342 private:
00343 
00344 //  New functions
00345 
00361     static TBool RunL(
00362         TInt aResourceId,
00363         TDriveNumber& aSelectedDrive,
00364         TDes* aRootPath,
00365         TDes* aDefaultFolder,
00366         const TDesC& aTitle );
00367 
00371     void SetResourceId( TInt& aResourceId, TCommonDialogType aDialogType )
00372         const;
00373 
00377     void ReadFromResourceL( TInt aResourceId );
00378 
00384     void LoadIconsL( CAknIconArray* aIconArray, TBool aDoubleStyle );
00385 
00392     void GetSystemDrivesL();
00393 
00394 protected:
00395 
00396 // Data
00397 
00398     // Own: Dialog type
00399     TCommonDialogType iDialogType;
00400 
00401     // Own: Model
00402     CAknMemorySelectionModelMultiDrive* iModel;
00403 
00404     // Own: Event handler
00405     CAknMemorySelectionEventHandler* iEventHandler;
00406 
00407     // Own: Title
00408     HBufC* iTitle;
00409 
00410     // Own: Left softkey text
00411     HBufC* iLeftSoftkey;
00412 
00413     // Own: Right softkey text
00414     HBufC* iRightSoftkey;
00415 
00416     // Own: Root path array
00417     // iDynamicDrivesEnabled indicates the content of this array.
00418     CDesCArrayFlat iRootPathArray;
00419 
00420     // Own: Default folder array
00421     CDesCArrayFlat iDefaultFolderArray;
00422 
00423     // Own: ETrue if dynamic drive reading is enabled
00424     //      EFalse if drives are static (C: and E:).
00425     // This affects iRootPathArray and iDefaultFolderArray content and
00426     // ordering.
00427     TBool iDynamicDrivesEnabled;
00428 
00432     TInt iIncludedMedias;
00433     
00434     };
00435 
00436 #endif // C_AKNMEMORYSELECTIONDIALOGMULTIDRIVE_H

Copyright © Nokia Corporation 2001-2008
Back to top