|
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: |
|
15 * Class for observing free disk space and if disk space goes under critical |
|
16 * level this cancels itself. |
|
17 * |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 #ifndef __IMUMDISKSPACEOBSERVEROPERATION_H__ |
|
23 #define __IMUMDISKSPACEOBSERVEROPERATION_H__ |
|
24 |
|
25 // INCLUDES |
|
26 #include <e32base.h> // Basic Symbian Include |
|
27 #include <f32file.h> // RFs |
|
28 |
|
29 #include "ImumOnlineOperation.h" |
|
30 #include "ImumDiskSpaceObserver.h" // CImumDiskSpaceObserver |
|
31 |
|
32 // CONSTANTS |
|
33 // MACROS |
|
34 // DATA TYPES |
|
35 // FUNCTION PROTOTYPES |
|
36 // FORWARD DECLARATIONS |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * CImumDiskSpaceObserverOperation |
|
41 * Class for observing free disk space and if disk space goes under critical |
|
42 * level this cancels itself. |
|
43 * note: Derived class MUST call BaseConstructL in its ConstuctL |
|
44 */ |
|
45 class CImumDiskSpaceObserverOperation : |
|
46 public CImumOnlineOperation, |
|
47 public MImumDiskSpaceObserver |
|
48 { |
|
49 public: |
|
50 |
|
51 /** |
|
52 * Destructor |
|
53 */ |
|
54 virtual ~CImumDiskSpaceObserverOperation(); |
|
55 |
|
56 protected: // From base classes |
|
57 protected: // Constructors |
|
58 |
|
59 /** |
|
60 * C++ default constructor. |
|
61 * Parameters like in CImumOnlineOperation |
|
62 */ |
|
63 CImumDiskSpaceObserverOperation( |
|
64 CImumInternalApi& aMailboxApi, |
|
65 TInt aPriority, |
|
66 TRequestStatus& aObserverRequestStatus, |
|
67 MMsvProgressReporter& aReporter); |
|
68 |
|
69 /** |
|
70 * Opens connection to shared data and calls CImumOnlineOperation::BaseConstructL |
|
71 * note: Derived class MUST call BaseConstructL in its ConstuctL |
|
72 * @param aMtmType: mtm uid of the current operation |
|
73 */ |
|
74 void BaseConstructL( TUid aMtmType ); |
|
75 |
|
76 private: // From Baseclasses |
|
77 |
|
78 /** |
|
79 * Function to execute the disk space check from current drive |
|
80 * @since S60 3.0 |
|
81 * @KErrNone, when everything is ok |
|
82 * @KErrDiskFull, when no disk space for operation |
|
83 */ |
|
84 TInt DoDiskSpaceCheckL(); |
|
85 |
|
86 /** |
|
87 * |
|
88 * @since S60 3.0 |
|
89 */ |
|
90 void HandleDiskSpaceEvent(); |
|
91 |
|
92 /** |
|
93 * |
|
94 * @since S60 3.0 |
|
95 */ |
|
96 void DoCancel(); |
|
97 |
|
98 private: // New Functions |
|
99 private: // Data |
|
100 |
|
101 // Disk Space Oserver |
|
102 CImumDiskSpaceObserver* iDiskObserver; |
|
103 |
|
104 // Create own instance of API because ImumDiskSpaceObserver outlives |
|
105 // the owner of iMailboxApi reference in ImumOnlineOperation |
|
106 CImumInternalApi* iEmailApi; |
|
107 }; |
|
108 |
|
109 |
|
110 #endif // __IMUMDISKSPACEOBSERVEROPERATION_H__ |
|
111 |
|
112 // End of File |