|
1 /* |
|
2 * Copyright (c) 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: |
|
15 * CMsengScanner is the class that mostly controls the operation |
|
16 * of Memory Scan Engine. It CMsengScannerBase-derived active objects |
|
17 * to perform scanning operations. |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 #ifndef CMSENGSCANNER_H |
|
23 #define CMSENGSCANNER_H |
|
24 |
|
25 // SYSTEM INCLUDES |
|
26 #include <barsc2.h> // CResourceFile |
|
27 #include <barsread2.h> // RResourceReader |
|
28 |
|
29 // USER INCLUDES |
|
30 #include "msengscanobserver.h" |
|
31 #include "msenginfoarray.h" |
|
32 |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class MMsengUIHandler; |
|
36 class CMsengFileExtScanner; |
|
37 class CMsengFindAllScanner; |
|
38 class CMsengRegistryScanner; |
|
39 |
|
40 |
|
41 // CLASS DECLARATION |
|
42 |
|
43 /** |
|
44 * CMsengScanner controls the scanning operation. |
|
45 */ |
|
46 class CMsengScanner : public CBase, public MMsengScannerObserver |
|
47 { |
|
48 public: // Constructors and destructor |
|
49 |
|
50 /** |
|
51 * C++ default constructor. |
|
52 */ |
|
53 CMsengScanner(MMsengUIHandler& aUIHandler, CResourceFile& aResFile); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 virtual ~CMsengScanner(); |
|
59 |
|
60 public: // New functions |
|
61 |
|
62 /** |
|
63 * |
|
64 */ |
|
65 void Cancel(); |
|
66 |
|
67 /** |
|
68 * |
|
69 */ |
|
70 TBool HaveActiveScanners() const; |
|
71 |
|
72 /** |
|
73 * Start scanning (creates a new thread). |
|
74 * @param aDrive the drive which is scanned |
|
75 * @paran aNumberOfDataGroups |
|
76 * @return KErrInUse if the scanning is already going on; |
|
77 * KErrNone otherwise |
|
78 */ |
|
79 TInt ScanL(TDriveNumber aDrive, TInt aNumberOfDataGroups, RFs& FsSession); |
|
80 |
|
81 /** |
|
82 * Get scan results per UID. |
|
83 * @return Pointer to an array containing results per UID. |
|
84 */ |
|
85 inline const CArrayFix<TInt64>* UidResults() const; |
|
86 |
|
87 /** |
|
88 * Get scan results per filename extension. |
|
89 * @return Pointer to an array containing results per ext. |
|
90 */ |
|
91 inline const CArrayFix<TInt64>* ExtResults() const; |
|
92 |
|
93 /** |
|
94 * Get scan results per data group. |
|
95 * @return Pointer to an array containing results per group. |
|
96 */ |
|
97 inline const CArrayFix<TInt64>* GroupResults() const; |
|
98 |
|
99 /** |
|
100 * |
|
101 */ |
|
102 inline const TDriveNumber CurrentDrive() const; |
|
103 |
|
104 public: // From MMsengScannerObserver |
|
105 |
|
106 /** |
|
107 * |
|
108 * @param aEvent event that is handled |
|
109 */ |
|
110 void HandleScannerEventL(TScannerEvent aEvent, |
|
111 const CMsengScannerBase& aScanner, TInt aError=KErrNone); |
|
112 |
|
113 private: |
|
114 |
|
115 /** |
|
116 * Do some simple scanning before actual work. |
|
117 * @param aDrive the drive to be scanned |
|
118 * @param aFsSession reference to file server session |
|
119 */ |
|
120 void PreScanL(TDriveNumber aDrive, RFs& aFsSession); |
|
121 |
|
122 // Prohibit copy constructor if not deriving from CBase. |
|
123 CMsengScanner( const CMsengScanner& ); |
|
124 // Prohibit assigment operator if not deriving from CBase. |
|
125 CMsengScanner& operator= ( const CMsengScanner& ); |
|
126 |
|
127 private: // Data |
|
128 |
|
129 // External objects |
|
130 MMsengUIHandler& iUIHandler; |
|
131 CMsengInfoArray* iScanArray; |
|
132 CResourceFile& iResFile; |
|
133 |
|
134 // Owned objects |
|
135 CMsengFileExtScanner* iFileExtScanner; |
|
136 CMsengFindAllScanner* iFindAllScanner; |
|
137 CMsengRegistryScanner* iRegistryScanner; |
|
138 }; |
|
139 |
|
140 #include "msengscanner.inl" |
|
141 |
|
142 #endif // CMSENGSCANNER_H |
|
143 |
|
144 // End of File |