caknmemoryselectiondialog.h

Go to the documentation of this file.
00001 /*
00002 * ============================================================================
00003 *  Name        : CAknMemorySelectionDialog.h
00004 *  Part of     : Common File Dialogs / CommonDialogs.dll
00005 *  Description : Dialog used to selection target memory.
00006 *  Version     : %version: e003sa02#4 % << Don't touch! Updated by Synergy at check-out.
00007 *
00008 *  Copyright 2002-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 #ifndef C_AKNMEMORYSELECTIONDIALOG_H
00021 #define C_AKNMEMORYSELECTIONDIALOG_H
00022 
00023 #include <CAknCommonDialogsBase.h>
00024 #include <badesca.h> // CDesCArray
00025 
00026 class CAknMemorySelectionModel;
00027 class CAknMemorySelectionEventHandler;
00028 class MAknMemorySelectionObserver;
00029 class TDriveInfo;
00030 class CAknIconArray;
00031 
00038 NONSHARABLE_CLASS(CAknMemorySelectionDialog) : public CAknCommonDialogsBase
00039     {
00040 
00041 public:
00042 
00043 // Enumerations
00048     enum TMemory
00049         {
00050         EPhoneMemory = 0,   // C:
00051         EMemoryCard,        // E:
00052         EMemoryCount        // must remain last one
00053         };
00054 
00055 // Constructors and destructors
00056 
00067     IMPORT_C static CAknMemorySelectionDialog* NewL(
00068         TCommonDialogType aDialogType,
00069         TBool aShowUnavailableDrives );
00070 
00071 
00083     IMPORT_C static CAknMemorySelectionDialog* NewL(
00084         TCommonDialogType aDialogType,
00085         TInt aResourceId,
00086         TBool aShowUnavailableDrives );
00087 
00101     IMPORT_C static CAknMemorySelectionDialog* NewL(
00102         TCommonDialogType aDialogType,
00103         TInt aResourceId,
00104         TBool aShowUnavailableDrives,
00105         TInt aIncludedMedias );
00106 
00107     IMPORT_C virtual ~CAknMemorySelectionDialog();
00108 
00109 // New functions
00110 
00116     IMPORT_C void SetObserver( MAknMemorySelectionObserver* aObserver );
00117 
00123     IMPORT_C void SetTitleL( const TDesC& aText );
00124 
00130     IMPORT_C void SetLeftSoftkeyL( const TDesC& aText );
00131 
00137     IMPORT_C void SetRightSoftkeyL( const TDesC& aText );
00138 
00145     IMPORT_C void GetItem( TInt aIndex, TDes& aItem );
00146 
00158     IMPORT_C void GetMemories( TMemory aSelectedMemory,
00159                                TDes* aRootPath,
00160                                TDes* aDefaultFolder );
00161 
00171     IMPORT_C virtual TReturnKey ExecuteL( TMemory& aSelectedMemory );
00172 
00186     IMPORT_C virtual TReturnKey ExecuteL(
00187         TMemory& aSelectedMemory,
00188         TDes* aRootPath, TDes* aDefaultFolder );
00189 
00194     IMPORT_C static TBool RunDlgLD(
00195         TMemory& aSelectedMemory,
00196         MAknMemorySelectionObserver* aObserver = NULL );
00197 
00202     IMPORT_C static TBool RunDlgLD(
00203         TMemory& aSelectedMemory,
00204         const TDesC& aTitle,
00205         MAknMemorySelectionObserver* aObserver = NULL );
00206 
00211     IMPORT_C static TBool RunDlgLD(
00212         TMemory& aSelectedMemory,
00213         TInt aResourceId,
00214         TDes* aRootPath = NULL, TDes* aDefaultFolder = NULL,
00215         MAknMemorySelectionObserver* aObserver = NULL );
00216 
00223     TInt NumberOfItems() const;
00224 
00244     TInt GetDrivePaths( TInt aLbxIndex,
00245                         TDes* aRootPath,
00246                         TDes* aDefaultFolder );
00247 
00248 protected:
00249 
00250 // Constructors and destructors
00251 
00252     CAknMemorySelectionDialog( TCommonDialogType aDialogType );
00253 
00261     virtual void ConstructFromResourceL(
00262         TInt aResourceId,
00263         TBool aShowUnavailableDrives );
00264 
00274     virtual void ConstructFromResourceL(
00275         TInt aResourceId,
00276         TBool aShowUnavailableDrives,
00277         TInt aIncludedMedias );
00278 
00279 private:
00280 
00281 //  New functions
00282 
00298     static TBool RunL(
00299         TInt aResourceId,
00300         TMemory& aSelectedMemory,
00301         TDes* aRootPath,
00302         TDes* aDefaultFolder,
00303         const TDesC& aTitle,
00304         MAknMemorySelectionObserver* aObserver );
00305 
00306 
00310     void SetResourceId( TInt& aResourceId, TCommonDialogType aDialogType )
00311         const;
00312 
00319     void ReadFromResourceL( TInt aResourceId, TBool aResourceDefined );
00320 
00326     void LoadIconsL( CAknIconArray* aIconArray, TBool aDoubleStyle );
00327 
00331     void GetSystemPathsL();
00332 
00333 protected: // Data
00334 
00335     // Own: Dialog type
00336     TCommonDialogType iDialogType;
00337 
00338     // Own: Model
00339     CAknMemorySelectionModel* iModel;
00340 
00341     // Own: Event handler
00342     CAknMemorySelectionEventHandler* iEventHandler;
00343 
00344     // Ref: Observer
00345     MAknMemorySelectionObserver* iObserver;
00346 
00347     // Own: Title
00348     HBufC* iTitle;
00349 
00350     // Own: Left softkey text
00351     HBufC* iLeftSoftkey;
00352 
00353     // Own: Right softkey text
00354     HBufC* iRightSoftkey;
00355 
00356     // Own: Root path array
00357     // iDynamicDrivesEnabled indicates the content of this array.
00358     CDesCArrayFlat iRootPathArray;
00359 
00360     // Own: Default folder array
00361     CDesCArrayFlat iDefaultFolderArray;
00362 
00363     // Own: ETrue if dynamic drive reading is enabled
00364     //      EFalse if drives are static (C: and E:).
00365     // This affects iRootPathArray and iDefaultFolderArray content and
00366     // ordering.
00367     TBool iDynamicDrivesEnabled;
00368 
00369     TInt iIncludedMedias;
00370     };
00371 
00372 // C_AKNMEMORYSELECTIONDIALOG_H
00373 #endif

Copyright © Nokia Corporation 2001-2008
Back to top