|
1 /* |
|
2 * Copyright (c) 2006-2009 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: Scans MMC after phone reboot for file changes* |
|
15 */ |
|
16 |
|
17 #ifndef CMMCSCANNERAO_H |
|
18 #define CMMCSCANNERAO_H |
|
19 |
|
20 #include <e32base.h> // For CActive, link against: euser.lib |
|
21 |
|
22 #include <e32std.h> // For RTimer, link against: euser.lib |
|
23 #include "mdeharvestersession.h" |
|
24 #include "mmcfilelist.h" |
|
25 |
|
26 // FORWARD DECLARATION |
|
27 class MMonitorPluginObserver; |
|
28 |
|
29 class CMmcScannerAO : public CTimer |
|
30 { |
|
31 public: |
|
32 // Cancel and destroy |
|
33 ~CMmcScannerAO(); |
|
34 |
|
35 // Two-phased constructor. |
|
36 static CMmcScannerAO* NewL( TUint32 aMediaId, CMdEHarvesterSession* aMdEClient, |
|
37 MMonitorPluginObserver* aObserver, CHarvesterPluginFactory* aHarvesterPluginFactory, |
|
38 CActive::TPriority aPriority, TBool aAlreadyWaited ); |
|
39 |
|
40 public: |
|
41 |
|
42 private: |
|
43 // C++ constructor |
|
44 CMmcScannerAO( TUint32 aMediaId, CMdEHarvesterSession* aMdEClient, |
|
45 MMonitorPluginObserver* aObserver, CHarvesterPluginFactory* aHarvesterPluginFactory, |
|
46 CActive::TPriority aPriority ); |
|
47 |
|
48 // Second-phase constructor |
|
49 void ConstructL( TBool aAlreadyWaited ); |
|
50 |
|
51 private: |
|
52 enum TCMmcScannerAOState |
|
53 { |
|
54 EUninitialized, // Uninitialized |
|
55 EReadFiles, |
|
56 EProcessFiles, |
|
57 EHarvestFiles, |
|
58 ERemoveNPFiles, |
|
59 EDone, |
|
60 EError // Error condition |
|
61 }; |
|
62 |
|
63 private: |
|
64 // From CActive |
|
65 // Handle completion |
|
66 void RunL(); |
|
67 |
|
68 // Override to handle leaves from RunL(). Default implementation causes |
|
69 // the active scheduler to panic. |
|
70 TInt RunError( TInt aError ); |
|
71 |
|
72 void HandleReharvestL(); |
|
73 |
|
74 void SetState( TCMmcScannerAOState aState ); |
|
75 |
|
76 private: |
|
77 TInt iState; // State of the active object |
|
78 |
|
79 TUint32 iMediaId; |
|
80 |
|
81 // Not owned |
|
82 CMdEHarvesterSession* iMdEClient; |
|
83 |
|
84 RFs iFs; |
|
85 |
|
86 TBuf<2> iDrive; |
|
87 |
|
88 CMmcFileList* iMmcFileList; |
|
89 |
|
90 // Not owned |
|
91 CHarvesterPluginFactory* iHarvesterPluginFactory; |
|
92 |
|
93 RPointerArray<CPlaceholderData> iEntryArray; |
|
94 RPointerArray<CPlaceholderData> iHarvestEntryArray; |
|
95 |
|
96 // Not owned |
|
97 MMonitorPluginObserver* iObserver; |
|
98 }; |
|
99 |
|
100 #endif // CMMCSCANNERAO_H |
|
101 |