filemanager/Engine/inc/CFileManagerFileSystemIterator.h
branchRCL_3
changeset 20 491b3ed49290
parent 19 95243422089a
child 21 65326cf895ed
equal deleted inserted replaced
19:95243422089a 20:491b3ed49290
     1 /*
       
     2 * Copyright (c) 2002-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:  Goes through folder tree one item at time
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CFILEMANAGERFILESYSTEMITERATOR_H
       
    20 #define CFILEMANAGERFILESYSTEMITERATOR_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <f32file.h>
       
    25 #include "Mfilemanageritemiterator.h"
       
    26 
       
    27 
       
    28 class CFileManagerEngine;
       
    29 
       
    30 /**
       
    31 *  Goes through all the folder items of given folder. Implements the
       
    32 *  MFileManagerItemIterator.
       
    33 *
       
    34 *  @lib FileManagerEngine.lib
       
    35 *  @since 2.0
       
    36 */
       
    37 NONSHARABLE_CLASS(CFileManagerFileSystemIterator) :
       
    38         public CBase,
       
    39         public MFileManagerItemIterator
       
    40     {
       
    41     public:
       
    42 
       
    43         /**
       
    44         * Two-phased constructor.
       
    45         */
       
    46         static CFileManagerFileSystemIterator* NewL( 
       
    47             RFs& aFs, 
       
    48             const TDesC& aSrcDir, 
       
    49             const TDesC& aDstDir,
       
    50             CFileManagerEngine& aEngine );
       
    51 
       
    52         /**
       
    53         * Destructor.
       
    54         */
       
    55         ~CFileManagerFileSystemIterator();
       
    56 
       
    57     public: // From MFileManagerItemIterator        
       
    58         void CurrentL(
       
    59             HBufC** aSrc, HBufC** aDst, TFileManagerTypeOfItem& aItemType );
       
    60 
       
    61         TBool NextL();
       
    62 
       
    63     public:
       
    64 
       
    65         /**
       
    66         * returns localized path 
       
    67         * @since 2.0
       
    68         * @return reference to localized path string
       
    69         */
       
    70         TPtrC   LocalizedAbbreviatedPath();
       
    71 
       
    72     private:
       
    73         /**
       
    74         * C++ default constructor.
       
    75         */
       
    76         CFileManagerFileSystemIterator(
       
    77             const TDesC& aDstDir, CFileManagerEngine& aEngine );
       
    78 
       
    79         /**
       
    80         * By default Symbian 2nd phase constructor is private.
       
    81         */
       
    82         void ConstructL(  RFs& aFs, const TDesC& aSrcDir );
       
    83 
       
    84     private:
       
    85         // Own: With this folders are scan through
       
    86         CDirScan* iDirScan;
       
    87 
       
    88         // Own: CDirScan returns this, contains one folder content at time
       
    89         CDir*     iDir;
       
    90 
       
    91         // Index to current CDir array item which is processed
       
    92         TInt      iCount;
       
    93 
       
    94         // Own: Current item source fullpath
       
    95         // reserved here so that caller can then use this via reference
       
    96         HBufC*    iSrc;
       
    97 
       
    98         // Own: Current item destination fullpath
       
    99         // reserved here so that caller can then use this via reference
       
   100         HBufC*    iDst;
       
   101 
       
   102         // Ref: Destination directory
       
   103         const TDesC& iDstDir;
       
   104 
       
   105         // Set when all folders are gone through
       
   106         TBool     iFolderScanDone;
       
   107 
       
   108         // Own: Source directory 
       
   109         HBufC*    iSrcDir;
       
   110 
       
   111         // Ref: File Manager engine
       
   112         CFileManagerEngine& iEngine;
       
   113 
       
   114         // Own: Localized Abbreviated Path
       
   115         TFileName iLocalizedAbbreviatedPath;
       
   116 
       
   117     };
       
   118 
       
   119 #endif // CFILEMANAGERFILESYSTEMITERATOR_H
       
   120