|
1 /* |
|
2 * Copyright (c) 2005-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: Phonebook 2 compress policy disk space utility. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2COMPRESSPOLICYDISKSPACE_H |
|
20 #define CPBK2COMPRESSPOLICYDISKSPACE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <f32file.h> |
|
24 #include "MPbk2CompressPolicy.h" |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class MPbk2CompressPolicyManager; |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * Phonebook 2 compress policy disk space utility. |
|
33 * Responsible for quering FileServer for notification when |
|
34 * free disk space drops below given threshold. |
|
35 */ |
|
36 NONSHARABLE_CLASS(CPbk2CompressPolicyDiskSpace) : public CActive, |
|
37 public MPbk2CompressPolicy |
|
38 { |
|
39 public: // Construction and destruction |
|
40 |
|
41 /** |
|
42 * Creates a new instance of this class. |
|
43 * |
|
44 * @param aObserver Observer. |
|
45 * @param aFs File server session. |
|
46 * @param aThreshold Threshold. |
|
47 * @param aDrive Drive. |
|
48 * @return A new instance of this class. |
|
49 */ |
|
50 static CPbk2CompressPolicyDiskSpace* NewL( |
|
51 MPbk2CompressPolicyManager& aObserver, |
|
52 RFs& aFs, |
|
53 TInt64 aThreshold, |
|
54 TInt aDrive = KDefaultDrive ); |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 ~CPbk2CompressPolicyDiskSpace(); |
|
60 |
|
61 public: // From MPbk2CompressPolicy |
|
62 void Start(); |
|
63 void Stop(); |
|
64 |
|
65 private: // From CActive |
|
66 void DoCancel(); |
|
67 void RunL(); |
|
68 TInt RunError( |
|
69 TInt aError ); |
|
70 |
|
71 private: // Implementation |
|
72 CPbk2CompressPolicyDiskSpace( |
|
73 MPbk2CompressPolicyManager& aObserver, |
|
74 RFs& aFs, |
|
75 TInt64 aThreshold, |
|
76 TInt aDrive ); |
|
77 void RequestNotification(); |
|
78 |
|
79 private: // Data |
|
80 /// Ref: Compression policy manager |
|
81 MPbk2CompressPolicyManager& iManager; |
|
82 /// Ref: File server session |
|
83 RFs iFs; |
|
84 /// Own: Threshold |
|
85 TInt64 iThreshold; |
|
86 /// Own: Disk drive |
|
87 TInt iDrive; |
|
88 }; |
|
89 |
|
90 #endif // CPBK2COMPRESSPOLICYDISKSPACE_H |
|
91 |
|
92 // End of File |