|
1 /* |
|
2 * Copyright (c) 2002-2005 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: Server. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPHSRVSERVER_H |
|
20 #define CPHSRVSERVER_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include "MPhSrvPhoneInterface.h" |
|
25 #include "PhCltClientServer.h" |
|
26 #include <RPhCltServer.h> |
|
27 #include <fbs.h> |
|
28 #include <f32file.h> |
|
29 |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CPhSrvSession; |
|
33 class CPhSrvUssdManager; |
|
34 class CPhSrvPhoneController; |
|
35 class CPhSrvResourceManager; |
|
36 class CPhSrvCallRequestManager; |
|
37 class CPhSrvEmergencyRequestManager; |
|
38 class CPhSrvEmergencyNumberManager; |
|
39 class MPhSrvNegotiatorCall; |
|
40 class MPhSrvEmergencyNumberManager; |
|
41 class MPhSrvComHandNegotiator; |
|
42 class CPhSrvComHandRequestManager; |
|
43 class CPhSrvMessengerRequestManager; |
|
44 class MPhSrvMessengerNegotiator; |
|
45 class MPhSrvEmergencyNegotiatorCall; |
|
46 |
|
47 |
|
48 // CLASS DECLARATION |
|
49 |
|
50 /** |
|
51 * It is the server class for Phone Server. |
|
52 * |
|
53 * @since 1.0 |
|
54 */ |
|
55 class CPhSrvServer : |
|
56 public CServer2 |
|
57 { |
|
58 public: // Constructors and destructor |
|
59 |
|
60 /** |
|
61 * Two-phased constructor. |
|
62 * Creates a new server and starts it. |
|
63 */ |
|
64 static CPhSrvServer* NewL(); |
|
65 |
|
66 /** |
|
67 * Destructor. |
|
68 */ |
|
69 ~CPhSrvServer(); |
|
70 |
|
71 |
|
72 public: // New functions |
|
73 |
|
74 /** |
|
75 * Connects to Font and bitmap server. |
|
76 * @return Symbian error code |
|
77 */ |
|
78 TInt ConnectFBS(); |
|
79 |
|
80 /** |
|
81 * Disconnects Font and bitmap server. |
|
82 * @param aForce do we force disconnect |
|
83 */ |
|
84 void DisconnectFBS( TBool aForce = EFalse ); |
|
85 |
|
86 /** |
|
87 * Creates all managers. |
|
88 * |
|
89 * @param aSession The session for subsessions. |
|
90 */ |
|
91 void CreateAllL( CPhSrvSession& aSession ); |
|
92 |
|
93 /** |
|
94 * Cancels create all. |
|
95 * |
|
96 * @param aSession The session for subsessions. |
|
97 */ |
|
98 void CancelCreateAll( CPhSrvSession& aSession ); |
|
99 |
|
100 /** |
|
101 * Creates a new object container. |
|
102 * |
|
103 * @return Returns the created instance. |
|
104 */ |
|
105 CObjectCon* NewContainerL() const; |
|
106 |
|
107 /** |
|
108 * Removes an object container. |
|
109 * |
|
110 * @param aCon object container |
|
111 */ |
|
112 void RemoveContainer( CObjectCon* aCon ); |
|
113 |
|
114 /** |
|
115 * Access to the call negotiator |
|
116 * |
|
117 * @return The call negotiator |
|
118 */ |
|
119 MPhSrvNegotiatorCall& CallNegotiatorL(); |
|
120 |
|
121 /** |
|
122 * Access to the call negotiator |
|
123 * NOTE: This is not safe call if IsCallNegotiator() return False |
|
124 * @return The call negotiator |
|
125 */ |
|
126 MPhSrvNegotiatorCall& CallNegotiator() const; |
|
127 |
|
128 /** |
|
129 * Access to the USSD manager |
|
130 * |
|
131 * @return The USSD manager |
|
132 */ |
|
133 CPhSrvUssdManager& UssdManagerL(); |
|
134 |
|
135 |
|
136 /** |
|
137 * Access to the call negotiator |
|
138 * |
|
139 * @return The call negotiator |
|
140 */ |
|
141 MPhSrvEmergencyNegotiatorCall& EmergencyCallNegotiatorL(); |
|
142 |
|
143 /** |
|
144 * Access to the call negotiator |
|
145 * NOTE: This is not safe call if IsEmergencyCallNegotiator() return |
|
146 * false. |
|
147 * @return The call negotiator |
|
148 */ |
|
149 MPhSrvEmergencyNegotiatorCall& EmergencyCallNegotiator() const; |
|
150 |
|
151 /** |
|
152 * Ask if there is a emergency call negotiator. |
|
153 * |
|
154 * @return ETrue if there is emergency call negotiator. |
|
155 */ |
|
156 TBool IsEmergencyCallNegotiator() const; |
|
157 |
|
158 /** |
|
159 * Access to the phone |
|
160 * |
|
161 * @return The phone interface |
|
162 */ |
|
163 MPhSrvPhoneInterface& PhoneInterfaceL(); |
|
164 |
|
165 /** |
|
166 * Access to the emergency number manager |
|
167 * |
|
168 * @return The emergency number manager |
|
169 */ |
|
170 MPhSrvEmergencyNumberManager& EmergencyNumberManagerL(); |
|
171 |
|
172 /** |
|
173 * Ask if there is a call negotiator. |
|
174 * |
|
175 * @return ETrue if there is call negotiator. |
|
176 */ |
|
177 TBool IsCallNegotiator() const; |
|
178 |
|
179 /** |
|
180 * Ask if there is a ussd manager |
|
181 * |
|
182 * @return ETrue if there is ussd manager. |
|
183 */ |
|
184 TBool IsUssdManager() const; |
|
185 |
|
186 /** |
|
187 * Access to the command handler negotiator. |
|
188 * @since 2.6 |
|
189 * |
|
190 * @return The command handler negotiator |
|
191 */ |
|
192 MPhSrvComHandNegotiator& ComHandNegotiatorL(); |
|
193 |
|
194 /** |
|
195 * Access to the command handler negotiator. |
|
196 * NOTE: This is not a safe call if |
|
197 * IsComHandNegotiator() return false. |
|
198 */ |
|
199 MPhSrvComHandNegotiator& ComHandNegotiator() const; |
|
200 |
|
201 /** |
|
202 * Ask if there is a command handler negotiator. |
|
203 * @since 2.6 |
|
204 * |
|
205 * @return ETrue if there is command handler negotiator. |
|
206 */ |
|
207 TBool IsComHandNegotiator() const; |
|
208 |
|
209 /** |
|
210 * Access to the messenger negotiator. |
|
211 * @since 2.6 |
|
212 * |
|
213 * @return The messenger negotiator |
|
214 */ |
|
215 MPhSrvMessengerNegotiator& MessengerNegotiatorL(); |
|
216 |
|
217 /** |
|
218 * Access to the messenger negotiator. |
|
219 * NOTE: This is not a safe call if IsMessengerNegotiator() |
|
220 * return false. |
|
221 * @since 5.0 |
|
222 * |
|
223 * @return The messenger negotiator |
|
224 */ |
|
225 MPhSrvMessengerNegotiator& MessengerNegotiator() const; |
|
226 |
|
227 /** |
|
228 * Ask if there is a messenger negotiator. |
|
229 * @since 2.6 |
|
230 * |
|
231 * @return ETrue if there is messenger negotiator. |
|
232 */ |
|
233 TBool IsMessengerNegotiator() const; |
|
234 |
|
235 |
|
236 public: // Functions from base classes |
|
237 |
|
238 /** |
|
239 * From CServer, create a new session. |
|
240 * |
|
241 * @param aVersion It is the version of the client api. |
|
242 * @param aMessage Connect message from Client. |
|
243 * @return Returns a new session. |
|
244 */ |
|
245 CSession2* NewSessionL( |
|
246 const TVersion &aVersion, |
|
247 const RMessage2& aMessage ) const; |
|
248 |
|
249 |
|
250 private: // New functions |
|
251 |
|
252 /** |
|
253 * C++ constructor. |
|
254 */ |
|
255 CPhSrvServer( TInt aPriority ); |
|
256 |
|
257 /** |
|
258 * By default Symbian 2nd phase constructor is private. |
|
259 * @since 2.8 |
|
260 */ |
|
261 void ConstructL(); |
|
262 |
|
263 /** |
|
264 * Returns file server session. |
|
265 */ |
|
266 RFs& FsSessionL(); |
|
267 |
|
268 |
|
269 /** |
|
270 * Returns resource manager. |
|
271 */ |
|
272 CPhSrvResourceManager& ResourceManagerL(); |
|
273 |
|
274 /** |
|
275 * Performs step in create all. |
|
276 */ |
|
277 TInt CreateAllStepL(); |
|
278 |
|
279 /** |
|
280 * Performs an step. |
|
281 */ |
|
282 void PerformNextStepL(); |
|
283 |
|
284 /** |
|
285 * Complete create all. |
|
286 */ |
|
287 void CompleteCreateAll( TInt aError ); |
|
288 |
|
289 /** |
|
290 * Create all step. |
|
291 */ |
|
292 static TInt DoCreateAllStepL( TAny* aAny ); |
|
293 |
|
294 private: // Data |
|
295 |
|
296 // The file server session for the whole server. |
|
297 RFs iFsSession; |
|
298 |
|
299 |
|
300 // The object responsible for controlling the server resource file. |
|
301 CPhSrvResourceManager* iResourceFileManager; |
|
302 |
|
303 // The object responsible for controlling the interface to the phone. |
|
304 CPhSrvPhoneController* iPhoneController; |
|
305 |
|
306 // The object container indexer which owns and manages the CObjectCon |
|
307 // instances ensuring that each container has a unique handle spanning |
|
308 // all sub-sessions. |
|
309 // As well as owning the object containers, it also is responsible |
|
310 // for creating new ones. |
|
311 mutable CObjectConIx* iObjectConIx; |
|
312 |
|
313 // The object responsible for acting as the bridge between an external |
|
314 // call client, and the phone app engine notifier client. |
|
315 CPhSrvCallRequestManager* iCallRequestManager; |
|
316 |
|
317 // The object responsible for acting as the bridge between an external |
|
318 // call client, and the phone app engine notifier client. |
|
319 CPhSrvEmergencyRequestManager* iEmergencyRequestManager; |
|
320 |
|
321 // Responsible for all USSD related server functionality. |
|
322 CPhSrvUssdManager* iUssdManager; |
|
323 |
|
324 // Responsible for all emergency number related functionality. |
|
325 CPhSrvEmergencyNumberManager* iEmergencyNumberManager; |
|
326 |
|
327 // The object responsible for acting as the bridge between an external |
|
328 // command handler client, and the phone app engine notifier client. |
|
329 CPhSrvComHandRequestManager* iComHandRequestManager; |
|
330 |
|
331 // The object responsible for handling messenger requests. |
|
332 CPhSrvMessengerRequestManager* iMessengerRequestManager; |
|
333 |
|
334 // CREATE ALL VARIABLES |
|
335 |
|
336 // Idle object for create all. |
|
337 CIdle* iCreateAll; |
|
338 |
|
339 // Step index. |
|
340 TInt iCreateAllStep; |
|
341 |
|
342 // Error. |
|
343 TInt iCreateAllError; |
|
344 |
|
345 // Array of sessions. |
|
346 RPointerArray< CPhSrvSession > iCreateAllArray; |
|
347 |
|
348 // Reference count for font and bitmap server connections. |
|
349 TInt iFBSConnections; |
|
350 }; |
|
351 |
|
352 #endif // CPHSRVSERVER_H |
|
353 |
|
354 |
|
355 // End of File |