|
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 #ifndef CMCEOUTSESSION_H |
|
20 #define CMCEOUTSESSION_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 #include <mcesession.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CSIPProfile; |
|
28 class CMceMediaStream; |
|
29 class CMceManager; |
|
30 class CMceEvent; |
|
31 class CMceRefer; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * Class for mobile originated MCE sessions. |
|
37 * |
|
38 * CMceOutSession represents outgoing invitation to remote terminal to join in a session. |
|
39 * |
|
40 * The characteristics of the session are defined by user of this class by attaching |
|
41 * media streams into the session. Theses charactereistics are turned by MCE server into SDP |
|
42 * and attached into sent invitation request. |
|
43 * |
|
44 * After the session has been succesfylly established, it can be later updated and |
|
45 * must be finally terminated. |
|
46 * |
|
47 * If for any reason instance of this class is deleted while in established state, |
|
48 * session is automatically terminated by MCE server. |
|
49 * |
|
50 * @lib mceclient.lib |
|
51 */ |
|
52 class CMceOutSession : public CMceSession |
|
53 { |
|
54 |
|
55 public: // Constructors and destructor |
|
56 |
|
57 /** |
|
58 * Two-phased constructor. Should be used when session |
|
59 * is established into new logical connection to remote terminal. |
|
60 * @param aManager, reference to session manager. |
|
61 * @param aProfile, sip profile used for the session. |
|
62 * @param aRecipient, recipient of the session invitation. |
|
63 * @param aOriginator, originator of the session invitation. |
|
64 */ |
|
65 IMPORT_C static CMceOutSession* NewL( |
|
66 CMceManager& aManager, |
|
67 CSIPProfile& aProfile, |
|
68 const TDesC8& aRecipient, |
|
69 HBufC8* aOriginator = 0); |
|
70 |
|
71 /** |
|
72 * Two-phased constructor. Should be used when session is associated |
|
73 * to existing event. This guarantees that session is established with |
|
74 * same remote terminal with the event. |
|
75 * @param aEvent, reference to existing event that is associated |
|
76 * with this session. |
|
77 */ |
|
78 IMPORT_C static CMceOutSession* NewL(CMceEvent& aEvent); |
|
79 |
|
80 /** |
|
81 * Two-phased constructor. Should be used when session is associated |
|
82 * to existing refer. This guarantees that session is established with |
|
83 * same remote terminal with the refer. |
|
84 * @param aRefer, reference to existing refer that is associated |
|
85 * with this session. |
|
86 */ |
|
87 IMPORT_C static CMceOutSession* NewL(CMceRefer& aRefer); |
|
88 |
|
89 /** |
|
90 * Destructor. |
|
91 */ |
|
92 IMPORT_C ~CMceOutSession(); |
|
93 |
|
94 public: // from CMceSession |
|
95 |
|
96 /** |
|
97 * Adds media stream into session. |
|
98 * @pre State() == CMceSession::EIdle || |
|
99 * State() == CMceSession::EIncoming || |
|
100 * State() == CMceSession::EEstablished |
|
101 * @pre aMediaStream != 0 |
|
102 * @param aMediaStream, media stream to be added. |
|
103 * ownership is transferred. |
|
104 */ |
|
105 IMPORT_C void AddStreamL( CMceMediaStream* aMediaStream ); |
|
106 |
|
107 public: // Functions |
|
108 |
|
109 /** |
|
110 * Establishes a SIP session with the recipient. |
|
111 * The streams in the stream array are offered in the |
|
112 * SDP codec negotiation. |
|
113 * @pre State() == CMceSession::EIdle |
|
114 * @post State() == CMceSession::EOffering |
|
115 * @param aTimeout, the session timer value in seconds |
|
116 * @param aHeaders, SIP headers to be added. Ownership is |
|
117 * transferred. |
|
118 * @param aContentType, content type of the body. |
|
119 * Ownership is transferred. |
|
120 * @param aContent, content to be added in body. Ownership is |
|
121 * transferred. |
|
122 * @param aContentHeaders, content headers to be added. Ownership is |
|
123 * transferred. |
|
124 */ |
|
125 IMPORT_C void EstablishL( |
|
126 TUint32 aTimeout = 0, |
|
127 CDesC8Array* aHeaders = 0, |
|
128 HBufC8* aContentType = 0, |
|
129 HBufC8* aContent = 0, |
|
130 CDesC8Array* aContentHeaders = 0 ); |
|
131 |
|
132 /** |
|
133 * Cancels a previously initialized MO session. |
|
134 * @pre State() == CMceSession::EOffering |
|
135 */ |
|
136 IMPORT_C void CancelL(); |
|
137 |
|
138 private://methods |
|
139 |
|
140 /** |
|
141 * C++ default constructor. |
|
142 * @param aManager, reference to session manager. |
|
143 * @param aProfileId, id of the sip profile used for the session. |
|
144 */ |
|
145 CMceOutSession( CMceManager* aManager, TUint32 aProfileId ); |
|
146 |
|
147 /** |
|
148 * second-phase constructor |
|
149 * @param aRecipient, the recipient |
|
150 * @param aOriginator, the originator |
|
151 */ |
|
152 void ConstructL( const TDesC8& aRecipient, HBufC8* aOriginator ); |
|
153 |
|
154 |
|
155 private: // Data |
|
156 |
|
157 }; |
|
158 |
|
159 #endif |