|
1 /* |
|
2 * Copyright (c) 2007 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 CMCESECUREOUTSESSION_H |
|
22 #define CMCESECUREOUTSESSION_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32std.h> |
|
26 #include <mceoutsession.h> |
|
27 #include <mcesecuresession.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CSIPProfile; |
|
31 class CMceMediaStream; |
|
32 class CMceManager; |
|
33 class CMceEvent; |
|
34 class CMceRefer; |
|
35 |
|
36 // CLASS DECLARATION |
|
37 |
|
38 /** |
|
39 * Class for mobile originated secure MCE sessions. |
|
40 * |
|
41 * CMceSecureOutSession represents outgoing invitation to remote terminal to join in a session. |
|
42 * |
|
43 * The characteristics of the session are defined by user of this class by attaching |
|
44 * media streams into the session. Theses charactereistics are turned by MCE server into SDP |
|
45 * and attached into sent invitation request. |
|
46 * |
|
47 * After the session has been succesfylly established, it can be later updated and |
|
48 * must be finally terminated. |
|
49 * |
|
50 * If for any reason instance of this class is deleted while in established state, |
|
51 * session is automatically terminated by MCE server. |
|
52 * |
|
53 * @lib mceclient.lib |
|
54 */ |
|
55 class CMceSecureOutSession : public CMceOutSession, public MMceSecureSession |
|
56 { |
|
57 |
|
58 public: // Constructors and destructor |
|
59 |
|
60 /** |
|
61 * Two-phased constructor. Should be used when session |
|
62 * is established into new logical connection to remote terminal. |
|
63 * @param aManager, reference to session manager. |
|
64 * @param aProfile, sip profile used for the session. |
|
65 * @param aRecipient, recipient of the session invitation. |
|
66 * @param aOriginator, originator of the session invitation. |
|
67 */ |
|
68 IMPORT_C static CMceSecureOutSession* NewL( CMceManager& aManager, |
|
69 CSIPProfile& aProfile, |
|
70 const TDesC8& aRecipient, |
|
71 HBufC8* aOriginator = 0 ); |
|
72 |
|
73 /** |
|
74 * Two-phased constructor. Should be used when session is associated |
|
75 * to existing event. This guarantees that session is established with |
|
76 * same remote terminal with the event. |
|
77 * @param aEvent, reference to existing event that is associated |
|
78 * with this session. |
|
79 */ |
|
80 IMPORT_C static CMceSecureOutSession* NewL( CMceEvent& aEvent ); |
|
81 |
|
82 /** |
|
83 * Two-phased constructor. Should be used when session is associated |
|
84 * to existing refer. This guarantees that session is established with |
|
85 * same remote terminal with the refer. |
|
86 * @param aRefer, reference to existing refer that is associated |
|
87 * with this session. |
|
88 */ |
|
89 IMPORT_C static CMceSecureOutSession* NewL( CMceRefer& aRefer ); |
|
90 |
|
91 /** |
|
92 * Destructor. |
|
93 */ |
|
94 IMPORT_C ~CMceSecureOutSession(); |
|
95 |
|
96 public: // Functions |
|
97 |
|
98 /** |
|
99 * Returns the type of the session. |
|
100 * @return The type of the session. |
|
101 */ |
|
102 virtual TMceSessionType Type() const; |
|
103 |
|
104 /* |
|
105 * Get the supported crypto contexts of the terminal. |
|
106 * @return supported crypto contexts. |
|
107 */ |
|
108 virtual const RArray<TMceCryptoContext>& SupportedCryptoContextsL() const; |
|
109 |
|
110 /* |
|
111 * Get the used crypto contexts in the session. |
|
112 * @return used crypto contexts. |
|
113 */ |
|
114 virtual const RArray<TMceCryptoContext>& CryptoContexts() const; |
|
115 |
|
116 /* |
|
117 * Set the used crypto contexts in the session. |
|
118 * @pre State() == CMceSession::EIdle || |
|
119 * State() == CMceSession::EIncoming || |
|
120 * State() == CMceSession::EEstablished |
|
121 * @param aArray Array of crypto contexts to be used in session. |
|
122 */ |
|
123 virtual void SetCryptoContextsL( const RArray<TMceCryptoContext>& aArray ); |
|
124 |
|
125 public: // serialization |
|
126 |
|
127 /** |
|
128 * Two-phased constructor. |
|
129 * For temporary use only. |
|
130 */ |
|
131 static CMceSecureOutSession* NewL(); |
|
132 |
|
133 private://methods |
|
134 |
|
135 /** |
|
136 * C++ default constructor. |
|
137 * @param aManager, reference to session manager. |
|
138 * @param aProfileId, id of the sip profile used for the session. |
|
139 */ |
|
140 CMceSecureOutSession( CMceManager* aManager, TUint32 aProfileId ); |
|
141 |
|
142 /** |
|
143 * second-phase constructor |
|
144 * @param aRecipient, the recipient |
|
145 * @param aOriginator, the originator |
|
146 */ |
|
147 void ConstructL( const TDesC8& aRecipient, HBufC8* aOriginator ); |
|
148 |
|
149 /** |
|
150 * second-phase constructor |
|
151 * @param aRecipient, the recipient |
|
152 * @param aOriginator, the originator |
|
153 * @param aDialoId, the dialog ID of existing dialog |
|
154 */ |
|
155 void ConstructL( const TDesC8& aRecipient, |
|
156 const TDesC8& aOriginator, |
|
157 TUint32 aDialogId ); |
|
158 |
|
159 private: //data |
|
160 |
|
161 RArray<TMceCryptoContext> iTemp; |
|
162 |
|
163 |
|
164 }; |
|
165 |
|
166 #endif |