williamr@2: /*
williamr@2: * Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
williamr@2: * All rights reserved.
williamr@2: * This component and the accompanying materials are made available
williamr@4: * under the terms of "Eclipse Public License v1.0"
williamr@2: * which accompanies this distribution, and is available
williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2: *
williamr@2: * Initial Contributors:
williamr@2: * Nokia Corporation - initial contribution.
williamr@2: *
williamr@2: * Contributors:
williamr@2: *
williamr@2: * Description:  Setting page used to selection target memory.
williamr@2: *
williamr@2: */
williamr@2: 
williamr@2: 
williamr@2: 
williamr@2: #ifndef C_AKNMEMORYSELECTIONSETTINGPAGE_H
williamr@2: #define C_AKNMEMORYSELECTIONSETTINGPAGE_H
williamr@2: 
williamr@2: 
williamr@2: #include <CAknMemorySelectionDialog.h>
williamr@2: 
williamr@2: class MAknMemorySelectionObserver;
williamr@2: 
williamr@2: /**
williamr@2:  *  A class that launches a popup setting page for memory selection.
williamr@2:  *
williamr@2:  *  @lib CommonDialogs.lib
williamr@2:  *  @since S60 1.2
williamr@2:  */
williamr@2: NONSHARABLE_CLASS(CAknMemorySelectionSettingPage)
williamr@2:     : public CAknMemorySelectionDialog
williamr@2:     {
williamr@2: 
williamr@2: public:
williamr@2: 
williamr@2: // Constructors and destructors
williamr@2: 
williamr@2:     /**
williamr@2:      * Static constructor. Loads default settings.
williamr@2:      * @return Returns a pointer to an instance of itself.
williamr@2:      */
williamr@2:     IMPORT_C static CAknMemorySelectionSettingPage* NewL();
williamr@2: 
williamr@2:     /**
williamr@2:      * Static constructor.
williamr@2:      * @param aResourceId A resource id (MEMORYSELECTIONDIALOG).
williamr@2:      * @return Returns a pointer to an instance of itself.
williamr@2:      */
williamr@2:     IMPORT_C static CAknMemorySelectionSettingPage* NewL( TInt aResourceId );
williamr@2: 
williamr@2:     IMPORT_C ~CAknMemorySelectionSettingPage();
williamr@2: 
williamr@2: // New functions
williamr@2: 
williamr@2:     /**
williamr@2:      * Executes the memory selection setting page.
williamr@2:      *
williamr@2:      * @param aSelectedMemory A reference to a memory (TMemory).
williamr@2:      *        If one of the memories is selected, the selected memory is
williamr@2:      *        stored to the parameter.
williamr@2:      * @return Returns true if user has selected an item and false
williamr@2:      *         if user hits cancel.
williamr@2:      */
williamr@2:     IMPORT_C TReturnKey ExecuteL( TMemory& aSelectedMemory );
williamr@2: 
williamr@2: 
williamr@2:     /**
williamr@2:      * Executes the memory selection setting page.
williamr@2:      *
williamr@2:      * @param aSelectedMemory A reference to a memory (TMemory).
williamr@2:      *        If one of the memories is selected, the selected memory is
williamr@2:      *        stored to the parameter.
williamr@2:      * @param aRootPath A pointer to a descriptor where the root path
williamr@2:      *        of the selected memory is stored.
williamr@2:      * @param aDefaultFolder A pointer to a descriptor where the default folder
williamr@2:      *        of the selected memory is stored.
williamr@2:      * @return Returns true if user has selected an item and false
williamr@2:      *         if user hits cancel.
williamr@2:      */
williamr@2:     IMPORT_C TReturnKey ExecuteL(
williamr@2:         TMemory& aSelectedMemory, TDes* aRootPath, TDes* aDefaultFolder );
williamr@2: 
williamr@2:     /**
williamr@2:      * Static methods for launching memory selection dialog
williamr@2:      * Parameters & return value are descibed in method RunL
williamr@2:      */
williamr@2: 
williamr@2:     IMPORT_C static TBool RunDlgLD( TMemory& aSelectedMemory,
williamr@2:         MAknMemorySelectionObserver* aObserver = NULL );
williamr@2: 
williamr@2:     IMPORT_C static TBool RunDlgLD( TMemory& aSelectedMemory,
williamr@2:         const TDesC& aTitle,
williamr@2:         MAknMemorySelectionObserver* aObserver = NULL );
williamr@2: 
williamr@2:     IMPORT_C static TBool RunDlgLD( TMemory& aSelectedMemory,
williamr@2:         TInt aResourceId,
williamr@2:         TDes* aRootPath = NULL, TDes* aDefaultFolder = NULL,
williamr@2:         MAknMemorySelectionObserver* aObserver = NULL );
williamr@2: 
williamr@2: private:    
williamr@2: 
williamr@2: // Constructors and destructors
williamr@2: 
williamr@2:     CAknMemorySelectionSettingPage();
williamr@2: 
williamr@2: // New functions
williamr@2: 
williamr@2:     /**
williamr@2:      * A static method for launching a memory selection setting page.
williamr@2:      * Creates, constructs, runs and deletes a memory selection dialog with
williamr@2:      * different parameters.
williamr@2:      *
williamr@2:      * @param aResourceId An id of a resource.
williamr@2:      * @param aSelectedMemory A reference to a memory described in ExecuteL.
williamr@2:      * @param aTitle A title for memory selection dialog.
williamr@2:      * @param aRootPath A pointer to a descriptor where the root path
williamr@2:      *        of the selected memory is stored.
williamr@2:      * @param aDefaultFolder A pointer to a descriptor where the default folder
williamr@2:      *        of the selected memory is stored.
williamr@2:      * @param aObserver An observer which is asked if the selected item
williamr@2:      *        can be selected. Implemented in application.
williamr@2:      */
williamr@2:     static TBool RunL(
williamr@2:         TInt aResourceId,
williamr@2:         TMemory& aSelectedMemory,
williamr@2:         const TDesC& aTitle,
williamr@2:         TDes* aRootPath,
williamr@2:         TDes* aDefaultFolder,
williamr@2:         MAknMemorySelectionObserver* aObserver );
williamr@2: 
williamr@2:     };
williamr@2: 
williamr@2: #endif // C_AKNMEMORYSELECTIONSETTINGPAGE_H