|
1 /* |
|
2 * Copyright (c) 2004 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: See class definition below. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __CTCSIPCONTEXT_H__ |
|
21 #define __CTCSIPCONTEXT_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include "CTcContextBase.h" |
|
25 #include "CTcIAPManager.h" |
|
26 |
|
27 #include "CTcMCEProfileContainer.h" |
|
28 #include "CTcMCEReceived.h" |
|
29 #include <MCEManager.h> |
|
30 #include <MCEFCMsgExchange.h> |
|
31 #include <MCETransactionDataContainer.h> |
|
32 |
|
33 #include "SIPObserver.h" |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 |
|
37 class CTcMCEReceiveQueue; |
|
38 class CTcMCEMultimediaAPIObserver; |
|
39 class CTcMCEEventAPIObserver; |
|
40 class CTcMCEFloorControlObserver; |
|
41 |
|
42 // CLASS DEFINITION |
|
43 /** |
|
44 * CTcMCEContext implements the test context (MTcTestContext) for MCE testing. |
|
45 */ |
|
46 class CTcMCEContext |
|
47 : public CTcContextBase, |
|
48 public MSIPObserver |
|
49 { |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * Static constructor. Leaves pointer to cleanup stack. |
|
54 * |
|
55 * @param aCodec Reference to CTRL codec object, |
|
56 * initialized to a valid request. |
|
57 * @param aIAPId IAPId as selected by user from TC settings. |
|
58 |
|
59 * @return An initialized instance of this class. |
|
60 */ |
|
61 static CTcMCEContext* NewLC( CTcCTRLCodec& aCodec, |
|
62 TInt aIAPId ); |
|
63 |
|
64 /// Destructor |
|
65 ~CTcMCEContext(); |
|
66 |
|
67 |
|
68 public: // from MSIPObserver |
|
69 |
|
70 void IncomingRequest(TUint32 aIapId, |
|
71 CSIPServerTransaction* aTransaction); |
|
72 |
|
73 void TimedOut(CSIPServerTransaction& aTransaction); |
|
74 |
|
75 private: |
|
76 |
|
77 /** |
|
78 * Constructor. |
|
79 * |
|
80 * @param aCodec Reference to CTRL codec object, |
|
81 * initialized to a valid request. |
|
82 */ |
|
83 CTcMCEContext( CTcCTRLCodec& aCodec ); |
|
84 |
|
85 /// Default constructor. Not implemented. |
|
86 CTcMCEContext(); |
|
87 |
|
88 /** |
|
89 * 2nd phase constructor |
|
90 * |
|
91 * @param aIAPId IAPId as selected by user from TC settings. |
|
92 * @param aIsMandatory used for determining if the SIP stack |
|
93 * is automatically started. If default value (ETrue) is used, |
|
94 * then SIP stack is started automatically. |
|
95 */ |
|
96 void ConstructL( TInt aIAPId ); |
|
97 |
|
98 |
|
99 protected: // From CTcContextBase |
|
100 |
|
101 TTcCommandBase* CreateCommandL( TTcIdentifier& aId, |
|
102 MTcTestContext& aContext ); |
|
103 |
|
104 |
|
105 public: // New methods |
|
106 |
|
107 /// @return Reference to MCEManager. |
|
108 inline CMceManager& MCEManager() |
|
109 { return *iMCEManager; }; |
|
110 |
|
111 /// @return Reference to the SIP stack. |
|
112 inline CSIP& SIP() |
|
113 { return *iSip; }; |
|
114 |
|
115 /// @return Reference to the default SIP profile. |
|
116 inline CTcMCEProfileContainer& Profile() |
|
117 { return *iSipProfile; }; |
|
118 |
|
119 /// @return Reference to the floor controller |
|
120 inline CMceFcMsgExchange& FC() |
|
121 { return *iFC; }; |
|
122 |
|
123 /// @return Reference to the floor control observer |
|
124 inline CTcMCEFloorControlObserver& FCObserver() |
|
125 { return *iFCObserver; }; |
|
126 |
|
127 /// @return Reference to the multimedia observer |
|
128 inline CTcMCEMultimediaAPIObserver& MultimediaObserver() |
|
129 { |
|
130 return *iMMObserver; |
|
131 } |
|
132 |
|
133 /// @return Reference to the event observer |
|
134 inline CTcMCEEventAPIObserver& EventObserver() |
|
135 { |
|
136 return *iEventObserver; |
|
137 } |
|
138 |
|
139 public: //New methods, received queue handling |
|
140 /** |
|
141 * Returns the first item off the session receive queue (FIFO). |
|
142 * If no items are present, the function will wait for aTimeout seconds |
|
143 * and then try fetching again. |
|
144 * |
|
145 * @param aTimeOut Time in seconds waited for items to arrive. |
|
146 */ |
|
147 CTcMCEReceived& ReceivedSessionItemL( TInt aTimeout ); |
|
148 |
|
149 CTcMCEReceived& ReceivedUpdatedSessionItemL( TInt aTimeout ); |
|
150 /** |
|
151 * Returns the first item off the RTP receive queue (FIFO). |
|
152 * If no items are present, the function will wait for aTimeout seconds |
|
153 * and then try fetching again. |
|
154 * |
|
155 * @param aTimeOut Time in seconds waited for items to arrive. |
|
156 */ |
|
157 CTcMCEReceived& ReceivedRTPItemL( TInt aTimeout ); |
|
158 |
|
159 /** |
|
160 * Returns the first item off the Stream receive queue (FIFO). |
|
161 * If no items are present, the function will wait for aTimeout seconds |
|
162 * and then try fetching again. |
|
163 * |
|
164 * @param aTimeOut Time in seconds waited for items to arrive. |
|
165 */ |
|
166 CTcMCEReceived& ReceivedStreamItemL( TInt aTimeout ); |
|
167 |
|
168 /** |
|
169 * Returns the first item off the Event receive queue (FIFO). |
|
170 * If no items are present, the function will wait for aTimeout seconds |
|
171 * and then try fetching again. |
|
172 * |
|
173 * @param aTimeOut Time in seconds waited for items to arrive. |
|
174 */ |
|
175 CTcMCEReceived& ReceivedEventItemL( TInt aTimeout ); |
|
176 |
|
177 /** |
|
178 * Returns the first item off the Floor control receive queue (FIFO). |
|
179 * If no items are present, the function will wait for aTimeout seconds |
|
180 * and then try fetching again. |
|
181 * |
|
182 * @param aTimeOut Time in seconds waited for items to arrive. |
|
183 */ |
|
184 CTcMCEReceived& ReceivedFCItemL( TInt aTimeout ); |
|
185 |
|
186 |
|
187 private: // New methods |
|
188 |
|
189 |
|
190 private: // data |
|
191 |
|
192 // Floor controller, owned |
|
193 CMceFcMsgExchange* iFC; |
|
194 |
|
195 // MCE Manager, owned |
|
196 CMceManager* iMCEManager; |
|
197 |
|
198 // MultimediaObserver, owned |
|
199 CTcMCEMultimediaAPIObserver* iMMObserver; |
|
200 |
|
201 // Floor control observer, owned |
|
202 CTcMCEFloorControlObserver* iFCObserver; |
|
203 |
|
204 // Event API observer, owned |
|
205 CTcMCEEventAPIObserver* iEventObserver; |
|
206 |
|
207 /// SIP stack. Owned. |
|
208 CSIP* iSip; |
|
209 |
|
210 /// Default SIP profile. Owned. |
|
211 CTcMCEProfileContainer* iSipProfile; |
|
212 |
|
213 TMceTransactionDataContainer iDataContainer; |
|
214 |
|
215 TInt iIAPId; |
|
216 }; |
|
217 |
|
218 #endif // __CTCSIPCONTEXT_H__ |