CAknMemorySelectionDialogMultiDrive Class Reference

API published in: S60 3rd Ed FP 2

Link against: commondialogs.lib

Capability Information

Required Capabilities

None


#include <
caknmemoryselectiondialogmultidrive.h>

Inheritance diagram for CAknMemorySelectionDialogMultiDrive:

CAknCommonDialogsBase

Detailed Description

A class that launches a pop-up dialog for memory (drive) selection.

It is used to replace CAknMemorySelectionDialog class to support multiple drives.

Library CommonDialogs.lib

Public Member Functions

virtual IMPORT_C ~CAknMemorySelectionDialogMultiDrive ()
IMPORT_C void SetTitleL (const TDesC &aText)
 Sets title for the dialog.
IMPORT_C void SetLeftSoftkeyL (const TDesC &aText)
 Sets the text used for left softkey.
IMPORT_C void SetRightSoftkeyL (const TDesC &aText)
 Sets the text used for right softkey.
IMPORT_C void GetItem (TInt aIndex, TDes &aItem)
 Gets an item from memory selection dialog at specified index.
virtual IMPORT_C TReturnKey ExecuteL (TDriveNumber &aSelectedDrive)
 Executes the memory selection dialog.
virtual IMPORT_C TReturnKey ExecuteL (TDriveNumber &aSelectedDrive, TDes *aRootPath, TDes *aDefaultFolder)
 Executes the memory selection dialog.
TInt NumberOfItems () const
 Returns the number of items in list box array.
TInt GetDrivePaths (TDriveNumber aDrive, TDes *aRootPath, TDes *aDefaultFolder)
 Maps drive paths according to drive number.
TInt GetDrivePaths (TInt aLbxIndex, TDes *aRootPath, TDes *aDefaultFolder)
 Maps drive paths according to selected listbox item.
IMPORT_C TInt AddDrivePathsL (const TDesC &aRootPath, const TDesC &aDefaultFolder)
 Add user defined root path and default folder into memory selection dialog.
IMPORT_C TInt FindIndexByDrive (const TDriveNumber &aDrive)
 Add user defined root path and default folder into memory selection dialog.
TDriveNumber FindDriveByIndex (const TInt aIndex)
 Get drive number based on item index in the listbox.
TBool HasUnavailbleMMC ()
 Check if there is any unavailable MMC (not inserted).

Static Public Member Functions

static IMPORT_C CAknMemorySelectionDialogMultiDriveNewL (TCommonDialogType aDialogType, TBool aShowUnavailableDrives)
 Static constructor.
static IMPORT_C CAknMemorySelectionDialogMultiDriveNewL (TCommonDialogType aDialogType, TInt aResourceId, TBool aShowUnavailableDrives)
 Static constructor.
static IMPORT_C CAknMemorySelectionDialogMultiDriveNewL (TCommonDialogType aDialogType, TInt aResourceId, TBool aShowUnavailableDrives, TInt aIncludedMedias)
 Static constructor.
static IMPORT_C TBool RunDlgLD (TDriveNumber &aSelectedDrive)
 A static method that launches a memory selection dialog.
static IMPORT_C TBool RunDlgLD (TDriveNumber &aSelectedDrive, const TDesC &aTitle)
 New overloaded function to support multiple drives.
static IMPORT_C TBool RunDlgLD (TDriveNumber &aSelectedDrive, TInt aResourceId, TDes *aRootPath=NULL, TDes *aDefaultFolder=NULL)
 A static method that launches a memory selection dialog.

Protected Member Functions

 CAknMemorySelectionDialogMultiDrive (TCommonDialogType aDialogType)
virtual void ConstructFromResourceL (TInt aResourceId, TBool aShowUnavailableDrives)
 Constructs class from resource.
virtual void ConstructFromResourceL (TInt aResourceId, TBool aShowUnavailableDrives, TInt aIncludedMedias)
 Constructs class from resource.

Protected Attributes

TCommonDialogType iDialogType
CAknMemorySelectionModelMultiDrive * iModel
CAknMemorySelectionEventHandler * iEventHandler
HBufC * iTitle
HBufC * iLeftSoftkey
HBufC * iRightSoftkey
CDesCArrayFlat iRootPathArray
CDesCArrayFlat iDefaultFolderArray
TBool iDynamicDrivesEnabled
TInt iIncludedMedias
 Indicate which media types of drives could be visible.

Constructor & Destructor Documentation

virtual IMPORT_C CAknMemorySelectionDialogMultiDrive::~CAknMemorySelectionDialogMultiDrive  )  [virtual]
 
CAknMemorySelectionDialogMultiDrive::CAknMemorySelectionDialogMultiDrive TCommonDialogType  aDialogType  )  [protected]
 

Member Function Documentation

IMPORT_C TInt CAknMemorySelectionDialogMultiDrive::AddDrivePathsL const TDesC &  aRootPath,
const TDesC &  aDefaultFolder
 

Add user defined root path and default folder into memory selection dialog.

It is used to replace old user defined resource.

