|
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 * This is the definition for CDosharedDataBase class. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __DOSSHAREDDATABASE_H__ |
|
22 #define __DOSSHAREDDATABASE_H__ |
|
23 |
|
24 // INCLUDES |
|
25 #include "dosservice.h" |
|
26 //#include <e32base.h> |
|
27 #include <s32file.h> |
|
28 |
|
29 |
|
30 // CONSTANTS |
|
31 //const TInt KSDReserveFileMaxSize = 64*1024; |
|
32 |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class CSharedDataFileSystemNotifier; |
|
36 |
|
37 /** |
|
38 * Server side object for RDosAudio class in the client side and the plug-in |
|
39 * side Audio service derives from this, |
|
40 */ |
|
41 class CDosSharedDataBase : public CDosService |
|
42 { |
|
43 public: |
|
44 |
|
45 IMPORT_C static CDosSharedDataBase* NewL(CSharedDataFileSystemNotifier* fileSystemNotifier); |
|
46 IMPORT_C static CDosSharedDataBase* NewLC(CSharedDataFileSystemNotifier* fileSystemNotifier); |
|
47 |
|
48 virtual ~CDosSharedDataBase(); |
|
49 |
|
50 private: |
|
51 /** |
|
52 * Processes the message sent by the client. |
|
53 * @param aMessage Client-server message. |
|
54 * @return Symbian error code. |
|
55 */ |
|
56 |
|
57 IMPORT_C TInt ExecuteMessageL(const RMessage2& aMessage); |
|
58 |
|
59 void ConstructL(CSharedDataFileSystemNotifier* fileSystemNotifier); |
|
60 |
|
61 protected: |
|
62 |
|
63 /** |
|
64 * Provide default implementation for plug-in methods incase plug-in |
|
65 * module doesn't provide the actual implementation. |
|
66 */ |
|
67 |
|
68 void RequestFreeDiskSpace( TInt* aRequest ); |
|
69 |
|
70 void RequestFreeDiskSpaceCancel( TInt* aRequest ); |
|
71 |
|
72 /** |
|
73 * Adjusts the size of the reserve file as close to the maximum size |
|
74 * as possible so that the current minimum free disk space |
|
75 * request is still fulfilled. |
|
76 * |
|
77 * @param aRequiredFreeDiskSpace current minimum requirement for the |
|
78 * amount of free disk space |
|
79 */ |
|
80 void SetReserveFileSize( const TInt aRequiredFreeDiskSpace ); |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 private: |
|
86 // free disk space notifier |
|
87 //CSharedDataFileSystemNotifier* iFileSystemNotifier; |
|
88 |
|
89 // highest outstanding free disk space request |
|
90 //TInt* iCurrentFreeDiskSpaceRequest; |
|
91 |
|
92 //TInt iFreeDiskSpaceRequest; |
|
93 const RMessage2* iMessage; // Kernel owns |
|
94 CSharedDataFileSystemNotifier* iFileSystemNotifier; |
|
95 RFs iFs; |
|
96 TInt iFreeDiskSpaceRequest; |
|
97 |
|
98 // inline CSharedDataServer* Server(); |
|
99 |
|
100 // friend classes |
|
101 friend class CSharedDataFileSystemNotifier; |
|
102 }; |
|
103 |
|
104 #endif //__DOSSHAREDDATABASE_H__ |