|
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: MPX Low Disk Space Watcher class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CMPXDISKWATCHER_H |
|
20 #define CMPXDISKWATCHER_H |
|
21 |
|
22 #include <f32file.h> |
|
23 |
|
24 class MMPXDiskSpaceObserver; |
|
25 |
|
26 /** |
|
27 * Low disk space watcher for monitoring disk space |
|
28 * |
|
29 * @lib mpxfilehandler.lib |
|
30 * @since S60 3.0 |
|
31 */ |
|
32 NONSHARABLE_CLASS( CMPXDiskSpaceWatcher ) : public CActive |
|
33 { |
|
34 public: |
|
35 |
|
36 /** |
|
37 * Two-phase constructor |
|
38 * @param aFs File system session |
|
39 * @param aDrive aDrive to monitor |
|
40 * @param aObs Observer to the monitor class |
|
41 */ |
|
42 static CMPXDiskSpaceWatcher* NewL( RFs& aFs, TInt aDrive, |
|
43 MMPXDiskSpaceObserver& aObs ); |
|
44 |
|
45 /** |
|
46 * destructor |
|
47 */ |
|
48 virtual ~CMPXDiskSpaceWatcher(); |
|
49 |
|
50 /** |
|
51 * Start monitoring for low disk events |
|
52 */ |
|
53 void StartL(); |
|
54 |
|
55 /** |
|
56 * Check if we are low on disk space |
|
57 * @return ETrue if low on disk |
|
58 */ |
|
59 TBool IsLowOnDisk(); |
|
60 |
|
61 /** |
|
62 * Gets the currently monitored drive number |
|
63 * |
|
64 * @return Currectly monitored drive number |
|
65 */ |
|
66 TInt CurrentDrive(); |
|
67 |
|
68 protected: |
|
69 |
|
70 /** |
|
71 * Handle cancelling of active object request |
|
72 */ |
|
73 void DoCancel(); |
|
74 |
|
75 /** |
|
76 * Handle a change in event |
|
77 */ |
|
78 void RunL(); |
|
79 |
|
80 private: |
|
81 |
|
82 /** |
|
83 * Default Constructor |
|
84 */ |
|
85 CMPXDiskSpaceWatcher( RFs& aFs, TInt aDrive, |
|
86 MMPXDiskSpaceObserver& aObs ); |
|
87 |
|
88 /** |
|
89 * Standard two-phase constructor |
|
90 */ |
|
91 void ConstructL(); |
|
92 |
|
93 private: // data |
|
94 RFs& iFs; // Not owned |
|
95 TInt iDriveToMonitor; // Drive to monitor |
|
96 MMPXDiskSpaceObserver& iObs; |
|
97 }; |
|
98 |
|
99 #endif //CMPXDISKWATCHER_H |