22
|
1 |
/*
|
|
2 |
* Copyright (c) 2002 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 |
* CAlwaysOnlineDiskSpaceObserver declaration file
|
|
16 |
*
|
|
17 |
*
|
|
18 |
*/
|
|
19 |
|
|
20 |
|
|
21 |
#ifndef ALWAYSONLINEDISKSPACEOBSERVER_H
|
|
22 |
#define ALWAYSONLINEDISKSPACEOBSERVER_H
|
|
23 |
|
|
24 |
// INCLUDES
|
|
25 |
#include <e32base.h>
|
|
26 |
#include <f32file.h>
|
|
27 |
|
|
28 |
// FORWARD DECLARATIONS
|
|
29 |
class CAlwaysOnlineManager;
|
|
30 |
class CMsvSession;
|
|
31 |
// CLASS DECLARATION
|
|
32 |
|
|
33 |
/**
|
|
34 |
* CAlwaysOnlineDiskSpaceObserver
|
|
35 |
*/
|
|
36 |
class CAlwaysOnlineDiskSpaceObserver : public CActive
|
|
37 |
{
|
|
38 |
public: // Constructors and destructor
|
|
39 |
|
|
40 |
/**
|
|
41 |
* Two-phased constructor.
|
|
42 |
*
|
|
43 |
* @param aManager A pointer to CAlwaysOnlineManager
|
|
44 |
* @param aFs A reference to file session
|
|
45 |
*/
|
|
46 |
static CAlwaysOnlineDiskSpaceObserver* NewL( CAlwaysOnlineManager* aManager,
|
|
47 |
CMsvSession& aSession );
|
|
48 |
|
|
49 |
/**
|
|
50 |
* Destructor.
|
|
51 |
*/
|
|
52 |
virtual ~CAlwaysOnlineDiskSpaceObserver();
|
|
53 |
|
|
54 |
public: // New functions
|
|
55 |
|
|
56 |
/**
|
|
57 |
*
|
|
58 |
* @param aLimit The trigger limit in bytes
|
|
59 |
*/
|
|
60 |
void SetLimitAndActivateL();
|
|
61 |
|
|
62 |
private:
|
|
63 |
|
|
64 |
/**
|
|
65 |
* Private C++ constructor.
|
|
66 |
*
|
|
67 |
* @param aManager A pointer to CAlwaysOnlineManager
|
|
68 |
* @param aFs A reference to file session
|
|
69 |
*/
|
|
70 |
CAlwaysOnlineDiskSpaceObserver( CAlwaysOnlineManager* aManager, CMsvSession& aSession );
|
|
71 |
|
|
72 |
private:
|
|
73 |
|
|
74 |
/**
|
|
75 |
* From CActive
|
|
76 |
*/
|
|
77 |
void RunL();
|
|
78 |
|
|
79 |
/**
|
|
80 |
* From CActive
|
|
81 |
*/
|
|
82 |
void DoCancel();
|
|
83 |
|
|
84 |
/**
|
|
85 |
* Function to handle error during running the operation
|
|
86 |
* @since Series60 2.6
|
|
87 |
* @return KErrNone, when error has been handled
|
|
88 |
*/
|
|
89 |
virtual TInt RunError( TInt aError );
|
|
90 |
|
|
91 |
private: // New Functions
|
|
92 |
|
|
93 |
/**
|
|
94 |
* Updates current disk limit
|
|
95 |
* @since Series60 3.0
|
|
96 |
*/
|
|
97 |
void HandleLimitChange();
|
|
98 |
|
|
99 |
private: // Data
|
|
100 |
|
|
101 |
CAlwaysOnlineManager* iWatcher;
|
|
102 |
CAlwaysOnlineManager& iManager;
|
|
103 |
CMsvSession& iSession;
|
|
104 |
TUint iNewLimit;
|
|
105 |
TUint iCurrentLimit;
|
|
106 |
|
|
107 |
};
|
|
108 |
|
|
109 |
#endif //
|
|
110 |
|
|
111 |
// End of File
|