1 /* |
|
2 * Copyright (c) 2002 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: |
|
15 * Scan directories. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef MSENGDIRECTORYSCANNER_H |
|
21 #define MSENGDIRECTORYSCANNER_H |
|
22 |
|
23 // USER INCLUDES |
|
24 #include "msengscannerbase.h" |
|
25 |
|
26 |
|
27 // CLASS DECLARATION |
|
28 |
|
29 /** |
|
30 * This class identifies all subdirectories based upon a given root path |
|
31 */ |
|
32 class CMsengDirectoryScanner : public CMsengScannerBase |
|
33 { |
|
34 public: // Constructors and destructor |
|
35 |
|
36 /** |
|
37 * C++ default constructor. |
|
38 */ |
|
39 CMsengDirectoryScanner(MMsengScannerObserver& aObserver, |
|
40 CMsengInfoArray& aScanArray, RFs& aFsSession); |
|
41 |
|
42 /** |
|
43 * Destructor. |
|
44 */ |
|
45 ~CMsengDirectoryScanner(); |
|
46 |
|
47 /** |
|
48 * |
|
49 */ |
|
50 enum TScanDirectoryResult |
|
51 { |
|
52 EContinueToNextDirectory = 0, |
|
53 EContinueProcessingCurrentDirectory |
|
54 }; |
|
55 |
|
56 public: // New functions |
|
57 |
|
58 /** |
|
59 * Start the scan operation. |
|
60 */ |
|
61 void ScanL(const CDesCArray& aRootDirs); |
|
62 |
|
63 protected: // From CMsengScannerBase |
|
64 |
|
65 /** |
|
66 * Do one incremental scanning step |
|
67 */ |
|
68 virtual TStepResult PerformStepL(); |
|
69 |
|
70 protected: // New framework |
|
71 |
|
72 /** |
|
73 * This is called when one directory needs scanning |
|
74 */ |
|
75 virtual TScanDirectoryResult ScanDirectoryL(const TDesC& aDirectory, RFs& aFsSession) = 0; |
|
76 |
|
77 /** |
|
78 * Use this function to add a new directory to the list of |
|
79 * directories which require scanning |
|
80 */ |
|
81 void AppendDirectoryL(const TDesC& aDirectory); |
|
82 |
|
83 private: |
|
84 |
|
85 /** |
|
86 * |
|
87 */ |
|
88 enum TState |
|
89 { |
|
90 EExpandingRootDirs = 0, |
|
91 EParsingExpandedList, |
|
92 EScanningSubDirs |
|
93 }; |
|
94 |
|
95 private: |
|
96 |
|
97 /** |
|
98 * |
|
99 */ |
|
100 TState iState; |
|
101 |
|
102 /** |
|
103 * |
|
104 */ |
|
105 TInt iCurrentIndex; |
|
106 |
|
107 /** |
|
108 * |
|
109 */ |
|
110 CDirScan* iScanner; |
|
111 |
|
112 /** |
|
113 * |
|
114 */ |
|
115 TInt iNumberOfRootDirectories; |
|
116 |
|
117 /** |
|
118 * |
|
119 */ |
|
120 CDesCArray* iDirectoryList; |
|
121 }; |
|
122 |
|
123 #endif // MSENGDIRECTORYSCANNER_H |
|
124 |
|
125 // End of File |
|