filemanager/Engine/inc/Cfilemanagerfolderarray.h
branchRCL_3
changeset 38 491b3ed49290
parent 36 95243422089a
child 39 65326cf895ed
equal deleted inserted replaced
36:95243422089a 38:491b3ed49290
     1 /*
       
     2 * Copyright (c) 2002-2007 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:  Holds the array of CFileManagerFolderEntry
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CFILEMANAGERFOLDERARRAY_H
       
    21 #define CFILEMANAGERFOLDERARRAY_H
       
    22 
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 #ifndef RD_MULTIPLE_DRIVE
       
    30 class CFileManagerFolderEntry;
       
    31 #endif // RD_MULTIPLE_DRIVE
       
    32 class CFileManagerUtils;
       
    33 
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 
       
    38 /**
       
    39 *  Array of CFileManagerFolderEntry's
       
    40 *
       
    41 *  @lib FileManagerEngine.lib
       
    42 *  @since 2.0
       
    43 */
       
    44 NONSHARABLE_CLASS(CFileManagerFolderArray) : public CBase
       
    45     {
       
    46     public:
       
    47         /**
       
    48         * Two-phased constructors.
       
    49         */        
       
    50 #ifdef RD_MULTIPLE_DRIVE
       
    51         static CFileManagerFolderArray* NewL( CFileManagerUtils& aUtils );
       
    52 #else // RD_MULTIPLE_DRIVE
       
    53         static CFileManagerFolderArray* NewL(
       
    54             TInt aResId, CFileManagerUtils& aUtils );
       
    55 #endif // RD_MULTIPLE_DRIVE
       
    56 
       
    57         /**
       
    58         * Is the given folder in the default folder list
       
    59         * @since 2.0
       
    60         * @param aFolderName folder which is compared to default folder list
       
    61         * @return ETrue if the given folder is in list, EFalse if not
       
    62         */
       
    63         TBool Contains( const TDesC& aFolderName );
       
    64 
       
    65         /**
       
    66         * Create folders from array
       
    67         * @since 3.2
       
    68         * @param aDrive Drive which default folders are created
       
    69         * @param aForced Selects forced or normal creation
       
    70         */
       
    71         void CreateFolders(
       
    72             const TInt aDrive = KErrNotFound,
       
    73             const TBool aForced = ETrue );
       
    74 
       
    75         /**
       
    76         * Destructor.
       
    77         */
       
    78         ~CFileManagerFolderArray();
       
    79     private:
       
    80         /**
       
    81         * C++ default constructor.
       
    82         */
       
    83         CFileManagerFolderArray( CFileManagerUtils& aUtils );
       
    84 
       
    85         /**
       
    86         * By default Symbian 2nd phase constructor is private.
       
    87         */
       
    88         void ConstructL( TInt aResId );
       
    89 
       
    90 #ifndef RD_MULTIPLE_DRIVE
       
    91         /**
       
    92         * Goes through the array of CFileManagerEntry's and tries to 
       
    93         * lookup if the given folder is in the array.
       
    94         * @since 2.0
       
    95         * @return CFileManagerFolderEntry if found, otherwise NULL.
       
    96         */
       
    97         CFileManagerFolderEntry* FindFolder( const TDesC& aFolderName );
       
    98 #endif // RD_MULTIPLE_DRIVE
       
    99 
       
   100         void DoCreateFoldersL( const TInt aDrive );
       
   101 
       
   102     private: // Data
       
   103         // Ref: Reference to utils
       
   104         CFileManagerUtils& iUtils;
       
   105 
       
   106         // Own: For checking if folder creation has been done or not
       
   107         TUint iCreateCheckMask;
       
   108 
       
   109 #ifndef RD_MULTIPLE_DRIVE
       
   110         // Own: Array of CFileManagerFolderEntry's
       
   111         RPointerArray< CFileManagerFolderEntry > iFolderArray;
       
   112 
       
   113         // Own: Indicates if folder array has been sorted
       
   114         TBool iSorted;
       
   115 #endif // RD_MULTIPLE_DRIVE
       
   116 
       
   117     };
       
   118 
       
   119 #endif      // CFILEMANAGERFOLDERARRAY_H
       
   120             
       
   121 // End of File