|
1 /* |
|
2 * Copyright (c) 2008 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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CASRV_H |
|
19 #define CASRV_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 |
|
24 // FORWARD DECLARATION |
|
25 class CTimeout; |
|
26 class CCaSrvEngUtils; |
|
27 class CCaSrvManager; |
|
28 class CCaStorageProxy; |
|
29 |
|
30 // GLOBAL FUNCTIONS |
|
31 /** |
|
32 * Run the Menu Server (entry function). |
|
33 * @return Error code. |
|
34 */ |
|
35 IMPORT_C TInt RunCaServer(); |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * Menu Server. |
|
41 */ |
|
42 NONSHARABLE_CLASS( CCaSrv ): public CServer2 |
|
43 { |
|
44 public: |
|
45 |
|
46 /** |
|
47 * Destructor. |
|
48 */ |
|
49 virtual ~CCaSrv(); |
|
50 |
|
51 /** |
|
52 * Two-phased constructor. Leaves on failure. |
|
53 * @return The constructed server. |
|
54 */ |
|
55 static CCaSrv* NewL(); |
|
56 |
|
57 public: |
|
58 |
|
59 /** |
|
60 * Storage proxy getter. |
|
61 * @return storage proxy. |
|
62 */ |
|
63 CCaStorageProxy* GetStorageProxy(); |
|
64 |
|
65 /* |
|
66 * Increases session count. |
|
67 */ |
|
68 void IncreaseSessionCount(); |
|
69 |
|
70 /* |
|
71 * Decreases session count. If session count reaches 0 server is stoped. |
|
72 */ |
|
73 void DecreaseSessionCount(); |
|
74 |
|
75 private: |
|
76 // Constructors and destructor |
|
77 |
|
78 /** |
|
79 * Constructor. |
|
80 */ |
|
81 CCaSrv(); |
|
82 |
|
83 /** |
|
84 * Second-phase constructor. |
|
85 */ |
|
86 void ConstructL(); |
|
87 |
|
88 private: |
|
89 // From CServer2 |
|
90 |
|
91 /** |
|
92 * Create new session. |
|
93 * @param aVersion Version. |
|
94 * @param aMessage Message (unused). |
|
95 * @return New session. |
|
96 */ |
|
97 CSession2* NewSessionL( const TVersion& aVersion, |
|
98 const RMessage2& aMessage ) const; |
|
99 |
|
100 private: |
|
101 // Data |
|
102 |
|
103 /** |
|
104 * Exit timer. Own. |
|
105 */ |
|
106 CTimeout* iExitTimer; |
|
107 |
|
108 /** |
|
109 * Data storage proxy. Own. |
|
110 */ |
|
111 CCaStorageProxy* iStorageProxy; |
|
112 |
|
113 /* |
|
114 * Session count. Own. |
|
115 */ |
|
116 TInt iSessionCount; |
|
117 |
|
118 /* |
|
119 * Utils. Own. |
|
120 */ |
|
121 CCaSrvEngUtils* iSrvEngUtils; |
|
122 |
|
123 /* |
|
124 * Srv plugin manager. Own. |
|
125 */ |
|
126 CCaSrvManager* iSrvManager; |
|
127 |
|
128 }; |
|
129 |
|
130 #endif // CASRV_H |
|
131 // End of File |