|         |      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:  Calculates directory size | 
|         |     15 * | 
|         |     16 */ | 
|         |     17  | 
|         |     18  | 
|         |     19 #ifndef CFILEMANAGERACTIVECOUNT_H | 
|         |     20 #define CFILEMANAGERACTIVECOUNT_H | 
|         |     21  | 
|         |     22 // INCLUDES | 
|         |     23 #include <e32base.h> | 
|         |     24 #include <AknWaitNoteWrapper.h> | 
|         |     25 #include "CFileManagerItemProperties.h" | 
|         |     26  | 
|         |     27 // FORWARD DECLARATIONS | 
|         |     28 class CDirScan; | 
|         |     29  | 
|         |     30 // CLASS DECLARATION | 
|         |     31 /** | 
|         |     32 *   | 
|         |     33 *  Calculates folder size, one folder at time. | 
|         |     34 * | 
|         |     35 *  @lib FileManagerEngine.lib | 
|         |     36 *  @since 2.0 | 
|         |     37 */ | 
|         |     38 NONSHARABLE_CLASS(CFileManagerActiveCount) : public CBase, | 
|         |     39                                              public MAknBackgroundProcess | 
|         |     40     { | 
|         |     41     public: | 
|         |     42         /** | 
|         |     43         * Two-phased constructor. | 
|         |     44         */ | 
|         |     45         static CFileManagerActiveCount* NewL( | 
|         |     46             RFs& aFs, | 
|         |     47             const TDesC& aRootFolder, | 
|         |     48             const CFileManagerItemProperties::TFileManagerFileType aType ); | 
|         |     49         /** | 
|         |     50         * Destructor. | 
|         |     51         */ | 
|         |     52         ~CFileManagerActiveCount(); | 
|         |     53  | 
|         |     54     public: // From MAknBackgroundProcess | 
|         |     55         /** | 
|         |     56          * Completes one cycle of the process. | 
|         |     57          */ | 
|         |     58         void StepL(); | 
|         |     59  | 
|         |     60         /** | 
|         |     61          * Return true when the process is done. | 
|         |     62          */ | 
|         |     63         TBool IsProcessDone() const; | 
|         |     64  | 
|         |     65     public: | 
|         |     66  | 
|         |     67         /** | 
|         |     68         * Get the result, | 
|         |     69         * @since 2.0 | 
|         |     70         * @return count of | 
|         |     71         */ | 
|         |     72         TInt FolderCount() const; | 
|         |     73  | 
|         |     74         /** | 
|         |     75         * Get the result, | 
|         |     76         * @since 2.0 | 
|         |     77         * @return count of | 
|         |     78         */ | 
|         |     79         TInt FileCount() const; | 
|         |     80  | 
|         |     81         /** | 
|         |     82         * Get the result, | 
|         |     83         * @since 2.0 | 
|         |     84         * @return count of | 
|         |     85         */ | 
|         |     86         TInt OpenFiles() const; | 
|         |     87  | 
|         |     88     private: | 
|         |     89         /** | 
|         |     90         * C++ default constructor. | 
|         |     91         */ | 
|         |     92         CFileManagerActiveCount(  | 
|         |     93             RFs& aFs ); | 
|         |     94  | 
|         |     95         /** | 
|         |     96         * By default Symbian 2nd phase constructor is private. | 
|         |     97         */ | 
|         |     98         void ConstructL(  | 
|         |     99             const TDesC& aRootFolder,  | 
|         |    100             const CFileManagerItemProperties::TFileManagerFileType aType  ); | 
|         |    101  | 
|         |    102     private: // Data | 
|         |    103  | 
|         |    104         /// Own: Used to go through all the folders in given directory | 
|         |    105         CDirScan*   iDirScan; | 
|         |    106      | 
|         |    107         /// Own: CDirScan returns this | 
|         |    108         CDir*       iDir; | 
|         |    109  | 
|         |    110         /// File Server session | 
|         |    111         RFs&        iFs; | 
|         |    112      | 
|         |    113         /// When all folders are through, this is set | 
|         |    114         TBool       iProcessDone; | 
|         |    115  | 
|         |    116         /// Index to currently checked CDir item | 
|         |    117         TInt        iFileCounter; | 
|         |    118  | 
|         |    119         // Folder count | 
|         |    120         TInt        iFolders; | 
|         |    121  | 
|         |    122         // Folder count | 
|         |    123         TInt        iFiles; | 
|         |    124  | 
|         |    125         // Folder count | 
|         |    126         TInt        iOpenFiles; | 
|         |    127  | 
|         |    128         // Processed entry fullpath | 
|         |    129         TFileName   iFileName; | 
|         |    130  | 
|         |    131     }; | 
|         |    132  | 
|         |    133 #endif      // CFILEMANAGERACTIVECOUNT_H | 
|         |    134              | 
|         |    135 // End of File | 
|         |    136  |