1 /* |
|
2 * Copyright (c) 2007 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: Monitors for media removal events |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CVRMEDIAREMOVALMONITER_H |
|
20 #define CVRMEDIAREMOVALMONITER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include "MVRMediaRemovalObserver.h" |
|
24 |
|
25 /** |
|
26 * Class to monitors for File System dismount events |
|
27 * @lib Harvester |
|
28 * @since S60 3.0 |
|
29 */ |
|
30 NONSHARABLE_CLASS( CVRMediaRemovalMonitor ) : public CActive |
|
31 { |
|
32 |
|
33 public: |
|
34 |
|
35 /** |
|
36 * Two-phase constructor |
|
37 * @param aDrive drive to monitor |
|
38 * @param aFs file server session |
|
39 * @param aObserver observer to the event |
|
40 */ |
|
41 static CVRMediaRemovalMonitor* NewL( TInt aDrive, |
|
42 RFs& aFs, |
|
43 MVRMediaRemovalObserver* aObserver ); |
|
44 /** |
|
45 * Two-phase constructor |
|
46 * @param aDrive drive to monitor |
|
47 * @param aFs file server session |
|
48 * @param aObserver observer to the event |
|
49 */ |
|
50 static CVRMediaRemovalMonitor* NewLC( TInt aDrive, |
|
51 RFs& aFs, |
|
52 MVRMediaRemovalObserver* aObserver ); |
|
53 |
|
54 /** |
|
55 * Virtual destructor |
|
56 */ |
|
57 virtual ~CVRMediaRemovalMonitor(); |
|
58 |
|
59 protected: // From base class |
|
60 |
|
61 /* |
|
62 * From CActive |
|
63 */ |
|
64 void RunL(); |
|
65 |
|
66 /* |
|
67 * From CActive |
|
68 */ |
|
69 void DoCancel(); |
|
70 |
|
71 /** |
|
72 * From CActive |
|
73 */ |
|
74 TInt RunError(TInt aError); |
|
75 |
|
76 private: |
|
77 |
|
78 /** |
|
79 * C++ constructor |
|
80 * @param aDrive drive to monitor |
|
81 * @param aFs file server session |
|
82 * @param aObserver observer to the event |
|
83 */ |
|
84 CVRMediaRemovalMonitor( TInt aDrive, |
|
85 RFs& aFs, |
|
86 MVRMediaRemovalObserver* aObserver ); |
|
87 |
|
88 void ConstructL(); |
|
89 |
|
90 private: // data |
|
91 |
|
92 TInt iDrive; // Drive that is being monitored |
|
93 RFs& iFs; // File Session, not owned |
|
94 TBool iDiskRemoved; // Is the disk inserted |
|
95 |
|
96 /* |
|
97 * Observer interface to callback to an observer |
|
98 */ |
|
99 MVRMediaRemovalObserver* iObserver; |
|
100 }; |
|
101 |
|
102 #endif // CVRMEDIAREMOVALMONITER_H |
|