|
1 /* |
|
2 * Copyright (c) 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CMCECSSESSION_H |
|
22 #define CMCECSSESSION_H |
|
23 |
|
24 #include "mcesrv.h" |
|
25 #include "mceclientserver.h" |
|
26 |
|
27 #define MCE_SESSION_ID( session ) reinterpret_cast<TUint32>( session ) |
|
28 #define ALLOW_NOT_SUPPORTED_ITC |
|
29 |
|
30 |
|
31 // FORWARD DECLARATION |
|
32 class CMceServerCore; |
|
33 class CMceCsSessionReceiver; |
|
34 class CMceCsSubSessionReceiver; |
|
35 class CMceCsSubSession; |
|
36 class CMceCsServerITC; |
|
37 class TMceIds; |
|
38 class CMceCsSessionImplementation; |
|
39 |
|
40 |
|
41 // CLASS DECLARATION |
|
42 |
|
43 /** |
|
44 * MCE CS session. This class implements Symbian |
|
45 * Client-Server session |
|
46 * |
|
47 * @lib |
|
48 * @since |
|
49 */ |
|
50 class CMceCsSession : public CSession2 |
|
51 { |
|
52 |
|
53 public: // Constructors and destructor |
|
54 |
|
55 /** |
|
56 * Two-phased constructor. |
|
57 * @param aServerCore reference to server core. |
|
58 * @return CS session |
|
59 */ |
|
60 static CMceCsSession* NewL( CMceServerCore& aServerCore ); |
|
61 |
|
62 /** |
|
63 * Two-phased constructor. |
|
64 * @param aServerCore, reference to server core. |
|
65 * @return CS session |
|
66 */ |
|
67 static CMceCsSession* NewLC( CMceServerCore& aServerCore ); |
|
68 |
|
69 /** |
|
70 * Destructor. |
|
71 */ |
|
72 ~CMceCsSession(); |
|
73 |
|
74 public: // CSession2 |
|
75 |
|
76 /** |
|
77 * Provides services of MCE server |
|
78 * @param aMessage, message from the client. |
|
79 */ |
|
80 void ServiceL( const RMessage2& aMessage ); |
|
81 |
|
82 public: // New |
|
83 |
|
84 /** |
|
85 * Gets reference to server core |
|
86 * @return reference to server core |
|
87 */ |
|
88 CMceServerCore& ServerCore(); |
|
89 |
|
90 /** |
|
91 * Gets UID of the client |
|
92 * @return client UID |
|
93 */ |
|
94 TUid Uid(); |
|
95 |
|
96 /** |
|
97 * Creates subsession receiver |
|
98 * @return subsession receiver |
|
99 */ |
|
100 CMceCsSubSessionReceiver* CreateSubSessionReceiverL(); |
|
101 |
|
102 /** |
|
103 * Returns implementation |
|
104 * @return implementation |
|
105 */ |
|
106 CMceCsSessionImplementation& Implementation(); |
|
107 |
|
108 /** |
|
109 * Gets pointer to receiver based on iManagerType of ids |
|
110 * @param aIds set of ids defining ITC callback context |
|
111 * @return session receiver |
|
112 */ |
|
113 CMceCsSessionReceiver* ReceiverL( TMceIds& aIds ); |
|
114 |
|
115 |
|
116 private: |
|
117 |
|
118 CMceCsSession (CMceServerCore& aServerCore); |
|
119 void ConstructL(); |
|
120 CMceCsServerITC& ITC(); |
|
121 void DoServiceL (TInt aFunction, const RMessage2& aMessage); |
|
122 void ClientReadyToReceiveL(TMceIds& aIds, const RMessage2& aMessage); |
|
123 void CancelClientReceiveL( TMceIds& aIds ); |
|
124 void SupportedCodecsL(TInt aFunction, const RMessage2& aMessage); |
|
125 void SetClientUidL(TMceIds& aIds, const RMessage2& aMessage); |
|
126 void CreateSubSessionL(TMceIds& aIds, const RMessage2& aMessage); |
|
127 void DeleteSubSessionL(TMceIds& aIds, const RMessage2& aMessage); |
|
128 void ReceiveL (TMceIds& aIds, const RMessage2& aMessage); |
|
129 void CallSubSessionL(TMceIds& aIds, TInt aFunction, const RMessage2& aMessage); |
|
130 void StoreDefaultHeadersL( const RMessage2& aMessage ); |
|
131 void DefaultHeadersL( const RMessage2& aMessage ); |
|
132 void MediaServiceL( TMceIds& aIds, TMceItcFunctions aFunction, const RMessage2& aMessage ); |
|
133 |
|
134 |
|
135 |
|
136 private: //Owned data |
|
137 |
|
138 //client's UID |
|
139 TUid iClientUid; |
|
140 //server ITC |
|
141 CMceCsServerITC* iITC; |
|
142 //session receivers (one per client) |
|
143 RPointerArray<CMceCsSessionReceiver> iReceivers; |
|
144 //session implementation |
|
145 CMceCsSessionImplementation* iImpl; |
|
146 |
|
147 private: //NOT owned data |
|
148 |
|
149 //MCE server core |
|
150 CMceServerCore& iServerCore; |
|
151 |
|
152 |
|
153 //definitions for unit testing |
|
154 MCESRV_UT_DEFINITIONS |
|
155 |
|
156 }; |
|
157 |
|
158 #endif |
|
159 |
|
160 // End of File |