|
1 /* |
|
2 * Copyright (c) 2006 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: XIMP Framework PSC server class |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CXIMPPSCSERVER_H |
|
19 #define CXIMPPSCSERVER_H |
|
20 |
|
21 #include "ximpsrv.h" |
|
22 #include <ximpbase.h> |
|
23 #include "ximpglobalsobserver.h" |
|
24 |
|
25 #include <e32base.h> |
|
26 |
|
27 |
|
28 class CXIMPGlobals; |
|
29 class MXIMPSrvTestListener; |
|
30 |
|
31 |
|
32 /** |
|
33 * Presence Service Connection (PSC) server implementation. |
|
34 * There exists one PSC server per protocol. |
|
35 */ |
|
36 class CXIMPServer : public CPolicyServer, |
|
37 public MXIMPSrv, |
|
38 public MXIMPGlobalsObserver |
|
39 { |
|
40 public: // Execution and destructor |
|
41 static void ExecuteL(); |
|
42 virtual ~CXIMPServer(); |
|
43 |
|
44 public: // from MXIMPGlobalsObserver |
|
45 void AllHostsDied(); |
|
46 |
|
47 private: // Constructors |
|
48 static CXIMPServer* NewLC(); |
|
49 CXIMPServer(); |
|
50 void ConstructL(); |
|
51 |
|
52 |
|
53 private: // From CPolicyServer |
|
54 CSession2* NewSessionL( const TVersion& aVersion, |
|
55 const RMessage2& aMessage ) const; |
|
56 |
|
57 |
|
58 private: // From MXIMPSrv |
|
59 void SessionCreated(); |
|
60 void SessionDied(); |
|
61 MXIMPSrvTestListener* TestListener() const; |
|
62 void RegisterTestListener( MXIMPSrvTestListener* aTestSession ); |
|
63 |
|
64 private: // Helper |
|
65 |
|
66 void TryToStopScheduling(); |
|
67 |
|
68 private: //Data |
|
69 |
|
70 // OWN: Count of sessions |
|
71 TInt iSessionCount; |
|
72 TBool iAllHostsDied; |
|
73 |
|
74 |
|
75 // OWN: Always increasing session id. |
|
76 TUint32 iSessionId; |
|
77 |
|
78 // OWN: pointer to globals singleton |
|
79 CXIMPGlobals* iGlobals; |
|
80 |
|
81 // Does not own. Pointer to test listener. |
|
82 MXIMPSrvTestListener* iTestListener; |
|
83 }; |
|
84 |
|
85 #endif // CXIMPPSCSERVER_H |
|
86 |
|
87 |
|
88 |
|
89 |