Parameters:
aRootPath A pointer to a descriptor where the root path of the selected drive will be stored. Must have KMaxFileName space. Set to NULL to ignore. The user defined root path will be added after each drive's root path. For example, if user specifics "Sounds\Digital\" for root path, then the root paths for all drives will be: C:\ E:\ F:\ ...
aDefaultFolder A pointer to a descriptor where the default folder of the selected drive will be stored. Must have KMaxFileName space. The user defined root path will be added after each drive's root path. Set to NULL to ignore. For example, if user specifics "MyFolder\" for default folder, then the default folders of all drives will be: <C drive's root path>\"MyFolder\" ... The trailing backslash will be added automatically whether user add it or not.
Returns:
Return error code
virtual void CAknMemorySelectionDialogMultiDrive::ConstructFromResourceL TInt  aResourceId,
TBool  aShowUnavailableDrives,
TInt  aIncludedMedias
[protected, virtual]
 

Constructs class from resource.

Parameters:
aResourceId ID of the resource. Can be zero.
aShowUnavailableDrives Defines whether unavailable or corrupted drives are shown in memory selection list or not.
aIncludedMedias bit flag definition of which medias are included in the dialog. See TMemoryTypes.
virtual void CAknMemorySelectionDialogMultiDrive::ConstructFromResourceL TInt  aResourceId,
TBool  aShowUnavailableDrives
[protected, virtual]
 

Constructs class from resource.

Parameters:
aResourceId ID of the resource. Can be zero.
aShowUnavailableDrives Defines whether unavailable or corrupted drives are shown in memory selection list or not.
virtual IMPORT_C TReturnKey CAknMemorySelectionDialogMultiDrive::ExecuteL TDriveNumber &  aSelectedDrive,
TDes *  aRootPath,
TDes *  aDefaultFolder
[virtual]
 

Executes the memory selection dialog.

Virtual to allow derivation.

Parameters:
aSelectedDrive A reference to a drive. If one of the drives is selected, the selected drive is stored to the parameter.
aRootPath A pointer to a descriptor where the root path of the selected memory is stored.
aDefaultFolder A pointer to a descriptor where the default folder of the selected memory is stored.
Returns:
Returns true if user has selected an item and false if user hits cancel.
virtual IMPORT_C TReturnKey CAknMemorySelectionDialogMultiDrive::ExecuteL TDriveNumber &  aSelectedDrive  )  [virtual]
 

Executes the memory selection dialog.

Virtual to allow derivation.

Parameters:
aSelectedDrive A reference to a drive. If one of the drives is selected, the selected drive is stored to the parameter.
Returns:
Returns true if user has selected an item and false if user hits cancel.
TDriveNumber CAknMemorySelectionDialogMultiDrive::FindDriveByIndex const TInt  aIndex  ) 
 

Get drive number based on item index in the listbox.

Parameters:
aIndex Listbox's item index.
Returns:
Return drive number
IMPORT_C TInt CAknMemorySelectionDialogMultiDrive::FindIndexByDrive const TDriveNumber &  aDrive  ) 
 

Add user defined root path and default folder into memory selection dialog.

It is used to replace old user defined resource.

Parameters:
aDrive Drive to be searched.
Returns:
Return item index if given drive is found in memory selection dialog's drive list. Othewise return KErrNotFound
TInt CAknMemorySelectionDialogMultiDrive::GetDrivePaths TInt  aLbxIndex,
TDes *  aRootPath,
TDes *  aDefaultFolder
 

Maps drive paths according to selected listbox item.

This function is valid for dynamic drives. The prerequisite for this function is that iRootPathArray and additionally iDefaultFolderArray indexes map correctly to iModel's listbox items.

Parameters:
aLbxIndex Index to the selected listbox item.
aRootPath A pointer to a descriptor where the root path of the selected drive will be stored. Must have KMaxFileName space. Set to NULL to ignore.
aDefaultFolder A pointer to a descriptor where the default folder of the selected drive will be stored. Must have KMaxFileNamespace. Set to NULL to ignore.
Returns:
Return error code KErrNone The drive is found in internal drive list KErrNotFound The drive is not visible to user or does not exist
TInt CAknMemorySelectionDialogMultiDrive::GetDrivePaths TDriveNumber  aDrive,
TDes *  aRootPath,
TDes *  aDefaultFolder
 

Maps drive paths according to drive number.

This function is valid for dynamic drives.

Parameters:
aDrive Drive number.
aRootPath A pointer to a descriptor where the root path of the selected drive will be stored. Must have KMaxFileName space. Set to NULL to ignore.
aDefaultFolder A pointer to a descriptor where the default folder of the selected drive will be stored. Must have KMaxFileNamespace. Set to NULL to ignore.
Returns:
Return error code KErrNone The drive is found in internal drive list KErrNotFound The drive is not visible to user or does not exist
IMPORT_C void CAknMemorySelectionDialogMultiDrive::GetItem TInt  aIndex,
TDes &  aItem
 

Gets an item from memory selection dialog at specified index.

