|
1 /* |
|
2 * Copyright (c) 2008 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: Directory scanner |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_APPMNGR2SCANNER_H |
|
20 #define C_APPMNGR2SCANNER_H |
|
21 |
|
22 #include <e32base.h> // CActive |
|
23 #include <f32file.h> // RFs |
|
24 #include "appmngr2scannerdirobserver.h" // MAppMngr2ScannerDirObserver |
|
25 |
|
26 class CAppMngr2ScannerDir; |
|
27 class MAppMngr2ScannerObserver; |
|
28 class CAppMngr2FileRecognizer; |
|
29 |
|
30 |
|
31 class CAppMngr2Scanner : public CActive, public MAppMngr2ScannerDirObserver |
|
32 { |
|
33 public: // constructor and destructor |
|
34 static CAppMngr2Scanner* NewL( MAppMngr2ScannerObserver& aObs ); |
|
35 ~CAppMngr2Scanner(); |
|
36 |
|
37 public: // from CActive |
|
38 void DoCancel(); |
|
39 void RunL(); |
|
40 TInt RunError( TInt aError ); |
|
41 |
|
42 public: // from MAppMngr2ScannerDirObserver |
|
43 void DirectoryChangedL( const TDesC& aDirName ); |
|
44 |
|
45 public: // new functions |
|
46 void AddDirectoryL( const TDesC& aPath ); |
|
47 void StartScanningL(); |
|
48 |
|
49 private: // new functions |
|
50 CAppMngr2Scanner( MAppMngr2ScannerObserver& aObs ); |
|
51 void ConstructL(); |
|
52 void NextValidScanningIndex(); |
|
53 void HandleScanningResultsL(); |
|
54 void StartMonitoringL(); |
|
55 void GetPresentDrivesL( TDriveList& aDriveList ); |
|
56 void HandleMonitoringEventL(); |
|
57 |
|
58 private: // data |
|
59 MAppMngr2ScannerObserver& iObserver; |
|
60 RPointerArray<CAppMngr2ScannerDir> iDirs; |
|
61 CAppMngr2FileRecognizer* iRecognizer; |
|
62 RFs iFs; |
|
63 TInt iScanningIndex; |
|
64 enum TScannerState |
|
65 { |
|
66 EIdle, |
|
67 EScanning, |
|
68 } iState; |
|
69 }; |
|
70 |
|
71 #endif // C_APPMNGR2SCANNER_H |
|
72 |