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 |
|
20 #ifndef CFILEMANAGERACTIVESIZE_H |
|
21 #define CFILEMANAGERACTIVESIZE_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <AknWaitNoteWrapper.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(CFileManagerActiveSize) : public CBase, |
|
39 public MAknBackgroundProcess |
|
40 { |
|
41 public: |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 */ |
|
45 static CFileManagerActiveSize* NewL( |
|
46 RFs& aFs, const TDesC& aRootFolder ); |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 ~CFileManagerActiveSize(); |
|
51 |
|
52 public: // From MAknBackgroundProcess |
|
53 /** |
|
54 * Completes one cycle of the process. |
|
55 */ |
|
56 void StepL(); |
|
57 |
|
58 /** |
|
59 * Return true when the process is done. |
|
60 */ |
|
61 TBool IsProcessDone() const; |
|
62 |
|
63 public: |
|
64 |
|
65 /** |
|
66 * Get the result, size of the folder |
|
67 * @since 2.0 |
|
68 * @return Size of the folder in bytes |
|
69 */ |
|
70 TInt64 GetFolderSize() const; |
|
71 |
|
72 private: |
|
73 /** |
|
74 * C++ default constructor. |
|
75 */ |
|
76 CFileManagerActiveSize( RFs& aFs ); |
|
77 |
|
78 /** |
|
79 * By default Symbian 2nd phase constructor is private. |
|
80 */ |
|
81 void ConstructL( const TDesC& aRootFolder ); |
|
82 |
|
83 private: // Data |
|
84 |
|
85 /// Own: Used to go through all the folders in given directory |
|
86 CDirScan* iDirScan; |
|
87 |
|
88 /// Own: CDirScan returns this |
|
89 CDir* iDir; |
|
90 |
|
91 /// File Server session |
|
92 RFs& iFs; |
|
93 |
|
94 /// When all folders are through, this is set |
|
95 TBool iProcessDone; |
|
96 |
|
97 /// Index to currently checked CDir item |
|
98 TInt iFileCounter; |
|
99 |
|
100 // Folder Size |
|
101 TInt64 iSize; |
|
102 }; |
|
103 |
|
104 #endif // CFILEMANAGERACTIVESIZE_H |
|
105 |
|
106 // End of File |
|
107 |
|