|
1 /* |
|
2 * Copyright (c) 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: GBA Server definitions |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef GBASERVER_H |
|
20 #define GBASERVER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <f32file.h> |
|
24 #include "GbaServerPolicy.h" |
|
25 |
|
26 void PanicClient( const RMessage2& aMessage, TInt aPanic ); |
|
27 void PanicServer( TInt aPanic ); |
|
28 |
|
29 class CShutdown : public CTimer |
|
30 { |
|
31 enum { EGbaServerShutdownDelay = 0x200000 }; // approx 2s |
|
32 public: |
|
33 inline CShutdown(); |
|
34 inline void ConstructL(); |
|
35 inline void Start(); |
|
36 private: |
|
37 void RunL(); |
|
38 }; |
|
39 |
|
40 |
|
41 |
|
42 class CGbaServer : public CPolicyServer |
|
43 { |
|
44 public : |
|
45 static CGbaServer* NewL(); |
|
46 static CGbaServer* NewLC(); |
|
47 ~CGbaServer(); |
|
48 //Increment the count of the active sessions for this server |
|
49 void IncrementSessions(); |
|
50 |
|
51 //Decrement the count of the active sessions for this server. |
|
52 //If no more sessions are in use the server terminates. |
|
53 void DecrementSessions(); |
|
54 //Reads specified option from server. |
|
55 TBool ReadOptionL(const TUid& aOptionID, TDes8& aValue) const; |
|
56 //write specified option |
|
57 void WriteOptionL(const TUid& aOptionID, const TDesC8& aValue) const; |
|
58 |
|
59 private: |
|
60 CGbaServer() ; |
|
61 void ConstructL() ; |
|
62 CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const; |
|
63 void MakePrivateFilenameL(RFs& aFs, const TDesC& aLeafName, TDes& aNameOut) const; |
|
64 void EnsurePathL( RFs& aFs, const TDesC& aFile ) const; |
|
65 |
|
66 private: |
|
67 TInt iSessionCount; |
|
68 CShutdown iShutdown; |
|
69 }; |
|
70 |
|
71 |
|
72 #endif //GBASERVER_H |
|
73 |
|
74 //EOF |