Parameters:
aIndex Index to the item in the memory selection list.
aItem A reference to a descriptor where the item is stored.
TBool CAknMemorySelectionDialogMultiDrive::HasUnavailbleMMC  ) 
 

Check if there is any unavailable MMC (not inserted).

Returns:
ETrue There is at least one MMC unavailble. EFalse MMC inserted.
static IMPORT_C CAknMemorySelectionDialogMultiDrive* CAknMemorySelectionDialogMultiDrive::NewL TCommonDialogType  aDialogType,
TInt  aResourceId,
TBool  aShowUnavailableDrives,
TInt  aIncludedMedias
[static]
 

Static constructor.

Parameters:
aDialogType Defines the type of the dialog in order to read correct default settings for title and softkeys from resource.
aResourceId A resource id (MEMORYSELECTIONDIALOG). "Locations" part of resource is not used any more.
aShowUnavailableDrives Defines whether unavailable or corrupted drives are shown in memory selection list or not.
aIncludedMedias bit flag definition of which medias are included in the dialog. See TMemoryTypes.
Returns:
Returns a pointer to an instance of itself.
static IMPORT_C CAknMemorySelectionDialogMultiDrive* CAknMemorySelectionDialogMultiDrive::NewL TCommonDialogType  aDialogType,
TInt  aResourceId,
TBool  aShowUnavailableDrives
[static]
 

Static constructor.

Parameters:
aDialogType Defines the type of the dialog in order to read correct default settings for title and softkeys from resource.
aResourceId A resource id (MEMORYSELECTIONDIALOG). "Locations" part of resource is not used any more.
aShowUnavailableDrives Defines whether unavailable or corrupted drives are shown in memory selection list or not.
Returns:
Returns a pointer to an instance of itself.
static IMPORT_C CAknMemorySelectionDialogMultiDrive* CAknMemorySelectionDialogMultiDrive::NewL TCommonDialogType  aDialogType,
TBool  aShowUnavailableDrives
[static]
 

Static constructor.

Parameters:
aDialogType Defines the type of the dialog in order to read correct default settings for title and softkeys from resource.
aShowUnavailableDrives Defines whether unavailable or corrupted drives are shown in memory selection list or not.
Returns:
Returns a pointer to an instance of itself.
TInt CAknMemorySelectionDialogMultiDrive::NumberOfItems  )  const
 

Returns the number of items in list box array.

Not exported, for CFD internal use only.

Returns:
Returns the number of items in list box array.
static IMPORT_C TBool CAknMemorySelectionDialogMultiDrive::RunDlgLD TDriveNumber &  aSelectedDrive,
TInt  aResourceId,
TDes *  aRootPath = NULL,
TDes *  aDefaultFolder = NULL
[static]
 

A static method that launches a memory selection dialog.

See also:
RunL()
static IMPORT_C TBool CAknMemorySelectionDialogMultiDrive::RunDlgLD TDriveNumber &  aSelectedDrive,
const TDesC &  aTitle
[static]
 

New overloaded function to support multiple drives.

A static method that launches a memory selection dialog.

See also:
RunL()
static IMPORT_C TBool CAknMemorySelectionDialogMultiDrive::RunDlgLD TDriveNumber &  aSelectedDrive  )  [static]
 

A static method that launches a memory selection dialog.

See also:
RunL()
IMPORT_C void CAknMemorySelectionDialogMultiDrive::SetLeftSoftkeyL const TDesC &  aText  ) 
 

Sets the text used for left softkey.

Parameters:
aText The text used for left softkey.
IMPORT_C void CAknMemorySelectionDialogMultiDrive::SetRightSoftkeyL const TDesC &  aText  ) 
 

Sets the text used for right softkey.

Parameters:
aText The text used for right softkey.
IMPORT_C void CAknMemorySelectionDialogMultiDrive::SetTitleL const TDesC &  aText  ) 
 

Sets title for the dialog.

Parameters:
aText Title text.

Field Documentation

CDesCArrayFlat CAknMemorySelectionDialogMultiDrive::iDefaultFolderArray [protected]
 
TCommonDialogType CAknMemorySelectionDialogMultiDrive::iDialogType [protected]
 
TBool CAknMemorySelectionDialogMultiDrive::iDynamicDrivesEnabled [protected]
 
CAknMemorySelectionEventHandler* CAknMemorySelectionDialogMultiDrive::iEventHandler [protected]
 
TInt CAknMemorySelectionDialogMultiDrive::iIncludedMedias [protected]
 

Indicate which media types of drives could be visible.

HBufC* CAknMemorySelectionDialogMultiDrive::iLeftSoftkey [protected]
 
CAknMemorySelectionModelMultiDrive* CAknMemorySelectionDialogMultiDrive::iModel [protected]
 
HBufC* CAknMemorySelectionDialogMultiDrive::iRightSoftkey [protected]
 
CDesCArrayFlat CAknMemorySelectionDialogMultiDrive::iRootPathArray [protected]
 
HBufC* CAknMemorySelectionDialogMultiDrive::iTitle [protected]
 

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top