# HG changeset patch # User hgs # Date 1280384516 -28800 # Node ID 0e1e0022bd03b24acb59d61d6e62d7d4b78ee361 # Parent 667edd0b86783bae06f204f634e7725d1ee48e9f 201029_1 diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/common_file_dialogs_api/common_file_dialogs_api.metaxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classicui_plat/common_file_dialogs_api/common_file_dialogs_api.metaxml Thu Jul 29 14:21:56 2010 +0800 @@ -0,0 +1,18 @@ + + + Common File Dialogs API + Provides common file dialogs. + c++ + commonuis + + + + + + + + + yes + no + + diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/common_file_dialogs_api/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classicui_plat/common_file_dialogs_api/group/bld.inf Thu Jul 29 14:21:56 2010 +0800 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: File that exports the files belonging to +: Common File Dialogs API +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/MAknMemorySelectionObserver.h MW_LAYER_PUBLIC_EXPORT_PATH(MAknMemorySelectionObserver.h) +../inc/CommonDialogs.hrh MW_LAYER_PUBLIC_EXPORT_PATH(CommonDialogs.hrh) +../inc/AknCommonDialogsDynMem.h MW_LAYER_PUBLIC_EXPORT_PATH(AknCommonDialogsDynMem.h) +../inc/MAknFileFilter.h MW_LAYER_PUBLIC_EXPORT_PATH(MAknFileFilter.h) +../inc/CAknFileSelectionDialog.h MW_LAYER_PUBLIC_EXPORT_PATH(CAknFileSelectionDialog.h) +../inc/CommonDialogs.rh MW_LAYER_PUBLIC_EXPORT_PATH(CommonDialogs.rh) +../inc/CAknMemorySelectionSettingPage.h MW_LAYER_PUBLIC_EXPORT_PATH(CAknMemorySelectionSettingPage.h) +../inc/CAknMemorySelectionDialog.h MW_LAYER_PUBLIC_EXPORT_PATH(CAknMemorySelectionDialog.h) +../inc/AknCommonDialogs.h MW_LAYER_PUBLIC_EXPORT_PATH(AknCommonDialogs.h) +../inc/CAknMemorySelectionSettingItem.h MW_LAYER_PUBLIC_EXPORT_PATH(CAknMemorySelectionSettingItem.h) +../inc/CAknFileNamePromptDialog.h MW_LAYER_PUBLIC_EXPORT_PATH(CAknFileNamePromptDialog.h) +../inc/CAknCommonDialogsBase.h MW_LAYER_PUBLIC_EXPORT_PATH(CAknCommonDialogsBase.h) +../inc/MAknFileSelectionObserver.h MW_LAYER_PUBLIC_EXPORT_PATH(MAknFileSelectionObserver.h) + +../inc/caknmemoryselectiondialogmultidrive.h MW_LAYER_PUBLIC_EXPORT_PATH(CAknMemorySelectionDialogMultiDrive.h) +../inc/caknmemoryselectionsettingitemmultidrive.h MW_LAYER_PUBLIC_EXPORT_PATH(CAknMemorySelectionSettingItemMultiDrive.h) + diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/common_file_dialogs_api/inc/AknCommonDialogs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classicui_plat/common_file_dialogs_api/inc/AknCommonDialogs.h Thu Jul 29 14:21:56 2010 +0800 @@ -0,0 +1,590 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Static class to call combined common file dialogs. +* +*/ + + +#ifndef AKNCOMMONDIALOGS_H +#define AKNCOMMONDIALOGS_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class MAknMemorySelectionObserver; +class MAknFileSelectionObserver; +class MAknFileFilter; + +// CLASS DEFINITION +/** +* DEPRECATED: Use AknCommonDialogsDynMem instead. This class is only used as a +* proxy to the new implementation class to maintain backwards compatibility. +* +* A class that consists of static functions that launch UI components in a +* sequence. First, memory selection component is launched and then +* file/directory selection component. In save and move dialogs directory +* selection may not be shown if there are no subdirectories to choose from. +* In save dialog, finally filename prompt component is launched. +* +* All methods have an obligatory resource ID parameter for memory selection +* because it contains the paths for both memories (Phone&MMC) (LOCATION structs). +* If set, an observer is queried just before exiting the dialog. +* At this point the application can either reject or accept user's selection. +* Every dialog returns a boolean value which tells if user has selected something +* or not. +* +* @lib CommonDialogs.lib +* @since 1.2 +*/ +class AknCommonDialogs + { + + public: + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches file selection dialog. + * @param aFileName Full path and filename of the file that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a file, otherwise EFalse. + */ + IMPORT_C static TBool RunSelectDlgLD( + TDes& aFileName, + TInt aMemorySelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches file selection dialog. + * @param aFileName Full path and filename of the file that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFilter Filter is asked if a directory entry can be shown in + * list. Ownership is not transferred. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a file, otherwise EFalse. + */ + IMPORT_C static TBool RunSelectDlgLD( + TDes& aFileName, + TInt aMemorySelectionResourceId, + MAknFileFilter* aFilter, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches file selection dialog. + * @param aFileName Full path and filename of the file that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionTitle A custom title for file selection dialog. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a file, otherwise EFalse. + */ + IMPORT_C static TBool RunSelectDlgLD( + TDes& aFileName, + TInt aMemorySelectionResourceId, + const TDesC& aFileSelectionTitle, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches file selection dialog. + * @param aFileName Full path and filename of the file that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionResourceId A resource id for file selection + * dialog. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a file, otherwise EFalse. + */ + IMPORT_C static TBool RunSelectDlgLD( + TDes& aFileName, + TInt aMemorySelectionResourceId, + TInt aFileSelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches move dialog. + * @param aDirectory Full path of the folder that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a folder, otherwise EFalse. + */ + IMPORT_C static TBool RunMoveDlgLD( + TDes& aDirectory, + TInt aMemorySelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches move dialog. + * @param aDirectory Full path of the folder that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFilter Filter is asked if a directory entry can be shown in + * list. Ownership is not transferred. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a folder, otherwise EFalse. + */ + IMPORT_C static TBool RunMoveDlgLD( + TDes& aDirectory, + TInt aMemorySelectionResourceId, + MAknFileFilter* aFilter, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches move dialog. + * @param aDirectory Full path of the folder that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionTitle A custom title for directory selection + * dialog. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a folder, otherwise EFalse + */ + IMPORT_C static TBool RunMoveDlgLD( + TDes& aDirectory, + TInt aMemorySelectionResourceId, + const TDesC& aFileSelectionTitle, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches move dialog. + * @param aDirectory Full path of the folder that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog + * @param aFileSelectionResourceId A resource id for file selection + * dialog + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a folder, otherwise EFalse + */ + IMPORT_C static TBool RunMoveDlgLD( + TDes& aDirectory, + TInt aMemorySelectionResourceId, + TInt aFileSelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches save dialog which does not run folder + * selection dialog at all. Instead the resulting path will be + * constructed from the root and default folder read from resources and + * from the file name given by the user. + * @param aDefaultFileName Full path + the filename that user enters + * is stored to this descriptor. The descriptor may contain text + * that is used as default filename, for example "Attachment". + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aObserver An observer which is asked, if set, to verify the + * filename that user types. + * @return Returns ETrue if user accepts or enters a filename, otherwise + * EFalse. + */ + IMPORT_C static TBool RunSaveDlgLD( + TDes& aDefaultFileName, + TInt aMemorySelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches save dialog. + * @param aDefaultFileName Full path + the filename that user enters + * is stored to this descriptor. The descriptor may contain text + * that is used as default filename, for example "Attachment". + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFilter Filter is asked if a directory entry can be shown in + * list. Ownership is not transferred. + * @param aObserver An observer which is asked, if set, to verify the + * filename that user types. + * @return Returns ETrue if user accepts or enters a filename, otherwise + * EFalse. + */ + IMPORT_C static TBool RunSaveDlgLD( + TDes& aDefaultFileName, + TInt aMemorySelectionResourceId, + MAknFileFilter* aFilter, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches save dialog. + * @param aDefaultFileName Full path + the filename that user enters + * is stored to this descriptor. The descriptor may contain text + * that is used as default filename, for example "Attachment". + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionTitle Custom title for file selection dialog. + * @param aFileNamePromptTitle Custom title for filename prompt dialog. + * @param aObserver An observer which is asked, if set, to verify the + * filename that user types. + * @return Returns ETrue if user accepts or enters a filename, otherwise + * EFalse. + */ + IMPORT_C static TBool RunSaveDlgLD( + TDes& aDefaultFileName, + TInt aMemorySelectionResourceId, + const TDesC& aFileSelectionTitle, + const TDesC& aFileNamePromptTitle, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches save dialog. + * @param aDefaultFileName Full path + the filename that user enters + * is stored to this descriptor. The descriptor may contain text + * that is used as default filename, for example "Attachment". + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionResourceId A resource id for file selection + * dialog. + * @param aObserver An observer which is asked, if set, to verify the + * filename that user types. + * @return Returns ETrue if user accepts or enters a filename, otherwise + * EFalse. + */ + IMPORT_C static TBool RunSaveDlgLD( + TDes& aDefaultFileName, + TInt aMemorySelectionResourceId, + TInt aFileSelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches save dialog. + * @param aDefaultFileName Full path + the filename that user enters + * is stored to this descriptor. The descriptor may contain text + * that is used as default filename, for example "Attachment". + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionResourceId A resource id for file selection + * dialog. + * @param aFileNamePromptTitle Custom title for filename prompt dialog. + * @param aObserver An observer which is asked, if set, to verify the + * filename that user types. + * @return Returns ETrue if user accepts or enters a filename, otherwise + * EFalse. + */ + IMPORT_C static TBool RunSaveDlgLD( + TDes& aDefaultFileName, + TInt aMemorySelectionResourceId, + TInt aFileSelectionResourceId, + const TDesC& aFileNamePromptTitle, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches save dialog. No file selection dialog + * for directory selection is displayed. + * @param aDefaultFileName Full path + the filename that user enters + * is stored to this descriptor. The descriptor may contain text + * that is used as default filename, for example "Attachment". + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. The folders in which the file will be saved should be + * given in this resource. + * @param aObserver An observer which is asked, if set, to verify the + * filename that user types. + * @return Returns ETrue if user accepts or enters a filename, otherwise + * EFalse. + */ + IMPORT_C static TBool RunSaveDlgNoDirectorySelectionLD( + TDes& aDefaultFileName, + TInt aMemorySelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches save dialog. No file selection dialog + * for directory selection is displayed. + * @param aDefaultFileName Full path + the filename that user enters + * is stored to this descriptor. The descriptor may contain text + * that is used as default filename, for example "Attachment". + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. The folders in which the file will be saved should be + * given in this resource. + * @param aFileNamePromptTitle Custom title for filename prompt dialog. + * @param aObserver An observer which is asked, if set, to verify the + * filename that user types. + * @return Returns ETrue if user accepts or enters a filename, otherwise + * EFalse. + */ + IMPORT_C static TBool RunSaveDlgNoDirectorySelectionLD( + TDes& aDefaultFileName, + TInt aMemorySelectionResourceId, + const TDesC& aFileNamePromptTitle, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches copy dialog. + * @param aDirectory Full path of the folder that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a folder, otherwise EFalse. + */ + IMPORT_C static TBool RunCopyDlgLD( + TDes& aDirectory, + TInt aMemorySelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches copy dialog. + * @param aDirectory Full path of the folder that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFilter Filter is asked if a directory entry can be shown in + * list. Ownership is not transferred. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a folder, otherwise EFalse. + */ + IMPORT_C static TBool RunCopyDlgLD( + TDes& aDirectory, + TInt aMemorySelectionResourceId, + MAknFileFilter* aFilter, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches copy dialog. + * @param aDirectory Full path of the folder that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog + * @param aFileSelectionResourceId A resource id for file selection + * dialog + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a folder, otherwise EFalse + */ + IMPORT_C static TBool RunCopyDlgLD( + TDes& aDirectory, + TInt aMemorySelectionResourceId, + TInt aFileSelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches file selection dialog. + * @param aFileName Full path and filename of the file that user + * selects is stored to this descriptor. + * @param aStartFolder User defined folder to start browsing in file selection + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a file, otherwise EFalse. + * @since 2.6 + */ + IMPORT_C static TBool RunSelectDlgLD( + TDes& aFileName, + const TDesC& aStartFolder, + TInt aMemorySelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches file selection dialog. + * @param aFileName Full path and filename of the file that user + * selects is stored to this descriptor. + * @param aStartFolder User defined folder to start browsing in file selection + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFilter Filter is asked if a directory entry can be shown in + * list. Ownership is not transferred. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a file, otherwise EFalse. + * @since 2.6 + */ + IMPORT_C static TBool RunSelectDlgLD( + TDes& aFileName, + const TDesC& aStartFolder, + TInt aMemorySelectionResourceId, + MAknFileFilter* aFilter, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches file selection dialog. + * @param aFileName Full path and filename of the file that user + * selects is stored to this descriptor. + * @param aStartFolder User defined folder to start browsing in file selection + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionTitle A custom title for file selection dialog. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a file, otherwise EFalse. + * @since 2.6 + */ + IMPORT_C static TBool RunSelectDlgLD( + TDes& aFileName, + const TDesC& aStartFolder, + TInt aMemorySelectionResourceId, + const TDesC& aFileSelectionTitle, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches file selection dialog. + * @param aFileName Full path and filename of the file that user + * selects is stored to this descriptor. + * @param aStartFolder User defined folder to start browsing in file selection + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionResourceId A resource id for file selection + * dialog. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a file, otherwise EFalse. + * @since 2.6 + */ + IMPORT_C static TBool RunSelectDlgLD( + TDes& aFileName, + const TDesC& aStartFolder, + TInt aMemorySelectionResourceId, + TInt aFileSelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches file selection dialog. + * @param aFileName Full path and filename of the file that user selects is + * stored to this descriptor. + * @param aStartFolder User defined folder to start browsing in file selection. + * @param aMemorySelectionResourceId A resource id for memory selection dialog. + * @param aFileSelectionResourceId A resource id for file selection dialog. + * @param aFileSelectionTitle Custom title for file selection dialog. + * @param aFilter Filter asked if a directory entry can be shown in list. + * @param aObserver An observer which is asked to verify user's selection. + * @return Returns ETrue if user selects a file, otherwise EFalse + * @since 3.1 + */ + IMPORT_C static TBool RunSelectDlgLD( + TDes& aFileName, + const TDesC& aStartFolder, + TInt aMemorySelectionResourceId, + TInt aFileSelectionResourceId, + const TDesC& aFileSelectionTitle, + MAknFileFilter* aFilter = NULL, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches save dialog. + * @param aDefaultFileName Full path + the filename that user enters + * is stored to this descriptor. The descriptor may contain text + * that is used as default filename, for example "Attachment". + * @param aStartFolder User defined folder to start browsing in file selection. + * @param aMemorySelectionResourceId A resource id for memory selection dialog. + * @param aFileSelectionResourceId A resource id for file selection dialog. + * @param aFileSelectionTitle Custom title for file selection dialog. + * @param aFilter Filter asked if a directory entry can be shown in list. + * @param aObserver An observer which is asked, if set, to verify the + * filename that user types. + * @return Returns ETrue if user accepts or enters a filename, otherwise + * EFalse. + * @since 3.1 + */ + IMPORT_C static TBool RunSaveDlgLD( + TDes& aDefaultFileName, + const TDesC& aStartFolder, + TInt aMemorySelectionResourceId, + TInt aFileSelectionResourceId, + const TDesC& aFileSelectionTitle, + MAknFileFilter* aFilter = NULL, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * DEPRECATED: Use AknCommonDialogsDynMem funcions instead. + * + * A static method that launches folder selection dialog. + * @param aFolder Full path of the folder that user selects is stored to this + * descriptor. + * @param aStartFolder User defined folder to start browsing in file selection. + * @param aMemorySelectionResourceId A resource id for memory selection dialog. + * @param aFileSelectionResourceId A resource id for file selection dialog. + * @param aFileSelectionTitle Custom title for file selection dialog. + * @param aFilter Filter is asked if a directory entry can be shown in list. + * @param aObserver An observer which is asked to verify user's selection. + * @return Returns ETrue if user selects a folder, otherwise EFalse + * @since 3.1 + */ + IMPORT_C static TBool RunFolderSelectDlgLD( + TDes& aFolder, + const TDesC& aStartFolder, + TInt aMemorySelectionResourceId, + TInt aFileSelectionResourceId, + const TDesC& aFileSelectionTitle, + MAknFileFilter* aFilter = NULL, + MAknFileSelectionObserver* aObserver = NULL ); + + }; + +#endif // AKNCOMMONDIALOGS_H + +// End of File diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/common_file_dialogs_api/inc/AknCommonDialogsDynMem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classicui_plat/common_file_dialogs_api/inc/AknCommonDialogsDynMem.h Thu Jul 29 14:21:56 2010 +0800 @@ -0,0 +1,757 @@ +/* +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Static class to call combined common file dialogs +* +*/ + + + +#ifndef AKNCOMMONDIALOGSDYNMEM_H +#define AKNCOMMONDIALOGSDYNMEM_H + + +#include + +class MAknMemorySelectionObserver; +class MAknFileSelectionObserver; +class MAknFileFilter; + + +/** + * New version of AknCommonDialogs class suporting dynamic drives such as + * remote drive. Use this instead of now deprecated old AknCommonDialogs. + * + * A simple facade class that consists of static functions that launch UI + * components in a sequence. First, memory selection component is launched and + * then file/directory selection component. In save and move dialogs directory + * selection may not be shown if there are no subdirectories to choose from. + * In save dialog, finally filename prompt component is launched. + * + * All methods have an obligatory resource ID parameter for memory selection + * because it contains the paths for both memories (Phone&MMC) (LOCATION + * structs). New TMemoryTypes functionality allows defining dynamic memories + * to be used. + * + * If set, an observer is queried just before exiting the dialog. + * At this point the application can either reject or accept user's selection. + * Every dialog returns a boolean value which tells if user has selected + * something or not. + * + * @lib CommonDialogs.lib + * @since S60 3.2 + */ +NONSHARABLE_CLASS( AknCommonDialogsDynMem ) + { + +public: + + /** + * Bit flag definition of the memory types that will be listed by the + * dialog. These are used in the new functions to include for example + * remote drives. In case new media types are added in the future, the + * types can be added to the end of this enumeration. + * + * Application logic and UI specification is mainly interested in + * division between 'phone memory' and 'MMC' with the latest addition of + * 'remote drives'. In Symbian OS level this is somewhat more + * complicated because these do not map directly to any drive or memory + * type. For example try defining the drive letter for remote drive. + * + * Basically TMediaType could be used but the types may vary in the same + * drive and application logic mostly understands only division between + * 'phone' and 'MMC' memory - these do not map to TMediaType directly. + * This the reasoning for this new enumeration. + * + * Uses binary flagging. + * + * Use for example 'EMemoryTypePhone|EMemoryTypeMMC|EMemoryTypeRemote' to + * have phone memory, MMC and remote drives included. + * + * Notice: 0 value means no media included. Only + * EMemoryTypePhone|EMemoryTypeMMC for legacy applications and + * EMemoryTypePhone|EMemoryTypeMMC|EMemoryTypeRemote for new remote + * drives-aware applications are supported for the time being. + * Use EMemoryTypePhone|EMemoryTypeInternalMassStorage|EMemoryMMCExternal + * |EMemoryTypeRemote for multiple drive support. And EMemoryTypeMMC will + * be deprecated. + */ + enum TMemoryTypes + { + /** + * EMemoryTypePhone + * Device memory drive inside phone + * + * There might be multiple device memory drives because of multiple + * partitions. + */ + EMemoryTypePhone = 0x00000001, + + /** + * @Deprecated It will be mapped to + * EMemoryTypeInternalMassStorage|EMemoryMMCExternal + * internally. + * + * EMemoryTypeMMC + * Standard external removable memory card drive + * + * There might be multiple removable MMC drives because of + * multiple partitions. + */ + EMemoryTypeMMC = 0x00000002, + + /** + * EMemoryTypeRemote + * Remote drive + * + * There might be multiple remote drives. + */ + EMemoryTypeRemote = 0x00000004, + + /** + * EMemoryTypeInternalMassStorage + * Internal mass storage, like internal MMC, hard disk, flash, etc. + * + * There might be multiple internal disk drives + */ + EMemoryTypeInternalMassStorage = 0x00000008, + + /** + * EMemoryTypeMMCExternal + * Removable external memory card + * + */ + EMemoryTypeMMCExternal = 0x00000010 + + }; + +public: + + /** + * A static method that launches file selection dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aFileName Full path and filename of the file that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a file, otherwise EFalse. + */ + IMPORT_C static TBool RunSelectDlgLD( + TInt aIncludedMedias, + TDes& aFileName, + TInt aMemorySelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches file selection dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aFileName Full path and filename of the file that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFilter Filter is asked if a directory entry can be shown in + * list. Ownership is not transferred. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a file, otherwise EFalse. + */ + IMPORT_C static TBool RunSelectDlgLD( + TInt aIncludedMedias, + TDes& aFileName, + TInt aMemorySelectionResourceId, + MAknFileFilter* aFilter, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches file selection dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aFileName Full path and filename of the file that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionTitle A custom title for file selection dialog. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a file, otherwise EFalse. + */ + IMPORT_C static TBool RunSelectDlgLD( + TInt aIncludedMedias, + TDes& aFileName, + TInt aMemorySelectionResourceId, + const TDesC& aFileSelectionTitle, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches file selection dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aFileName Full path and filename of the file that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionResourceId A resource id for file selection + * dialog. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a file, otherwise EFalse. + */ + IMPORT_C static TBool RunSelectDlgLD( + TInt aIncludedMedias, + TDes& aFileName, + TInt aMemorySelectionResourceId, + TInt aFileSelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches move dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aDirectory Full path of the folder that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a folder, otherwise EFalse. + */ + IMPORT_C static TBool RunMoveDlgLD( + TInt aIncludedMedias, + TDes& aDirectory, + TInt aMemorySelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches move dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aDirectory Full path of the folder that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFilter Filter is asked if a directory entry can be shown in + * list. Ownership is not transferred. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a folder, otherwise EFalse. + */ + IMPORT_C static TBool RunMoveDlgLD( + TInt aIncludedMedias, + TDes& aDirectory, + TInt aMemorySelectionResourceId, + MAknFileFilter* aFilter, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches move dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aDirectory Full path of the folder that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionTitle A custom title for directory selection + * dialog. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a folder, otherwise EFalse + */ + IMPORT_C static TBool RunMoveDlgLD( + TInt aIncludedMedias, + TDes& aDirectory, + TInt aMemorySelectionResourceId, + const TDesC& aFileSelectionTitle, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches move dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aDirectory Full path of the folder that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog + * @param aFileSelectionResourceId A resource id for file selection + * dialog + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a folder, otherwise EFalse + */ + IMPORT_C static TBool RunMoveDlgLD( + TInt aIncludedMedias, + TDes& aDirectory, + TInt aMemorySelectionResourceId, + TInt aFileSelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches save dialog which does not run folder + * selection dialog at all. Instead the resulting path will be + * constructed from the root and default folder read from resources and + * from the file name given by the user. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aDefaultFileName Full path + the filename that user enters + * is stored to this descriptor. The descriptor may contain text + * that is used as default filename, for example "Attachment". + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aObserver An observer which is asked, if set, to verify the + * filename that user types. + * @return Returns ETrue if user accepts or enters a filename, otherwise + * EFalse. + */ + IMPORT_C static TBool RunSaveDlgLD( + TInt aIncludedMedias, + TDes& aDefaultFileName, + TInt aMemorySelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches save dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aDefaultFileName Full path + the filename that user enters + * is stored to this descriptor. The descriptor may contain text + * that is used as default filename, for example "Attachment". + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFilter Filter is asked if a directory entry can be shown in + * list. Ownership is not transferred. + * @param aObserver An observer which is asked, if set, to verify the + * filename that user types. + * @return Returns ETrue if user accepts or enters a filename, otherwise + * EFalse. + */ + IMPORT_C static TBool RunSaveDlgLD( + TInt aIncludedMedias, + TDes& aDefaultFileName, + TInt aMemorySelectionResourceId, + MAknFileFilter* aFilter, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches save dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aDefaultFileName Full path + the filename that user enters + * is stored to this descriptor. The descriptor may contain text + * that is used as default filename, for example "Attachment". + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionTitle Custom title for file selection dialog. + * @param aFileNamePromptTitle Custom title for filename prompt dialog. + * @param aObserver An observer which is asked, if set, to verify the + * filename that user types. + * @return Returns ETrue if user accepts or enters a filename, otherwise + * EFalse. + */ + IMPORT_C static TBool RunSaveDlgLD( + TInt aIncludedMedias, + TDes& aDefaultFileName, + TInt aMemorySelectionResourceId, + const TDesC& aFileSelectionTitle, + const TDesC& aFileNamePromptTitle, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches save dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aDefaultFileName Full path + the filename that user enters + * is stored to this descriptor. The descriptor may contain text + * that is used as default filename, for example "Attachment". + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionResourceId A resource id for file selection + * dialog. + * @param aObserver An observer which is asked, if set, to verify the + * filename that user types. + * @return Returns ETrue if user accepts or enters a filename, otherwise + * EFalse. + */ + IMPORT_C static TBool RunSaveDlgLD( + TInt aIncludedMedias, + TDes& aDefaultFileName, + TInt aMemorySelectionResourceId, + TInt aFileSelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches save dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aDefaultFileName Full path + the filename that user enters + * is stored to this descriptor. The descriptor may contain text + * that is used as default filename, for example "Attachment". + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionResourceId A resource id for file selection + * dialog. + * @param aFileNamePromptTitle Custom title for filename prompt dialog. + * @param aObserver An observer which is asked, if set, to verify the + * filename that user types. + * @return Returns ETrue if user accepts or enters a filename, otherwise + * EFalse. + */ + IMPORT_C static TBool RunSaveDlgLD( + TInt aIncludedMedias, + TDes& aDefaultFileName, + TInt aMemorySelectionResourceId, + TInt aFileSelectionResourceId, + const TDesC& aFileNamePromptTitle, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches save dialog. No file selection dialog + * for directory selection is displayed. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aDefaultFileName Full path + the filename that user enters + * is stored to this descriptor. The descriptor may contain text + * that is used as default filename, for example "Attachment". + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. The folders in which the file will be saved should be + * given in this resource. + * @param aObserver An observer which is asked, if set, to verify the + * filename that user types. + * @return Returns ETrue if user accepts or enters a filename, otherwise + * EFalse. + */ + IMPORT_C static TBool RunSaveDlgNoDirectorySelectionLD( + TInt aIncludedMedias, + TDes& aDefaultFileName, + TInt aMemorySelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches save dialog. No file selection dialog + * for directory selection is displayed. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aDefaultFileName Full path + the filename that user enters + * is stored to this descriptor. The descriptor may contain text + * that is used as default filename, for example "Attachment". + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. The folders in which the file will be saved should be + * given in this resource. + * @param aFileNamePromptTitle Custom title for filename prompt dialog. + * @param aObserver An observer which is asked, if set, to verify the + * filename that user types. + * @return Returns ETrue if user accepts or enters a filename, otherwise + * EFalse. + */ + IMPORT_C static TBool RunSaveDlgNoDirectorySelectionLD( + TInt aIncludedMedias, + TDes& aDefaultFileName, + TInt aMemorySelectionResourceId, + const TDesC& aFileNamePromptTitle, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches copy dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aDirectory Full path of the folder that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a folder, otherwise EFalse. + */ + IMPORT_C static TBool RunCopyDlgLD( + TInt aIncludedMedias, + TDes& aDirectory, + TInt aMemorySelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + + /** + * A static method that launches copy dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aDirectory Full path of the folder that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFilter Filter is asked if a directory entry can be shown in + * list. Ownership is not transferred. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a folder, otherwise EFalse. + */ + IMPORT_C static TBool RunCopyDlgLD( + TInt aIncludedMedias, + TDes& aDirectory, + TInt aMemorySelectionResourceId, + MAknFileFilter* aFilter, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches copy dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aDirectory Full path of the folder that user + * selects is stored to this descriptor. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog + * @param aFileSelectionResourceId A resource id for file selection + * dialog + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a folder, otherwise EFalse + */ + IMPORT_C static TBool RunCopyDlgLD( + TInt aIncludedMedias, + TDes& aDirectory, + TInt aMemorySelectionResourceId, + TInt aFileSelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches file selection dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aFileName Full path and filename of the file that user + * selects is stored to this descriptor. + * @param aStartFolder User defined folder to start browsing in file + * selection. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a file, otherwise EFalse. + * @since 3.2 + */ + IMPORT_C static TBool RunSelectDlgLD( + TInt aIncludedMedias, + TDes& aFileName, + const TDesC& aStartFolder, + TInt aMemorySelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches file selection dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aFileName Full path and filename of the file that user + * selects is stored to this descriptor. + * @param aStartFolder User defined folder to start browsing in file + * selection + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFilter Filter is asked if a directory entry can be shown in + * list. Ownership is not transferred. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a file, otherwise EFalse. + * @since 3.2 + */ + IMPORT_C static TBool RunSelectDlgLD( + TInt aIncludedMedias, + TDes& aFileName, + const TDesC& aStartFolder, + TInt aMemorySelectionResourceId, + MAknFileFilter* aFilter, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches file selection dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aFileName Full path and filename of the file that user + * selects is stored to this descriptor. + * @param aStartFolder User defined folder to start browsing in file + * selection + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionTitle A custom title for file selection dialog. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a file, otherwise EFalse. + * @since 3.2 + */ + IMPORT_C static TBool RunSelectDlgLD( + TInt aIncludedMedias, + TDes& aFileName, + const TDesC& aStartFolder, + TInt aMemorySelectionResourceId, + const TDesC& aFileSelectionTitle, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches file selection dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aFileName Full path and filename of the file that user + * selects is stored to this descriptor. + * @param aStartFolder User defined folder to start browsing in file + * selection + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionResourceId A resource id for file selection + * dialog. + * @param aObserver An observer which is asked, if set, to verify user's + * selection. + * @return Returns ETrue if user selects a file, otherwise EFalse. + * @since 3.2 + */ + IMPORT_C static TBool RunSelectDlgLD( + TInt aIncludedMedias, + TDes& aFileName, + const TDesC& aStartFolder, + TInt aMemorySelectionResourceId, + TInt aFileSelectionResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches file selection dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aFileName Full path and filename of the file that user selects is + * stored to this descriptor. + * @param aStartFolder User defined folder to start browsing in file + * selection. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionResourceId A resource id for file selection dialog. + * @param aFileSelectionTitle Custom title for file selection dialog. + * @param aFilter Filter asked if a directory entry can be shown in list. + * @param aObserver An observer which is asked to verify user's selection. + * @return Returns ETrue if user selects a file, otherwise EFalse + * @since 3.2 + */ + IMPORT_C static TBool RunSelectDlgLD( + TInt aIncludedMedias, + TDes& aFileName, + const TDesC& aStartFolder, + TInt aMemorySelectionResourceId, + TInt aFileSelectionResourceId, + const TDesC& aFileSelectionTitle, + MAknFileFilter* aFilter = NULL, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches save dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aDefaultFileName Full path + the filename that user enters + * is stored to this descriptor. The descriptor may contain text + * that is used as default filename, for example "Attachment". + * @param aStartFolder User defined folder to start browsing in file + * selection. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionResourceId A resource id for file selection dialog. + * @param aFileSelectionTitle Custom title for file selection dialog. + * @param aFilter Filter asked if a directory entry can be shown in list. + * @param aObserver An observer which is asked, if set, to verify the + * filename that user types. + * @return Returns ETrue if user accepts or enters a filename, otherwise + * EFalse. + * @since 3.2 + */ + IMPORT_C static TBool RunSaveDlgLD( + TInt aIncludedMedias, + TDes& aDefaultFileName, + const TDesC& aStartFolder, + TInt aMemorySelectionResourceId, + TInt aFileSelectionResourceId, + const TDesC& aFileSelectionTitle, + MAknFileFilter* aFilter = NULL, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches folder selection dialog. + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes. + * @param aFolder Full path of the folder that user selects is stored to + * this descriptor. + * @param aStartFolder User defined folder to start browsing in file + * selection. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aFileSelectionResourceId A resource id for file selection dialog. + * @param aFileSelectionTitle Custom title for file selection dialog. + * @param aFilter Filter is asked if a directory entry can be shown in + * list. + * @param aObserver An observer which is asked to verify user's selection. + * @return Returns ETrue if user selects a folder, otherwise EFalse + * @since 3.2 + */ + IMPORT_C static TBool RunFolderSelectDlgLD( + TInt aIncludedMedias, + TDes& aFolder, + const TDesC& aStartFolder, + TInt aMemorySelectionResourceId, + TInt aFileSelectionResourceId, + const TDesC& aFileSelectionTitle, + MAknFileFilter* aFilter = NULL, + MAknFileSelectionObserver* aObserver = NULL ); + +private: + + /** + * A static method that launches UI components in a sequence. + * @param aType Defines what type of dialog is shown. + * @param aFileName A reference to a descriptor. Usage depends on the + * dialog type. + * @param aMemorySelectionResourceId A resource id for memory selection + * dialog. + * @param aNoFileSelectionDialog, if ETrue and aType is ECFDDialogType- + * Save, no file selection dialog is launched, instead the file + * will be saved in the default folder given in the resource + * structure referred by aMemorySelectionResourceId. + * @param aFileSelectionResourceId A resource id for file selection + * dialog. + * @param aFileNamePromptResourceId A resource id for filename prompt + * dialog. + * @param aFileSelectionTitle Custom title for file selection. + * @param aFileNamePromptTitle Custom title for filename prompt dialog. + * @param aFileFilter Filter is asked if a directory entry can be shown + * in list. + * @param aMemorySelectionObserver An observer for memory selection + * dialog. + * @param aFileSelectionObserver An observer for file selection dialog. + * @param aFileNamePromptObserver An observer for filename prompt + * dialog. + * @param aStartFolder User defined folder to start browsing in file + * selection + * @param aIncludedMedias defines which medias are included in the + * dialog. See TMemoryTypes + * @return Returns a boolean value that depends on the case. + */ + static TBool RunL( + TCommonDialogType aType, + TDes& aFileName, + TInt aMemorySelectionResourceId, + TBool aNoFileSelectionDialog, + TInt aFileSelectionResourceId, + TInt aFileNamePromptResourceId, + const TDesC& aFileSelectionTitle, + const TDesC& aFileNamePromptTitle, + MAknFileFilter* aFileFilter, + MAknMemorySelectionObserver* aMemorySelectionObserver, + MAknFileSelectionObserver* aFileSelectionObserver, + MAknFileSelectionObserver* aFileNamePromptObserver, + const TDesC& aStartFolder, + TInt aIncludedMedias ); + + }; + +#endif // AKNCOMMONDIALOGSDYNMEM_H diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/common_file_dialogs_api/inc/CAknCommonDialogsBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classicui_plat/common_file_dialogs_api/inc/CAknCommonDialogsBase.h Thu Jul 29 14:21:56 2010 +0800 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Base class for Common File Dialogs. +* +*/ + + +#ifndef CAKNCOMMONDIALOGSBASE_H +#define CAKNCOMMONDIALOGSBASE_H + +// INCLUDES +#include +#include + +// CONSTANTS + +/** +* Enumerations for different dialogs. A dialog loads its default values +* (such as softkey texts and title) depending on its type. +*/ +enum TCommonDialogType + { + ECFDDialogTypeNormal, + ECFDDialogTypeSelect, + ECFDDialogTypeSave, + ECFDDialogTypeMove, + ECFDDialogTypeBrowse, + ECFDDialogTypeDefaultSetting, //Cannot be used in multi-drive + ECFDDialogTypeCopy + }; + +/** +* Text that is shown when Common File Dialogs panics. +*/ +_LIT( KCFDPanicText, "CommonDialogs" ); + +/** +* Enumerations for Common File Dialog panics. +*/ +enum TCFDPanics + { + ECFDPanicInvalidFilterType = 1, + ECFDPanicInvalidFilterStyle = 2, + ECFDPanicInvalidAttributeFilterDataLength = 3, + ECFDPanicInvalidAttributeFilterDataCount = 4, + ECFDPanicInvalidFileNameFilterDataLength = 5, + ECFDPanicInvalidFileNameFilterDataCount = 6, + ECFDPanicNoLocationStructures = 7, + ECFDPanicRootPathNotDefined = 8, + ECFDPanicNoPathForFileNamePromptDialog = 9, + ECFDPanicOutOfBounds = 10, + ECFDPanicNullParameter = 11, + ECFDPanicNoResourceDefined = 12, + ECFDPanicTitleOrSoftkeyNotSet = 13 + }; + +// FORWARD DECLARATIONS +class CCoeEnv; + +// CLASS DEFINITION +/** +* Base class for Common File Dialogs. +* Can't be created without derivation because of the protected constructor. +* Opens CFD's resource in BaseConstructL. +* +* @lib CommonDialogs.lib +* @since 1.2 +*/ +NONSHARABLE_CLASS(CAknCommonDialogsBase) : public CBase + { + public: // Enumerations + + /** + * Sometimes it is necessary to know if dialog was exited by + * left softkey or selection key. This enumeration works as TBool, + * ERightSoftkey is not true and other return values are. + * For example, memory selection dialog and file selection dialog + * return values of this enumeration. + */ + enum TReturnKey + { + ERightSoftkey = EFalse, + ELeftSoftkey, + ESelectionKey + }; + + protected: // Constructors and destructors + + CAknCommonDialogsBase(); + + virtual ~CAknCommonDialogsBase(); + + /** + * Loads resource of Common File Dialogs on any language. + */ + void BaseConstructL(); + + protected: // Data + + /** + * Ref: Pointer to control environment. + * Pointer is cached because using of CCoeEnv::Static() is slow. + * For direct use for derived classes. + */ + CCoeEnv* iCoeEnv; + + private: // Data + + // Own: Loads resource file of Common File Dialogs on any language. + RConeResourceLoader iResourceLoader; + }; + +#endif // CAKNCOMMONDIALOGSBASE_H + +// End of File diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/common_file_dialogs_api/inc/CAknFileNamePromptDialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classicui_plat/common_file_dialogs_api/inc/CAknFileNamePromptDialog.h Thu Jul 29 14:21:56 2010 +0800 @@ -0,0 +1,202 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Dialog used to prompt filename. +* +*/ + + +#ifndef CAKNFILENAMEPROMPTDIALOG_H +#define CAKNFILENAMEPROMPTDIALOG_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class MAknFileSelectionObserver; + +// CLASS DEFINITION +/** +* A class that launches a pop-up dialog for filename prompting. +* +* @lib CommonDialogs.lib +* @since 1.2 +*/ +NONSHARABLE_CLASS(CAknFileNamePromptDialog) : public CAknCommonDialogsBase + { + public: // Constructors and destructors + + /** + * Static constructor. + * Creates Filename Prompt Dialog with default values. + * @return Returns a pointer to an instance of itself. + */ + IMPORT_C static CAknFileNamePromptDialog* NewL(); + + /** + * Static constructor. + * @param aResourceId A resource id (FILENAMEPROMPTDIALOG). + * @return Returns a pointer to an instance of itself. + */ + IMPORT_C static CAknFileNamePromptDialog* NewL( TInt aResourceId ); + + IMPORT_C ~CAknFileNamePromptDialog(); + + public: // New functions + + /** + * Sets path from which is checked if a file already exists. + * @param aPath Full path with trailing backslash. + */ + IMPORT_C void SetPathL( const TDesC& aPath ); + + /** + * Sets an observer which is asked if if the filename user inputs + * can be accepted. + * @param aObserver A pointer to an observer (implemented in an application). + */ + IMPORT_C void SetObserver( MAknFileSelectionObserver* aObserver ); + + /** + * Sets prompt text (title) for dialog. + * @param aText Title text. + */ + IMPORT_C void SetTitleL( const TDesC& aText ); + + /** + * Sets the text used for left softkey. + * @param aText The text used for left softkey. + */ + IMPORT_C void SetLeftSoftkeyL( const TDesC& aText ); + + /** + * Sets the text used for right softkey. + * @param aText The text used for right softkey. + */ + IMPORT_C void SetRightSoftkeyL( const TDesC& aText ); + + /** + * Executes the filename prompt dialog. + * @param aFileName A reference to filename. + * If parameter is set, it is used as default filename. + * @return Returns true if user has accepted filename and false + * if user hits cancel. + */ + IMPORT_C TBool ExecuteL( TDes& aFileName ); + + /** + * A static method for launching a filename prompt dialog. + * Parameters are described in method RunL + */ + IMPORT_C static TBool RunDlgLD( TDes& aFileName, + const TDesC& aPath, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method for launching a filename prompt dialog. + * Parameters are described in method RunL + */ + IMPORT_C static TBool RunDlgLD( TDes& aFileName, + const TDesC& aPath, + const TDesC& aTitle, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method for launching a filename prompt dialog. + * Parameters are described in method RunL + */ + IMPORT_C static TBool RunDlgLD( TDes& aFileName, + const TDesC& aPath, + TInt aResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A method for use this dialog for renaming file + * + * @param aFileName File name user input + * @return Returns true if user has accepted filename and false + * if user hits cancel. + * @since 3.2 + */ + IMPORT_C TBool RenameL( TDes& aFileName ); + private: // New functions + + /** + * A static method for launching a filename prompt dialog. + * Method is called from a RunDlgLD method with correct parameters. + * @param aResourceId A resource id (FILENAMEPROMPTDIALOG). + * @param aFileName A reference to a filename as described in ExecuteL. + * @param aPath Full path with trailing backslash. + * @param aTitle The text for title. + * @param aObserver An observer which is assigned to NULL by default. + */ + static TBool RunL( + TInt aResourceId, + TDes& aFileName, + const TDesC& aPath, + const TDesC& aTitle, + MAknFileSelectionObserver* aObserver ); + + /** + * Sets default CFD resource id. + */ + void SetResourceId( TInt& aResourceId ) const; + + /** + * Reads settings from resource. + */ + void ReadFromResourceL( TInt aResourceId ); + + /** + * Handle file name dialog for both creating and renaming + * @param aFileName File name user input + * @param aIfRename True for renaming; False for creating + * @return Returns true if user has accepted filename and false + * if user hits cancel. + * @since 3.2 + */ + TBool ShowDialogL( TDes& aFilename, TBool aIfRename ); + private: // Constructors and destructors + + /** + * Second phase construct from resource. + * @param aResourceId A resource id (FILENAMEPROMPTDIALOG). + */ + void ConstructFromResourceL( TInt aResourceId ); + + CAknFileNamePromptDialog(); + + protected: // Data + + // Ref: observer + MAknFileSelectionObserver* iObserver; + + // Own: Descriptor for default filename + HBufC* iDefaultFileName; + + // Own: Descriptor for path + HBufC* iPath; + + // Own: Descriptor for window title + HBufC* iTitle; + + // Own: Descriptor for left softkey + HBufC* iLeftSoftkey; + + // Own: Descriptor for right softkey + HBufC* iRightSoftkey; + }; + +#endif // CAKNFILENAMEPROMPTDIALOG_H + +// End of File diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/common_file_dialogs_api/inc/CAknFileSelectionDialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classicui_plat/common_file_dialogs_api/inc/CAknFileSelectionDialog.h Thu Jul 29 14:21:56 2010 +0800 @@ -0,0 +1,251 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Dialog used to select target file or directory +* +*/ + + +#ifndef CAKNFILESELECTIONDIALOG_H +#define CAKNFILESELECTIONDIALOG_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CAknFileSelectionModel; +class CAknFileSelectionEventHandler; +class MAknFileSelectionObserver; +class MAknFileFilter; + +// CLASS DEFINITION +/** +* A class that launches a popup dialog for file selection or directory browsing. +* +* @lib CommonDialogs.lib +* @since 1.2 +*/ +NONSHARABLE_CLASS(CAknFileSelectionDialog) : public CAknCommonDialogsBase + { + public: // Constructors and destructors + /** + * Static constructor. + * @param aDialogType Type of the dialog for reading correct default values. + * @return Returns a pointer to an instance of itself. + */ + IMPORT_C static CAknFileSelectionDialog* NewL( + TCommonDialogType aDialogType ); + + /** + * Static constructor. + * @param aDialogType Type of the dialog for reading correct default values. + * @param aResourceId A resource id (FILESELECTIONDIALOG). + * @return Returns a pointer to an instance of itself. + */ + IMPORT_C static CAknFileSelectionDialog* NewL( + TCommonDialogType aDialogType, TInt aResourceId ); + + IMPORT_C ~CAknFileSelectionDialog(); + + public: // New functions + + /** + * Sets an observer which is asked if the selected item can be selected. + * @param aObserver A pointer to an observer. + */ + IMPORT_C void SetObserver( MAknFileSelectionObserver* aObserver ); + + /** + * Adds a filter to list of filters owned by the engine. + * Note! The ownership of the filter is transferred to the engine. + * @param aFilter A pointer to a filter that is derived from MAknFileFilter. + */ + IMPORT_C void AddFilterL( MAknFileFilter* aFilter ); + + /** + * Sets the default folder that browsing is started from. + * @param aDefaultFolder A folder that is relative to the root path, + * e.g. root path = "C:\" so the default folder could be + * "Nokia\Images\". + */ + IMPORT_C void SetDefaultFolderL( const TDesC& aDefaultFolder ); + + /** + * Sets title to the pop-up dialog. + * @param aText Title text. + */ + IMPORT_C void SetTitleL( const TDesC& aText ); + + /** + * Sets the text used for left softkey when a file is focused. + * @param aText The text for softkey. + */ + IMPORT_C void SetLeftSoftkeyFileL( const TDesC& aText ); + + /** + * Sets the text used for left softkey when a folder is focused. + * @param aText The text for softkey. + */ + IMPORT_C void SetLeftSoftkeyFolderL( const TDesC& aText ); + + /** + * Sets the text used for right softkey when user is in the root folder. + * @param aText The text used for right softkey when user is in the root folder. + */ + IMPORT_C void SetRightSoftkeyRootFolderL( const TDesC& aText ); + + /** + * Sets the text used for right softkey when user is in a subfolder. + * @param aText The text used for right softkey when user is in a subfolder. + */ + IMPORT_C void SetRightSoftkeySubfolderL( const TDesC& aText ); + + /** + * Executes the file selection dialog. + * @param aFileName Contains the root path. + * If an item is selected, the selected item will be set to the + * parameter with full path. + * @return Returns ETrue if user has selected an item and EFalse + * if user hits cancel. + */ + IMPORT_C TBool ExecuteL( TDes& aFileName ); + + /** + * A static method that launches a file selection dialog. + * @see RunL() + */ + IMPORT_C static TBool RunDlgLD( TDes& aFileName, + const TDesC& aDefaultFolder, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches a file selection dialog. + * @see RunL() + */ + IMPORT_C static TBool RunDlgLD( TDes& aFileName, + const TDesC& aDefaultFolder, + const TDesC& aTitle, + MAknFileSelectionObserver* aObserver = NULL ); + + /** + * A static method that launches a file selection dialog. + * @see RunL() + */ + IMPORT_C static TBool RunDlgLD( TDes& aFileName, + const TDesC& aDefaultFolder, + TInt aResourceId, + MAknFileSelectionObserver* aObserver = NULL ); + + private: // New functions + + /** + * A static method for launching a file selection dialog. + * Creates, constructs, runs and deletes a file selection dialog with + * different parameters. + * @param aResourceId An id of a resource. If zero, default resource is used. + * @param aFileName A reference to a filename. Must contain the root path + * to start browsing from (if the root path is not defined in + * resource). If user accepts a selection, the whole path + current + * filename is set to aFileName. + * @param aDefaultFolder A descriptor that contains one or more folders + * that are relative to the root path. Browsing is started from + * the default folder and user can browse folders up all the way + * to the root folder. + * @param aTitle A title for file selection dialog. + * @param aObserver An observer which is asked if the selected item + * can be selected. Implemented in application. + * @return Returns true if user has selected an item and false + * if user hits cancel. + */ + static TBool RunL( + TInt aResourceId, + TDes& aFileName, + const TDesC& aDefaultFolder, + const TDesC& aTitle, + MAknFileSelectionObserver* aObserver ); + + /** + * Initialization method that must be called before executing the dialog. + * Initializes the engine and event handler with correct values. + * Decides if the dialog should be shown or not. + * Called in ExecuteL. + * @param aFileName The root path. + * @return Returns EFalse if the dialog cannot be executed. + */ + TBool PrepareL( const TDesC& aFileName ); + + /** + * Sets id to a default CFD resource depending on dialog type. + * @param aResourceId Resource id variable to be modified. + * @param aType Dialog type. + */ + void SetResourceId( TInt& aResourceId, TCommonDialogType aType ) const; + + /** + * Reads settings from resource. + * @param aResourceId Resource id. + */ + void ReadFromResourceL( TInt aResourceId ); + + private: // Constructors and destructors + + CAknFileSelectionDialog( TCommonDialogType aDialogType ); + + /** + * Second phase construct. Constructs itself from a resource. + * @param aResourceId A resource id (FILESELECTIONDIALOG). + */ + void ConstructFromResourceL( TInt aResourceId ); + + private: // Data + + // Own: Dialog type + TCommonDialogType iDialogType; + + // Own: Model + CAknFileSelectionModel* iModel; + + // Own: Event handler + CAknFileSelectionEventHandler* iEventHandler; + + // Ref: Observer + MAknFileSelectionObserver* iObserver; + + // Own: Title + HBufC* iTitle; + + // Own: Left softkey when file focused + HBufC* iLeftSoftkeyFile; + + // Own: Left softkey when folder focused + HBufC* iLeftSoftkeyFolder; + + // Own: Right softkey when in root folder + HBufC* iRightSoftkeyRootFolder; + + // Own: Right softkey when in subfolder + HBufC* iRightSoftkeySubfolder; + + // Own: Root path + HBufC* iRootPath; + + // Own: Default folder + HBufC* iDefaultFolder; + + // Own: Boolean value that tells if the dialog has been executed already. + TBool iExecuted; + }; + +#endif // CAKNFILESELECTIONDIALOG_H + +// End of File diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/common_file_dialogs_api/inc/CAknMemorySelectionDialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classicui_plat/common_file_dialogs_api/inc/CAknMemorySelectionDialog.h Thu Jul 29 14:21:56 2010 +0800 @@ -0,0 +1,371 @@ +/* +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Dialog used to selection target memory. +* +*/ + + +#ifndef C_AKNMEMORYSELECTIONDIALOG_H +#define C_AKNMEMORYSELECTIONDIALOG_H + +#include +#include // CDesCArray + +class CAknMemorySelectionModel; +class CAknMemorySelectionEventHandler; +class MAknMemorySelectionObserver; +class TDriveInfo; +class CAknIconArray; + +/** + * A class that launches a pop-up dialog for memory selection. + * + * @lib CommonDialogs.lib + * @since S60 1.2 + */ +NONSHARABLE_CLASS(CAknMemorySelectionDialog) : public CAknCommonDialogsBase + { + +public: + +// Enumerations + /** + * @Deprecated: This only works with fixed C: and E: drives. + * Enumerations for memory items in listbox . + */ + enum TMemory + { + EPhoneMemory = 0, // C: + EMemoryCard, // E: + EMemoryCount // must remain last one + }; + +// Constructors and destructors + + /** + * Static constructor. + * + * @since S60 3.2 + * @param aDialogType Defines the type of the dialog in order to read + * correct default settings for title and softkeys from resource. + * @param aShowUnavailableDrives Defines whether unavailable or corrupted + * drives are shown in memory selection list or not. + * @return Returns a pointer to an instance of itself. + */ + IMPORT_C static CAknMemorySelectionDialog* NewL( + TCommonDialogType aDialogType, + TBool aShowUnavailableDrives ); + + + /** + * Static constructor. + * + * @since S60 3.2 + * @param aDialogType Defines the type of the dialog in order to read + * correct default settings for title and softkeys from resource. + * @param aResourceId A resource id (MEMORYSELECTIONDIALOG). + * @param aShowUnavailableDrives Defines whether unavailable or corrupted + * drives are shown in memory selection list or not. + * @return Returns a pointer to an instance of itself. + */ + IMPORT_C static CAknMemorySelectionDialog* NewL( + TCommonDialogType aDialogType, + TInt aResourceId, + TBool aShowUnavailableDrives ); + + /** + * Static constructor. + * + * @since S60 3.2 + * @param aDialogType Defines the type of the dialog in order to read + * correct default settings for title and softkeys from resource. + * @param aResourceId A resource id (MEMORYSELECTIONDIALOG). + * @param aShowUnavailableDrives Defines whether unavailable or corrupted + * drives are shown in memory selection list or not. + * @param aIncludedMedias bit flag definition of which medias are + * included in the dialog. See TMemoryTypes. + * @return Returns a pointer to an instance of itself. + */ + IMPORT_C static CAknMemorySelectionDialog* NewL( + TCommonDialogType aDialogType, + TInt aResourceId, + TBool aShowUnavailableDrives, + TInt aIncludedMedias ); + + IMPORT_C virtual ~CAknMemorySelectionDialog(); + +// New functions + + /** + * Sets an observer which is asked if the selected item can be selected. + * + * @param aObserver A pointer to an observer. + */ + IMPORT_C void SetObserver( MAknMemorySelectionObserver* aObserver ); + + /** + * Sets title for the dialog. + * + * @param aText Title text. + */ + IMPORT_C void SetTitleL( const TDesC& aText ); + + /** + * Sets the text used for left softkey. + * + * @param aText The text used for left softkey. + */ + IMPORT_C void SetLeftSoftkeyL( const TDesC& aText ); + + /** + * Sets the text used for right softkey. + * + * @param aText The text used for right softkey. + */ + IMPORT_C void SetRightSoftkeyL( const TDesC& aText ); + + /** + * Gets an item from memory selection dialog at specified index. + * + * @param aIndex Index to the item in the memory selection list. + * @param aItem A reference to a descriptor where the item is stored. + */ + IMPORT_C void GetItem( TInt aIndex, TDes& aItem ); + + /** + * Gets the location paths of a memory. + * + * @param aSelectedMemory The memory that was selected. + * @param aRootPath A pointer to a descriptor where the root path + * of the selected memory is stored. Must have KMaxFileName space. + * Set to NULL to ignore. + * @param aDefaultFolder A pointer to a descriptor where the default folder + * of the selected memory is stored. Must have KMaxFileName space. + * Set to NULL to ignore. + */ + IMPORT_C void GetMemories( TMemory aSelectedMemory, + TDes* aRootPath, + TDes* aDefaultFolder ); + + /** + * Executes the memory selection dialog. Virtual to allow derivation. + * + * @param aSelectedMemory A reference to a memory (TMemory). + * If one of the memories is selected, the selected memory is + * stored to the parameter. + * @return Returns true if user has selected an item and false + * if user hits cancel. + */ + IMPORT_C virtual TReturnKey ExecuteL( TMemory& aSelectedMemory ); + + /** + * Executes the memory selection dialog. Virtual to allow derivation. + * + * @param aSelectedMemory A reference to a memory (TMemory). + * If one of the memories is selected, the selected memory is + * stored to the parameter. + * @param aRootPath A pointer to a descriptor where the root path + * of the selected memory is stored. + * @param aDefaultFolder A pointer to a descriptor where the default folder + * of the selected memory is stored. + * @return Returns true if user has selected an item and false + * if user hits cancel. + */ + IMPORT_C virtual TReturnKey ExecuteL( + TMemory& aSelectedMemory, + TDes* aRootPath, TDes* aDefaultFolder ); + + /** + * A static method that launches a memory selection dialog. + * @see RunL() + */ + IMPORT_C static TBool RunDlgLD( + TMemory& aSelectedMemory, + MAknMemorySelectionObserver* aObserver = NULL ); + + /** + * A static method that launches a memory selection dialog. + * @see RunL() + */ + IMPORT_C static TBool RunDlgLD( + TMemory& aSelectedMemory, + const TDesC& aTitle, + MAknMemorySelectionObserver* aObserver = NULL ); + + /** + * A static method that launches a memory selection dialog. + * @see RunL() + */ + IMPORT_C static TBool RunDlgLD( + TMemory& aSelectedMemory, + TInt aResourceId, + TDes* aRootPath = NULL, TDes* aDefaultFolder = NULL, + MAknMemorySelectionObserver* aObserver = NULL ); + + /** + * Returns the number of items in list box array. + * Not exported, for CFD internal use only. + * + * @return Returns the number of items in list box array. + */ + TInt NumberOfItems() const; + + /** + * 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. + * + * @since S60 3.2 + * @param aLbxIndex Index to the selected listbox item. + * @param 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. + * @param 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. + * @return 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 GetDrivePaths( TInt aLbxIndex, + TDes* aRootPath, + TDes* aDefaultFolder ); + +protected: + +// Constructors and destructors + + CAknMemorySelectionDialog( TCommonDialogType aDialogType ); + + /** + * Constructs class from resource + * + * @param aResourceId ID of the resource. Can be zero. + * @param aShowUnavailableDrives Defines whether unavailable or corrupted + * drives are shown in memory selection list or not. + */ + virtual void ConstructFromResourceL( + TInt aResourceId, + TBool aShowUnavailableDrives ); + + /** + * Constructs class from resource + * + * @param aResourceId ID of the resource. Can be zero. + * @param aShowUnavailableDrives Defines whether unavailable or corrupted + * drives are shown in memory selection list or not. + * @param aIncludedMedias bit flag definition of which medias are + * included in the dialog. See TMemoryTypes. + */ + virtual void ConstructFromResourceL( + TInt aResourceId, + TBool aShowUnavailableDrives, + TInt aIncludedMedias ); + +private: + +// New functions + + /** + * A static method for launching a memory selection dialog. + * Creates, constructs, runs and deletes a memory selection dialog with + * different parameters. + * + * @param aResourceId An id of a resource. + * @param aSelectedMemory A reference to a memory described in ExecuteL. + * @param aRootPath A pointer to a descriptor where the root path + * of the selected memory is stored. + * @param aDefaultFolder A pointer to a descriptor where the default folder + * of the selected memory is stored. + * @param aTitle A title for memory selection dialog. + * @param aObserver An observer which is asked if the selected item + * can be selected. Implemented in application.. + */ + static TBool RunL( + TInt aResourceId, + TMemory& aSelectedMemory, + TDes* aRootPath, + TDes* aDefaultFolder, + const TDesC& aTitle, + MAknMemorySelectionObserver* aObserver ); + + + /** + * Sets id to a default CFD resource depending on dialog type. + */ + void SetResourceId( TInt& aResourceId, TCommonDialogType aDialogType ) + const; + + /** + * Reads settings from resource. + * + * @param aResourceId Resource's ID to be read. + * @param aResourceDefined If user defines the resource. + */ + void ReadFromResourceL( TInt aResourceId, TBool aResourceDefined ); + + /** + * Loads icons into the icon-array. + * @param aIconArray Array of which to append the loaded icons. + * @param aDoubleStyle Is the dialog doublestyle. + */ + void LoadIconsL( CAknIconArray* aIconArray, TBool aDoubleStyle ); + + /** + * Loads default root and default paths of phone memory & memory card + */ + void GetSystemPathsL(); + +protected: // Data + + // Own: Dialog type + TCommonDialogType iDialogType; + + // Own: Model + CAknMemorySelectionModel* iModel; + + // Own: Event handler + CAknMemorySelectionEventHandler* iEventHandler; + + // Ref: Observer + MAknMemorySelectionObserver* iObserver; + + // Own: Title + HBufC* iTitle; + + // Own: Left softkey text + HBufC* iLeftSoftkey; + + // Own: Right softkey text + HBufC* iRightSoftkey; + + // Own: Root path array + // iDynamicDrivesEnabled indicates the content of this array. + CDesCArrayFlat iRootPathArray; + + // Own: Default folder array + CDesCArrayFlat iDefaultFolderArray; + + // Own: ETrue if dynamic drive reading is enabled + // EFalse if drives are static (C: and E:). + // This affects iRootPathArray and iDefaultFolderArray content and + // ordering. + TBool iDynamicDrivesEnabled; + + TInt iIncludedMedias; + }; + +#endif // C_AKNMEMORYSELECTIONDIALOG_H diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/common_file_dialogs_api/inc/CAknMemorySelectionSettingItem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classicui_plat/common_file_dialogs_api/inc/CAknMemorySelectionSettingItem.h Thu Jul 29 14:21:56 2010 +0800 @@ -0,0 +1,87 @@ +/* +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: The setting item to use CAknMemorySelectionSettingPage. +* +*/ + + + +#ifndef C_AKNMEMORYSELECTIONSETTINGITEM_H +#define C_AKNMEMORYSELECTIONSETTINGITEM_H + +#include +#include + +/** + * CAknMemorySelectionSettingItem is a setting item class that + * launches a CAknMemorySelectionSettingPage. + * + * @lib CommonDialogs.lib + * @since S60 1.2 + */ +class CAknMemorySelectionSettingItem : public CAknSettingItem + { +public: + +// Constructors and destructor + + /** + * Constructor + */ + IMPORT_C CAknMemorySelectionSettingItem( + TInt aIdentifier, + CAknMemorySelectionSettingPage::TMemory& aSelectedMemory ); + + IMPORT_C virtual ~CAknMemorySelectionSettingItem(); + IMPORT_C void CompleteConstructionL(); + +// Functions from base class CAknSettingItem + + /** + * From CAknSettingItem + */ + IMPORT_C virtual void EditItemL( TBool aCalledFromMenu ); + + /** + * From CAknSettingItem + */ + IMPORT_C virtual void LoadL(); + + /** + * From CAknSettingItem + */ + IMPORT_C virtual void StoreL(); + + /** + * From CAknSettingItem + */ + IMPORT_C virtual const TDesC& SettingTextL(); + +protected: // Data + + // Ref: External data + CAknMemorySelectionSettingPage::TMemory& iExternalData; + + // Own: Internal data + CAknMemorySelectionSettingPage::TMemory iInternalData; + + // Own: Setting page + CAknMemorySelectionSettingPage* iSettingPage; + + // Own: The length is enough for memory name. + TBuf<64> iSettingText; + + }; + +#endif // C_AKNMEMORYSELECTIONSETTINGITEM_H diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/common_file_dialogs_api/inc/CAknMemorySelectionSettingPage.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classicui_plat/common_file_dialogs_api/inc/CAknMemorySelectionSettingPage.h Thu Jul 29 14:21:56 2010 +0800 @@ -0,0 +1,137 @@ +/* +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Setting page used to selection target memory. +* +*/ + + + +#ifndef C_AKNMEMORYSELECTIONSETTINGPAGE_H +#define C_AKNMEMORYSELECTIONSETTINGPAGE_H + + +#include + +class MAknMemorySelectionObserver; + +/** + * A class that launches a popup setting page for memory selection. + * + * @lib CommonDialogs.lib + * @since S60 1.2 + */ +NONSHARABLE_CLASS(CAknMemorySelectionSettingPage) + : public CAknMemorySelectionDialog + { + +public: + +// Constructors and destructors + + /** + * Static constructor. Loads default settings. + * @return Returns a pointer to an instance of itself. + */ + IMPORT_C static CAknMemorySelectionSettingPage* NewL(); + + /** + * Static constructor. + * @param aResourceId A resource id (MEMORYSELECTIONDIALOG). + * @return Returns a pointer to an instance of itself. + */ + IMPORT_C static CAknMemorySelectionSettingPage* NewL( TInt aResourceId ); + + IMPORT_C ~CAknMemorySelectionSettingPage(); + +// New functions + + /** + * Executes the memory selection setting page. + * + * @param aSelectedMemory A reference to a memory (TMemory). + * If one of the memories is selected, the selected memory is + * stored to the parameter. + * @return Returns true if user has selected an item and false + * if user hits cancel. + */ + IMPORT_C TReturnKey ExecuteL( TMemory& aSelectedMemory ); + + + /** + * Executes the memory selection setting page. + * + * @param aSelectedMemory A reference to a memory (TMemory). + * If one of the memories is selected, the selected memory is + * stored to the parameter. + * @param aRootPath A pointer to a descriptor where the root path + * of the selected memory is stored. + * @param aDefaultFolder A pointer to a descriptor where the default folder + * of the selected memory is stored. + * @return Returns true if user has selected an item and false + * if user hits cancel. + */ + IMPORT_C TReturnKey ExecuteL( + TMemory& aSelectedMemory, TDes* aRootPath, TDes* aDefaultFolder ); + + /** + * Static methods for launching memory selection dialog + * Parameters & return value are descibed in method RunL + */ + + IMPORT_C static TBool RunDlgLD( TMemory& aSelectedMemory, + MAknMemorySelectionObserver* aObserver = NULL ); + + IMPORT_C static TBool RunDlgLD( TMemory& aSelectedMemory, + const TDesC& aTitle, + MAknMemorySelectionObserver* aObserver = NULL ); + + IMPORT_C static TBool RunDlgLD( TMemory& aSelectedMemory, + TInt aResourceId, + TDes* aRootPath = NULL, TDes* aDefaultFolder = NULL, + MAknMemorySelectionObserver* aObserver = NULL ); + +private: + +// Constructors and destructors + + CAknMemorySelectionSettingPage(); + +// New functions + + /** + * A static method for launching a memory selection setting page. + * Creates, constructs, runs and deletes a memory selection dialog with + * different parameters. + * + * @param aResourceId An id of a resource. + * @param aSelectedMemory A reference to a memory described in ExecuteL. + * @param aTitle A title for memory selection dialog. + * @param aRootPath A pointer to a descriptor where the root path + * of the selected memory is stored. + * @param aDefaultFolder A pointer to a descriptor where the default folder + * of the selected memory is stored. + * @param aObserver An observer which is asked if the selected item + * can be selected. Implemented in application. + */ + static TBool RunL( + TInt aResourceId, + TMemory& aSelectedMemory, + const TDesC& aTitle, + TDes* aRootPath, + TDes* aDefaultFolder, + MAknMemorySelectionObserver* aObserver ); + + }; + +#endif // C_AKNMEMORYSELECTIONSETTINGPAGE_H diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/common_file_dialogs_api/inc/CommonDialogs.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classicui_plat/common_file_dialogs_api/inc/CommonDialogs.hrh Thu Jul 29 14:21:56 2010 +0800 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains declarations for resources. +* The file can be included in C++ or resource file. +* +*/ + + +#ifndef COMMONDIALOGS_HRH +#define COMMONDIALOGS_HRH + +enum TFileFilterType + { + EFilenameFilter = 0, + EAttributeFilter + }; + +enum TFileFilterStyle + { + EInclusiveFilter = 0, + EExclusiveFilter + }; + +#endif // COMMONDIALOGS_HRH + +// End of File diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/common_file_dialogs_api/inc/CommonDialogs.rh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classicui_plat/common_file_dialogs_api/inc/CommonDialogs.rh Thu Jul 29 14:21:56 2010 +0800 @@ -0,0 +1,131 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This file contains declarations for resources of +* Common File Dialogs. The file can be included only in +* resource file. +* +*/ + + +// INCLUDES + +// STRUCTURE DEFINITIONS + +// --------------------------------------------------------- +// FILTER +// FILTER is a resource structure for filter definition. +// "filter_type" defines if the filter is an attribute or a filename filter. +// "filter_style" defines if the filter is an inclusive or an exclusive filter. +// Inclusive filter doesn't accept anything but the files and folders (entries) +// that match with the filter. Exclusive filter accepts only those entries +// that match with the filter. +// "filter_data" is an array of strings: +// In filename filter data is wildcards ("*.jpg", "*.gif", ...). +// In attribute filter data is first letters of attributes +// ("R", "H", "S", ... or "RHS"). +// The attributes in Symbian OS file system are: +// Read only, Hidden, System, Volume, Directory and Archive +// Note! Files and directories with System attribute are always hidden +// from user. +// --------------------------------------------------------- +// +STRUCT FILTER + { + WORD filter_type; + WORD filter_style; + LTEXT filter_data[]; + } + +// --------------------------------------------------------- +// LOCATION +// LOCATION is a resource structure that defines a root path and a default folder. +// "root_path" is the absolute path to be considered as root when browsing. +// e.g. "C:\\Nokia\\" +// "default_folder" is the folder where browsing is started. +// e.g. "Images\\Pictures\\" +// Note! Do not put folder names in .LOC file! These are +// physical file system paths. Possible localization is done +// in the DLL. +// Note! Remeber to use trailing backslash! +// --------------------------------------------------------- +// +STRUCT LOCATION + { + LTEXT root_path; + LTEXT default_folder; + } + +// --------------------------------------------------------- +// MEMORYSELECTIONDIALOG +// MEMORYSELECTIONDIALOG is a resource structure for memory selection dialog. +// In this structure a title and texts for softkeys can be defined. +// "title" is "Select memory:" by default if it is not defined. +// Locations of the memories can be defined. +// NOTE: Locations for memory selection dialog is deprecated. Only use it +// when using TMemory parameter in CAknMemorySelectionDialog +// @see CAknMemorySelectionDialog +// --------------------------------------------------------- +// +STRUCT MEMORYSELECTIONDIALOG + { + LTEXT title; + LTEXT softkey_1; + LTEXT softkey_2; + STRUCT locations[]; // LOCATION + } + +// --------------------------------------------------------- +// FILESELECTIONDIALOG +// This is a resource structure for file selection dialog. +// In this structure a title and texts for softkeys can be defined. +// "title" is "Select from:" by default if it is not defined. +// "softkey_1_file" is shown when a file is focused. +// "softkey_1_folder" is shown when a folder is focused. +// "softkey_2_root_level" is shown when user is browsing in the first level (root folder). +// "softkey_2_subfolder" is shown when user is browsing in a subfolder +// "root_path" and "default_folder" can be defined. They are explained in LOCATION struct. +// Filters can be defined with FILTER structures. +// --------------------------------------------------------- +// +STRUCT FILESELECTIONDIALOG + { + LTEXT title; + LTEXT softkey_1_file; + LTEXT softkey_1_folder; + LTEXT softkey_2_root_level; + LTEXT softkey_2_subfolder; + LTEXT root_path; + LTEXT default_folder; + STRUCT filters[]; // FILTER structs + } + +// --------------------------------------------------------- +// FILENAMEPROMPTDIALOG +// A structure for prompting a single filename. +// In this structure a title and texts for softkeys can be defined. +// "default_filename" defines the default filename. Extension is not shown. +// "path" is the path that the file is supposed to save. +// If path is set, it can be checked if file already exists. +// --------------------------------------------------------- +// +STRUCT FILENAMEPROMPTDIALOG + { + LTEXT filename_prompt; // title + LTEXT default_filename; + LTEXT path; + LTEXT softkey_1; + LTEXT softkey_2; + } + +// End of File diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/common_file_dialogs_api/inc/MAknFileFilter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classicui_plat/common_file_dialogs_api/inc/MAknFileFilter.h Thu Jul 29 14:21:56 2010 +0800 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Filter interface for file selection. +* +*/ + + +#ifndef MAKNFILEFILTER_H +#define MAKNFILEFILTER_H + +// INCLUDES +#include // TBool + +// FORWARD DECLARATIONS +class TEntry; + +// CLASS DEFINITION +/** +* An abstract interface class for filters. +* +* @lib CommonDialogs.lib +* @since 1.2 +*/ +class MAknFileFilter + { + public: // Constructors and destructors + /** + * A virtual destructor to ensure that correct destructor gets called. + * Must have an empty implementation. + */ + virtual ~MAknFileFilter() { }; + + public: + /** + * Checks if a file is accepted by the filter. + * @param aDriveAndPath Drive and full path of the file. + * @param aEntry A directory entry. + * @return Returns ETrue if filter accepts the file. + */ + virtual TBool Accept( const TDesC& aDriveAndPath, const TEntry& aEntry ) const = 0; + + }; + +#endif // MAKNFILEFILTER_H + +// End of File diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/common_file_dialogs_api/inc/MAknFileSelectionObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classicui_plat/common_file_dialogs_api/inc/MAknFileSelectionObserver.h Thu Jul 29 14:21:56 2010 +0800 @@ -0,0 +1,59 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Observer interface for file selection. +* +*/ + + +#ifndef MAKNFILESELECTIONOBSERVER_H +#define MAKNFILESELECTIONOBSERVER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class TEntry; + +// CLASS DEFINITION +/** +* Observer class that can be set to observe if selected item +* e.g. has correct size or date before letting dialog exit. +* +* @lib CommonDialogs.lib +* @since 1.2 +*/ +class MAknFileSelectionObserver + { + public: // Constructors and destructor + + /** + * A virtual destructor to ensure that correct destructor gets called. + * Must have an empty implementation. + */ + virtual ~MAknFileSelectionObserver() { }; + + public: // New functions + + /** + * Get's called when user selects an file. + * @param aDriveAndPath Drive and full path of the file. + * @param aEntry An entry containing all information of selected item. + * @return Returns ETrue if it is ok to exit from dialog. + */ + virtual TBool OkToExitL( const TDesC& aDriveAndPath, const TEntry& aEntry ) = 0; + }; + +#endif // MAKNFILESELECTIONOBSERVER_H + +// End of File diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/common_file_dialogs_api/inc/MAknMemorySelectionObserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classicui_plat/common_file_dialogs_api/inc/MAknMemorySelectionObserver.h Thu Jul 29 14:21:56 2010 +0800 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Observer interface for memory selection. +* +*/ + + + +#ifndef M_AKNMEMORYSELECTIONOBSERVER_H +#define M_AKNMEMORYSELECTIONOBSERVER_H + +#include + +/** +* Observer class that can be set to observe if selected memory +* e.g. has enoung free space before letting dialog exit. +* +* @lib CommonDialogs.lib +* @since 1.2 +*/ +class MAknMemorySelectionObserver + { + +public: + +// Constructors and destructor + + /** + * A virtual destructor to ensure that correct destructor gets called. + * Must have an empty implementation. + */ + virtual ~MAknMemorySelectionObserver() { }; + +// New functions + + /** + * Get's called when user selects a memory. + * @param aMemory Currently selected memory. + * @return Returns ETrue if it is ok to exit from dialog. + */ + virtual TBool OkToExitL( CAknMemorySelectionDialog::TMemory aMemory ) = 0; + + }; + +#endif // M_AKNMEMORYSELECTIONOBSERVER_H diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/common_file_dialogs_api/inc/caknmemoryselectiondialogmultidrive.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classicui_plat/common_file_dialogs_api/inc/caknmemoryselectiondialogmultidrive.h Thu Jul 29 14:21:56 2010 +0800 @@ -0,0 +1,438 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: New memory selection dialog to support multiple drives. +* +*/ + + + +#ifndef C_AKNMEMORYSELECTIONDIALOGMULTIDRIVE_H +#define C_AKNMEMORYSELECTIONDIALOGMULTIDRIVE_H + +#include +#include // CDesCArray +#include // TDriveNumber + +class CAknMemorySelectionModelMultiDrive; +class CAknMemorySelectionEventHandler; +class MAknMemorySelectionObserver; +class TDriveInfo; +class CAknIconArray; + +/** + * A class that launches a pop-up dialog for memory (drive) selection. + * + * It is used to replace CAknMemorySelectionDialog class to support multiple + * drives. + * + * @lib CommonDialogs.lib + * @since S60 5.0 + */ +NONSHARABLE_CLASS( CAknMemorySelectionDialogMultiDrive ) + : public CAknCommonDialogsBase + { +public: + + +// Constructors and destructors + + /** + * Static constructor. + * + * @since S60 5.0 + * @param aDialogType Defines the type of the dialog in order to read + * correct default settings for title and softkeys from resource. + * @param aShowUnavailableDrives Defines whether unavailable or corrupted + * drives are shown in memory selection list or not. + * @return Returns a pointer to an instance of itself. + */ + IMPORT_C static CAknMemorySelectionDialogMultiDrive* NewL( + TCommonDialogType aDialogType, + TBool aShowUnavailableDrives ); + + + /** + * Static constructor. + * + * @since S60 5.0 + * @param aDialogType Defines the type of the dialog in order to read + * correct default settings for title and softkeys from resource. + * @param aResourceId A resource id (MEMORYSELECTIONDIALOG). "Locations" + * part of resource is not used any more. + * @param aShowUnavailableDrives Defines whether unavailable or corrupted + * drives are shown in memory selection list or not. + * @return Returns a pointer to an instance of itself. + */ + IMPORT_C static CAknMemorySelectionDialogMultiDrive* NewL( + TCommonDialogType aDialogType, + TInt aResourceId, + TBool aShowUnavailableDrives ); + + /** + * Static constructor. + * + * @since S60 5.0 + * @param aDialogType Defines the type of the dialog in order to read + * correct default settings for title and softkeys from resource. + * @param aResourceId A resource id (MEMORYSELECTIONDIALOG). "Locations" + * part of resource is not used any more. + * @param aShowUnavailableDrives Defines whether unavailable or corrupted + * drives are shown in memory selection list or not. + * @param aIncludedMedias bit flag definition of which medias are + * included in the dialog. See TMemoryTypes. + * @return Returns a pointer to an instance of itself. + */ + IMPORT_C static CAknMemorySelectionDialogMultiDrive* NewL( + TCommonDialogType aDialogType, + TInt aResourceId, + TBool aShowUnavailableDrives, + TInt aIncludedMedias ); + + IMPORT_C virtual ~CAknMemorySelectionDialogMultiDrive(); + +// New functions + + /** + * Sets title for the dialog. + * + * @since S60 5.0 + * @param aText Title text. + */ + IMPORT_C void SetTitleL( const TDesC& aText ); + + /** + * Sets the text used for left softkey. + * + * @since S60 5.0 + * @param aText The text used for left softkey. + */ + IMPORT_C void SetLeftSoftkeyL( const TDesC& aText ); + + /** + * Sets the text used for right softkey. + * + * @param aText The text used for right softkey. + */ + IMPORT_C void SetRightSoftkeyL( const TDesC& aText ); + + /** + * Gets an item from memory selection dialog at specified index. + * + * @since S60 5.0 + * @param aIndex Index to the item in the memory selection list. + * @param aItem A reference to a descriptor where the item is stored. + */ + IMPORT_C void GetItem( TInt aIndex, TDes& aItem ); + + + /** + * Executes the memory selection dialog. Virtual to allow derivation. + * + * @since S60 5.0 + * @param aSelectedDrive A reference to a drive. + * If one of the drives is selected, the selected drive is + * stored to the parameter. + * @return Returns true if user has selected an item and false + * if user hits cancel. + */ + IMPORT_C virtual TReturnKey ExecuteL( TDriveNumber& aSelectedDrive ); + + /** + * Executes the memory selection dialog. Virtual to allow derivation. + * + * @since S60 5.0 + * @param aSelectedDrive A reference to a drive. + * If one of the drives is selected, the selected drive is + * stored to the parameter. + * @param aRootPath A pointer to a descriptor where the root path + * of the selected memory is stored. + * @param aDefaultFolder A pointer to a descriptor where the default folder + * of the selected memory is stored. + * @return Returns true if user has selected an item and false + * if user hits cancel. + */ + IMPORT_C virtual TReturnKey ExecuteL( + TDriveNumber& aSelectedDrive, + TDes* aRootPath, TDes* aDefaultFolder ); + + /** + * A static method that launches a memory selection dialog. + * + * @since S60 5.0 + * @see RunL() + */ + IMPORT_C static TBool RunDlgLD( TDriveNumber& aSelectedDrive ); + + /** + * New overloaded function to support multiple drives. + * A static method that launches a memory selection dialog. + * + * @since S60 5.0 + * @see RunL() + */ + IMPORT_C static TBool RunDlgLD( + TDriveNumber& aSelectedDrive, const TDesC& aTitle ); + + /** + * A static method that launches a memory selection dialog. + * + * @since S60 5.0 + * @see RunL() + */ + IMPORT_C static TBool RunDlgLD( + TDriveNumber& aSelectedDrive, + TInt aResourceId, + TDes* aRootPath = NULL, + TDes* aDefaultFolder = NULL ); + + /** + * Returns the number of items in list box array. + * Not exported, for CFD internal use only. + * + * @return Returns the number of items in list box array. + */ + TInt NumberOfItems() const; + + /** + * Maps drive paths according to drive number. This function is valid + * for dynamic drives. + * + * @since S60 5.0 + * @param aDrive Drive number. + * @param 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. + * @param 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. + * @return 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 GetDrivePaths( TDriveNumber aDrive, + 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. + * + * @since S60 5.0 + * @param aLbxIndex Index to the selected listbox item. + * @param 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. + * @param 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. + * @return 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 GetDrivePaths( TInt aLbxIndex, + TDes* aRootPath, + TDes* aDefaultFolder ); + + /** + * Add user defined root path and default folder into memory selection + * dialog. It is used to replace old user defined resource. + * + * @since S60 5.0 + * @param 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:\Data\Sounds\Digital\ + * E:\Sounds\Digital\ + * F:\Sounds\Digital\ + * ... + * + * @param 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: + * \"MyFolder\" + * ... + * The trailing backslash will be added automatically whether user + * add it or not. + * + * @return Return error code + */ + IMPORT_C TInt AddDrivePathsL( const TDesC& aRootPath, + const TDesC& aDefaultFolder ); + + /** + * Gets item index based on given drive number. + * + * @since S60 5.0 + * @param aDrive Drive to be searched. + * @return Return item index if given drive is found in memory selection + * dialog's drive list. Othewise return KErrNotFound + */ + IMPORT_C TInt FindIndexByDrive( const TDriveNumber& aDrive ); + + /** + * Get drive number based on item index in the listbox + * + * @param aIndex Listbox's item index. + * @return Return drive number + */ + TDriveNumber FindDriveByIndex( const TInt aIndex ); + + /** + * Check if there is any unavailable MMC (not inserted). + * + * @return ETrue There is at least one MMC unavailble. + * EFalse MMC inserted. + */ + TBool HasUnavailbleMMC(); + + /** + * Update model. + * */ + void UpdateModelL(); + +protected: + +// Constructors and destructors + + CAknMemorySelectionDialogMultiDrive( TCommonDialogType aDialogType ); + + /** + * Constructs class from resource + * + * @param aResourceId ID of the resource. Can be zero. + * @param aShowUnavailableDrives Defines whether unavailable or corrupted + * drives are shown in memory selection list or not. + */ + virtual void ConstructFromResourceL( + TInt aResourceId, + TBool aShowUnavailableDrives ); + + /** + * Constructs class from resource + * + * @param aResourceId ID of the resource. Can be zero. + * @param aShowUnavailableDrives Defines whether unavailable or corrupted + * drives are shown in memory selection list or not. + * @param aIncludedMedias bit flag definition of which medias are + * included in the dialog. See TMemoryTypes. + */ + virtual void ConstructFromResourceL( + TInt aResourceId, + TBool aShowUnavailableDrives, + TInt aIncludedMedias ); + +private: + +// New functions + + /** + * New overloaded function to support multiple drives. + * A static method for launching a memory selection dialog. + * Creates, constructs, runs and deletes a memory selection dialog with + * different parameters. + * + * @since S60 5.0 + * @param aResourceId An id of a resource. + * @param aSelectedMemory A reference to a memory described in ExecuteL. + * @param aRootPath A pointer to a descriptor where the root path + * of the selected memory is stored. + * @param aDefaultFolder A pointer to a descriptor where the default folder + * of the selected memory is stored. + * @param aTitle A title for memory selection dialog. + */ + static TBool RunL( + TInt aResourceId, + TDriveNumber& aSelectedDrive, + TDes* aRootPath, + TDes* aDefaultFolder, + const TDesC& aTitle ); + + /** + * Sets id to a default CFD resource depending on dialog type. + */ + void SetResourceId( TInt& aResourceId, TCommonDialogType aDialogType ) + const; + + /** + * Reads settings from resource. + */ + void ReadFromResourceL( TInt aResourceId ); + + /** + * Loads icons into the icon-array. + * @param aIconArray Array of which to append the loaded icons. + * @param aDoubleStyle Is the dialog doublestyle. + */ + void LoadIconsL( CAknIconArray* aIconArray, TBool aDoubleStyle ); + + /** + * Get all user visible drives with information of their root paths and + * default folders. + * Internal usage for memory selection dialog + * @param aUserDefinedId Is the user defined resource id; + */ + void GetSystemDrivesL( TInt aUserDefinedId ); + +protected: + +// Data + + // Own: Dialog type + TCommonDialogType iDialogType; + + // Own: Model + CAknMemorySelectionModelMultiDrive* iModel; + + // Own: Event handler + CAknMemorySelectionEventHandler* iEventHandler; + + // Own: Title + HBufC* iTitle; + + // Own: Left softkey text + HBufC* iLeftSoftkey; + + // Own: Right softkey text + HBufC* iRightSoftkey; + + // Own: Root path array + CDesCArrayFlat iRootPathArray; + + // Own: Default folder array + CDesCArrayFlat iDefaultFolderArray; + + // Own: ETrue if dynamic drive reading is enabled + // EFalse if drives are static (C: and E:). + // This affects iRootPathArray and iDefaultFolderArray content and + // ordering. + TBool iDynamicDrivesEnabled; + + /** + * Indicate which media types of drives could be visible. + */ + TInt iIncludedMedias; + + }; + +#endif // C_AKNMEMORYSELECTIONDIALOGMULTIDRIVE_H diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/common_file_dialogs_api/inc/caknmemoryselectionsettingitemmultidrive.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/classicui_plat/common_file_dialogs_api/inc/caknmemoryselectionsettingitemmultidrive.h Thu Jul 29 14:21:56 2010 +0800 @@ -0,0 +1,107 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: New memory selection setting item to support multiple drives. +* +*/ + + + +#ifndef C_AKNMEMORYSELECTIONSETTINGITEMMULTIDRIVE_H +#define C_AKNMEMORYSELECTIONSETTINGITEMMULTIDRIVE_H + +#include + +class CAknMemorySelectionSettingItemExtension; +class CAknCFDFileSystemEvent; + +/** + * CAknMemorySelectionSettingItemMultiDrive is a setting item class that + * launches a CAknMemorySelectionDialogMultiDrive. It is used to replace + * old CAknMemorySelectionSettingItem for multiple drive support. + * + * @lib CommonDialogs.lib + * @since S60 5.0 + */ +class CAknMemorySelectionSettingItemMultiDrive : public CAknSettingItem + { + +public: + +// Constructors and destructor + + /** + * Constructor + * + * @since s60 5.0 + */ + IMPORT_C CAknMemorySelectionSettingItemMultiDrive( + TInt aIdentifier, + TDriveNumber& aSelectedDrive + ); + + IMPORT_C virtual ~CAknMemorySelectionSettingItemMultiDrive(); + + /** + * The 2nd phase constructor. It is called internally when extension + * object is needed. User also could call it after creating a object of + * CAknMemorySelectionSettingItemMultiDrive. + * + * @since s60 5.0 + */ + IMPORT_C void CompleteConstructionL(); + +// Functions from base class CAknSettingItem + + /** + * From CAknSettingItem + */ + IMPORT_C virtual void EditItemL( TBool aCalledFromMenu ); + + /** + * From CAknSettingItem + */ + IMPORT_C virtual void LoadL(); + + /** + * From CAknSettingItem + */ + IMPORT_C virtual void StoreL(); + + /** + * From CAknSettingItem + */ + IMPORT_C virtual const TDesC& SettingTextL(); + + /** + * Update contents of setting item + */ + void UpdateSettingItemContentL(); + +protected: // Data + + // Ref: External data + TDriveNumber& iExternalData; + + // Own: Internal data + TDriveNumber iInternalData; + + // Own: Pointer to extension object + CAknMemorySelectionSettingItemExtension* iExtension; + + // Own: The length is enough for memory name. + HBufC* iSettingText; + + }; + +#endif // C_AKNMEMORYSELECTIONSETTINGITEMMULTIDRIVE_H diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/group/bld.inf --- a/classicui_plat/group/bld.inf Fri Jul 23 17:08:56 2010 +0800 +++ b/classicui_plat/group/bld.inf Thu Jul 29 14:21:56 2010 +0800 @@ -161,4 +161,6 @@ #include "../information_preview_popup_api/group/bld.inf" #include "../intermediate_state_api/group/bld.inf" #include "../help_launcher_api/group/bld.inf" +#include "../common_file_dialogs_api/group/bld.inf" +#include "../common_file_dialogs_filter_factory_api/group/bld.inf" diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/images_api/tsrc/conf/tctestsdkimages.cfg diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/images_api/tsrc/conf/ui_testsdkimages.cfg diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/images_api/tsrc/group/testsdkimages.mmp diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/images_api/tsrc/group/testsdkimages.pkg diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/indicators_api/tsrc/bwins/testsdkindicatorsu.def diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/info_popup_note_api/tsrc/bwins/testsdkinfopopupnoteu.def diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/info_popup_note_api/tsrc/conf/tctestsdkinfopopupnote.cfg diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/information_preview_popup_api/tsrc/conf/ui_testsdkinformationpreviewpopup.cfg diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/information_preview_popup_api/tsrc/src/testsdkinformationpreviewpopupblocks.cpp diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/intermediate_state_api/inc/aknintermediate.h diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/intermediate_state_api/intermediate_state_api.metaxml diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/labels_api/tsrc/conf/ui_testsdklabelsfilename.cfg diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/labels_api/tsrc/group/testsdklabels.mmp diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/labels_api/tsrc/group/testsdklabels.pkg diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/lists_api/tsrc/conf/tctestsdklistseiklbi.cfg diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/lists_api/tsrc/conf/ui_testsdklistseikclbd.cfg diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/lists_api/tsrc/inc/testsdklistssghpmslistbox.h diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/lists_api/tsrc/inc/testsdklistssghslistbox.h diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/lists_api/tsrc/inc/testsdklistssgpmslistbox.h diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/lists_api/tsrc/inc/testsdklistsshpmslistbox.h diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/lists_api/tsrc/src/testsdklistsblockseiklbv.cpp diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/lists_api/tsrc/src/testsdklistslbicobserver.cpp diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/lists_api/tsrc/src/testsdklistslbsobserver.cpp diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/misc_controls_api/tsrc/conf/ui_testsdkmisccontrols.cfg diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/misc_controls_api/tsrc/data/testsdkmisccontrols.rss diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/setting_pages_api/tsrc/init/testsdksettingpages.ini diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/setting_pages_api/tsrc/src/testakncheckboxsettingpageprotected.cpp diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/toolbar_api/tsrc/bwins/testsdktoolbaru.def diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/tsrc/bc/apps/S60_SDK3.0/bctestbuttons/datasrc/sampleicon.bmp diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/tsrc/bc/apps/S60_SDK3.0/bctestbuttons/datasrc/sampleiconmask.bmp diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/tsrc/bc/apps/S60_SDK3.0/bctesteikbctrl/aif/bctesteikbctrl_lst.bmp diff -r 667edd0b8678 -r 0e1e0022bd03 classicui_plat/tsrc/bc/apps/S60_SDK3.0/bctesteikbctrl/aif/bctesteikbctrl_lst_mask.bmp diff -r 667edd0b8678 -r 0e1e0022bd03 commonuis/group/bld.inf --- a/commonuis/group/bld.inf Fri Jul 23 17:08:56 2010 +0800 +++ b/commonuis/group/bld.inf Thu Jul 29 14:21:56 2010 +0800 @@ -16,3 +16,4 @@ */ #include "../CommonUi/group/bld.inf" +#include "../CommonDialogs/group/bld.inf"