|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __CCNTLOWDISKMANAGER_H__ |
|
17 #define __CCNTLOWDISKMANAGER_H__ |
|
18 |
|
19 |
|
20 #include <e32base.h> // For CActive. |
|
21 |
|
22 |
|
23 // Forward class references. |
|
24 class RFs; |
|
25 |
|
26 |
|
27 /** |
|
28 This interace is implemented by the disk space event observer. |
|
29 |
|
30 @internalComponent |
|
31 @released |
|
32 */ |
|
33 class MContactLowDiskObserver |
|
34 { |
|
35 public: |
|
36 virtual void HandleLowDiskL(TBool aLowDisk) = 0; |
|
37 }; |
|
38 |
|
39 |
|
40 /** |
|
41 This class watches for disk space events from the File Server and then |
|
42 notifies the registered observer. |
|
43 |
|
44 @internalComponent |
|
45 @released |
|
46 */ |
|
47 class CCntLowDiskManager : public CActive |
|
48 { |
|
49 public: |
|
50 static CCntLowDiskManager* NewL(MContactLowDiskObserver& aObserver, |
|
51 TInt64 aThreshold, TInt aDrive, RFs& aFs); |
|
52 ~CCntLowDiskManager(); |
|
53 |
|
54 void Start(); |
|
55 |
|
56 TBool LowDiskL(); |
|
57 |
|
58 private: |
|
59 CCntLowDiskManager(MContactLowDiskObserver& aObserver, TInt64 aThreshold, |
|
60 TInt aDrive, RFs& aFs); |
|
61 |
|
62 // From CActive. |
|
63 void RunL(); |
|
64 TInt RunError(TInt aError); |
|
65 void DoCancel(); |
|
66 |
|
67 private: |
|
68 MContactLowDiskObserver& iObserver; |
|
69 TInt64 iThreshold; |
|
70 TInt iDrive; |
|
71 RFs& iFs; |
|
72 TBool iWasLowDisk; |
|
73 }; |
|
74 |
|
75 |
|
76 #endif //__CCCNTLOWDISKMANAGER_H__ |