mpxmusicplayer/commonui/inc/mpxfilenamequerydlg.h
changeset 0 ff3acec5bc43
child 21 a1247965635c
equal deleted inserted replaced
-1:000000000000 0:ff3acec5bc43
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Definition of file rename dialog for Common UI
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CMPXFILENAMEQUERYDLG_H
       
    20 #define C_CMPXFILENAMEQUERYDLG_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <AknQueryDialog.h>     // CAknTextQueryDialog
       
    24 #include <mpxmediageneraldefs.h>
       
    25 
       
    26 // CLASS DECLARATION
       
    27 class CMPXCommonUiHelper;
       
    28 
       
    29 /**
       
    30  *  @lib mpxcommonui.lib
       
    31  *  @since S60 v3.0
       
    32  *  Dialog for querying file names in File Manager
       
    33  */
       
    34 NONSHARABLE_CLASS( CMPXFileNameQueryDlg ): public CAknTextQueryDialog
       
    35     {
       
    36     public:  // Constructors and destructor
       
    37 
       
    38         /**
       
    39          * Two-phased constructor.
       
    40          * @param aOldName Old name of the file, this will be the default name
       
    41          * @param aNewName User entered new name of the file.
       
    42          * @param aPath original path for the file, needed to check if the file
       
    43          *              already exist
       
    44          * @param aCategory specifies the category for the title
       
    45          * @return Newly created query dialog.
       
    46          */
       
    47         static CMPXFileNameQueryDlg* NewL( const TDesC& aOldName, 
       
    48                                            TDes& aNewName,
       
    49                                            const TDesC& aPath, 
       
    50                                            TMPXGeneralCategory aCategory,
       
    51                                            CMPXCommonUiHelper* aParent );
       
    52 
       
    53 		/**
       
    54         * Destructor.
       
    55         */
       
    56         ~CMPXFileNameQueryDlg();
       
    57 
       
    58     public: // from CAknTextQueryDialog
       
    59         /**
       
    60          * @see CAknTextQueryDialog
       
    61          */
       
    62     	TBool OkToExitL( TInt aButtonId );
       
    63 
       
    64 	private:
       
    65         /**
       
    66         * C++ default constructor.
       
    67         */
       
    68         CMPXFileNameQueryDlg( 
       
    69             TDes& aNewName, 
       
    70             TMPXGeneralCategory aCategory,
       
    71             CMPXCommonUiHelper* aParent );
       
    72 
       
    73         /**
       
    74          * Symbian OS 2nd phase constructor.
       
    75          * @param aOldName Old name of the file, this will be the default name
       
    76          * @param aPath original path for the file
       
    77          */
       
    78 		void ConstructL( const TDesC& aOldName, const TDesC& aPath );
       
    79 		
       
    80 		/**
       
    81         * Is given file name valid
       
    82         * @since 3.0
       
    83         * @param aDriveAndPath root path
       
    84         * @param aName name of the file
       
    85         * @param aIsFolder ETrue folder and EFalse file name
       
    86         * @return ETrue if file name is valid
       
    87         */
       
    88         TBool IsValidName(
       
    89             const TDesC& aDriveAndPath, const TDesC& aName, TBool aIsFolder ) const;
       
    90 
       
    91         /**
       
    92         * Check that if given file name contains illegal characters
       
    93         * @since 3.0
       
    94         * @param aName name of the file
       
    95         * @return ETrue if file name is valid
       
    96         */
       
    97 		TBool IllegalChars( const TDesC& aName ) const;
       
    98 
       
    99     private:    // Data        
       
   100         HBufC*                      iOldName;  // own
       
   101         HBufC*                      iPath;     // own
       
   102         CMPXCommonUiHelper*         iParent; // not own
       
   103         MMPXCollectionUiHelper*     iCollectionUiHelper; //own
       
   104         TMPXGeneralCategory         iCategory;
       
   105     };
       
   106 
       
   107 #endif      // C_CMPXFILENAMEQUERYDLG_H
       
   108             
       
   109 // End of File