|
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: Server side SIP event class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 #ifndef CMCECOMEVENT_H |
|
23 #define CMCECOMEVENT_H |
|
24 |
|
25 // INCLUDES |
|
26 #include <e32base.h> |
|
27 #include <badesca.h> |
|
28 #include "mcerefer.h" |
|
29 #include "mceeventcontext.h" |
|
30 #include "mcesipevent.h" |
|
31 #include "mceclientserver.h" |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 class CMceEventContext; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * Server side SIP event base class. |
|
40 * |
|
41 * @lib |
|
42 * @since |
|
43 */ |
|
44 class CMceComEvent : public CBase |
|
45 |
|
46 { |
|
47 public: // Constructors and destructor |
|
48 |
|
49 /** |
|
50 * Two-phased constructor. |
|
51 */ |
|
52 static CMceComEvent* NewL( CMceSipEvent& aSIPEvent, |
|
53 TUint32 aRefreshInterval ); |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 virtual ~CMceComEvent(); |
|
59 |
|
60 public: // New functions |
|
61 |
|
62 /** |
|
63 * Passes an Subscribe action initialized by MCE Client to the event |
|
64 * state machine |
|
65 * @since Series 60 3.0 |
|
66 * @param aEventAction The initialized action as ITC function. |
|
67 * @return None |
|
68 */ |
|
69 void PerformActionL( TMceItcFunctions aEventAction ); |
|
70 |
|
71 |
|
72 /** |
|
73 * Notifies the subscribe event, that the ongoing client or server |
|
74 * transaction proceeds. The transaction is already |
|
75 * stored in the event.It is for passing incoming response |
|
76 * and sip error occured |
|
77 * @param None |
|
78 * @return None |
|
79 */ |
|
80 void ProceedL(); |
|
81 |
|
82 |
|
83 /** |
|
84 * Passes the server transaction to the event. |
|
85 * @param aServerTransaction The server transaction |
|
86 * @param aDialog the dialog belong to the transaction |
|
87 * @return None |
|
88 */ |
|
89 void ReceivedRequestL(); |
|
90 |
|
91 /** |
|
92 * Returns the event context |
|
93 * @param None |
|
94 * @return CMCESipEventContext& Reference to the event context |
|
95 */ |
|
96 CMceEventContext& EventContext(); |
|
97 |
|
98 /** |
|
99 * Returns the previous event action. |
|
100 * @param None |
|
101 * @return The action as ITC function |
|
102 */ |
|
103 TInt PreviousAction() const; |
|
104 |
|
105 /** |
|
106 * Set the previous event action. |
|
107 * @param aEventAction The action as ITC function. |
|
108 * @return None |
|
109 */ |
|
110 void SetPreviousAction( TInt aEventAction ); |
|
111 |
|
112 /** |
|
113 * Returns the refresh interval.It is using for SubscribeEvent |
|
114 * @param None |
|
115 * @return The refresh interval and expire value for the subscribe event |
|
116 */ |
|
117 TUint32 RefreshInterval(); |
|
118 |
|
119 /** |
|
120 * Sets the refresh interval. Applicable for MO subscribe. |
|
121 * @param aInterval The refresh interval |
|
122 * @return None |
|
123 */ |
|
124 void SetRefreshInterval( TUint32 aInterval ); |
|
125 |
|
126 |
|
127 /** |
|
128 * set the Msg header array from client, ownership is transfered |
|
129 * @param aMsgHeaders the list of Msg headers from client |
|
130 * @return none |
|
131 */ |
|
132 void SetMsgHeaders( CDesC8Array* aMsgHeaders); |
|
133 |
|
134 /** |
|
135 * Saves the content from client |
|
136 * @since Series 60 3.0 |
|
137 * @param aMsgContent. Contains the content taken from client |
|
138 * @return None |
|
139 */ |
|
140 void SetMsgContentL(HBufC8* aContentType, |
|
141 HBufC8* aContent ); |
|
142 |
|
143 /** |
|
144 * Returns the content from client |
|
145 * @param None |
|
146 * @return iMsgContent. Contains the content taken from client. |
|
147 * Ownership is transfered. |
|
148 */ |
|
149 HBufC8* MsgContent(); |
|
150 |
|
151 /** |
|
152 * Returns the content from client |
|
153 * @param None |
|
154 * @return iMsgContent. Contains the content taken from client |
|
155 */ |
|
156 TDesC8& MsgContentType(); |
|
157 |
|
158 /** |
|
159 * Returns the message headers from client. If not set in this class, |
|
160 * returns the default headers from c/s session by the given method. |
|
161 * @param aMethodInd the SIP string index for the method |
|
162 * headers are asked for. |
|
163 * @return CDesC8Array& the headers; |
|
164 */ |
|
165 CDesC8Array& MsgHeaders( TInt aMethodInd ); |
|
166 |
|
167 /** |
|
168 * Saves the response reasonphrase from client |
|
169 * @since Series 60 3.0 |
|
170 * @param aReasonPhrase. Contains the ReasonPhrase taken from client |
|
171 * @return None |
|
172 */ |
|
173 void SetReasonPhraseL( TUint32 aStatusCode, |
|
174 HBufC8* aReasonPhrase ); |
|
175 |
|
176 /** |
|
177 * Returns the Reason parameters |
|
178 * @param None |
|
179 * @return iReason |
|
180 */ |
|
181 TDesC8& ReasonPhrase(); |
|
182 |
|
183 /** |
|
184 * Returns the statuscode |
|
185 * @param None |
|
186 * @return iStatusCode |
|
187 */ |
|
188 TUint32 StatusCode() const; |
|
189 |
|
190 /* |
|
191 * Sets the type, applicable only for REFER. |
|
192 * Possible types: |
|
193 * ENoSuppression : The subscription is established. |
|
194 * ESuppressed : The subscription is proposed not to |
|
195 * be established. |
|
196 * EMultipleRefer : The subscription is required not |
|
197 * to be established. |
|
198 * @param aType The type. |
|
199 * @return None |
|
200 */ |
|
201 void SetReferType( CMceRefer::TType aType ); |
|
202 |
|
203 /* |
|
204 * Returns truth value is the suppression on or off. |
|
205 * @return TBool The suppression value |
|
206 */ |
|
207 CMceRefer::TType ReferType() const; |
|
208 |
|
209 /** |
|
210 * Sets the silen suppression on. Used for REFER, when the |
|
211 * client application requested for suppression, |
|
212 * but the remote end did not understand it. |
|
213 */ |
|
214 |
|
215 void SetSilentSuppressionOn(); |
|
216 |
|
217 /** |
|
218 * Returns the value of silent suppression. |
|
219 * @return TBool silent suppression |
|
220 */ |
|
221 TBool SilentSuppression() const; |
|
222 |
|
223 /** |
|
224 * Sets the id value, used for matching NOTIFY:s |
|
225 * @param aIdValue the id value, ownership is taken |
|
226 */ |
|
227 void SetIdValue( TUint aIdValue ); |
|
228 |
|
229 /** |
|
230 * Returns the id value used for matcing NOTIFY:s |
|
231 * @return the id value |
|
232 */ |
|
233 TUint IdValue() const; |
|
234 |
|
235 public: |
|
236 CMceSipEvent& SIPEvent(); |
|
237 |
|
238 protected: // New functions |
|
239 |
|
240 |
|
241 /** |
|
242 * Creates the event context |
|
243 * @param None |
|
244 * @return None |
|
245 */ |
|
246 void CreateEventContextL(); |
|
247 |
|
248 protected: // Functions from base classes |
|
249 |
|
250 /** |
|
251 * C++ default constructor. |
|
252 */ |
|
253 CMceComEvent( CMceSipEvent& aSIPEvent, |
|
254 TUint32 aRefreshInterval ); |
|
255 |
|
256 |
|
257 /** |
|
258 * By default Symbian 2nd phase constructor is private. |
|
259 */ |
|
260 void ConstructL(); |
|
261 |
|
262 private: // Data |
|
263 |
|
264 // Message headers |
|
265 CDesC8Array* iMsgHeaders; |
|
266 // The event observer. |
|
267 CMceSipEvent& iSIPEvent; |
|
268 // The event context, holds the state machine |
|
269 CMceEventContext* iEventContext; |
|
270 |
|
271 HBufC8* iMsgContent; |
|
272 |
|
273 HBufC8* iMsgContentType; |
|
274 |
|
275 HBufC8* iReason; |
|
276 |
|
277 TUint32 iStatusCode; |
|
278 |
|
279 // The previous event action indicated by the MCE Client |
|
280 TInt iPreviousAction; |
|
281 |
|
282 // Event refresh interval |
|
283 TUint32 iRefreshInterval; |
|
284 |
|
285 CMceRefer::TType iReferType; |
|
286 |
|
287 TBool iSilentSuppression; |
|
288 |
|
289 TUint iIdValue; |
|
290 |
|
291 private: //friend class |
|
292 friend class UT_CMceComEvent; |
|
293 friend class UT_CMceEventReferMtEstablishedState; |
|
294 }; |
|
295 |
|
296 #endif //CMCECOMEVENT_H |
|
297 |
|
298 // End of File |