|
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 CMCESECUREINSESSION_H |
|
22 #define CMCESECUREINSESSION_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32std.h> |
|
26 #include <mceinsession.h> |
|
27 #include <mcesecuresession.h> |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * Class for mobile terminated secure MCE sessions. |
|
33 * |
|
34 * CMceSecureInSession represents incoming invitation to join in a secure session. |
|
35 * |
|
36 * The characteristics of the session are defined by remote terminal. Theses charactereistics |
|
37 * are defined using SDP and are turned by MCE server into structure of media streams attached |
|
38 * into the session. The user of this class is then responsible to either reject accept |
|
39 * the invitation. |
|
40 * |
|
41 * Accepting the invitation is executed in two steps. First after receiving the invitation |
|
42 * the user must complete the media structure. Streams attached to the session are not complete, |
|
43 * but they must be completed by the user. Those componens defined in SDP are put automatically |
|
44 * into media structure (like streams and RTP sinks and sources), but other relations must |
|
45 * be completed by user. When media structure is complete, UpdateL method is called and session |
|
46 * establishement continues with second step. |
|
47 * |
|
48 * After all media resources are succesfully negotiated and reserved, session state is changed |
|
49 * to Proceeding, and end used can be alarmed about incoming invitation. Typically, at this state |
|
50 * 180 Ringing response is sent to network. If end user accepts the invitation, 200 OK is |
|
51 * sent to network and session is established. |
|
52 * |
|
53 * After the session has been succesfylly established, it can be later updated and |
|
54 * must be finally terminated. |
|
55 * |
|
56 * This class is never instantiated by user, but the ownership is in any case transferred |
|
57 * to it. See class MMceInSessionObserver. |
|
58 * |
|
59 * If for any reason instance of this class is deleted while in established state, |
|
60 * session is automatically terminated by MCE server. |
|
61 * |
|
62 * @lib mceclient.lib |
|
63 */ |
|
64 class CMceSecureInSession : public CMceInSession, public MMceSecureSession |
|
65 { |
|
66 public: // Constructors and destructor |
|
67 |
|
68 /** |
|
69 * Destructor |
|
70 */ |
|
71 IMPORT_C ~CMceSecureInSession(); |
|
72 |
|
73 public: // Functions |
|
74 |
|
75 /** |
|
76 * Returns the type of the session. |
|
77 * @return The type of the session. |
|
78 */ |
|
79 virtual TMceSessionType Type() const; |
|
80 |
|
81 /* |
|
82 * Get the supported crypto contexts of the terminal. |
|
83 * @return supported crypto contexts. |
|
84 */ |
|
85 virtual const RArray<TMceCryptoContext>& SupportedCryptoContextsL() const; |
|
86 |
|
87 /* |
|
88 * Get the used crypto contexts in the session. |
|
89 * @return used crypto contexts. |
|
90 */ |
|
91 virtual const RArray<TMceCryptoContext>& CryptoContexts() const; |
|
92 |
|
93 /* |
|
94 * Set the used crypto contexts in the session. |
|
95 * @pre State() == CMceSession::EIdle || |
|
96 * State() == CMceSession::EIncoming || |
|
97 * State() == CMceSession::EEstablished |
|
98 * @param aArray Array of crypto contexts to be used in session. |
|
99 */ |
|
100 virtual void SetCryptoContextsL( const RArray<TMceCryptoContext>& aArray ); |
|
101 |
|
102 public: // serialization |
|
103 |
|
104 /** |
|
105 * Two-phased constructor. |
|
106 * @param aReadStream, read stream |
|
107 * @param aManager, reference to session manager. |
|
108 * @param aProfileId, id of the sip profile used for the session. |
|
109 * @param aUpdateSession, boolean defining whether new session |
|
110 * is created becuase of updating |
|
111 */ |
|
112 static CMceSecureInSession* NewL( RReadStream& aReadStream, |
|
113 CMceManager& aManager, |
|
114 TUint32 aProfileId, |
|
115 TBool aUpdateSession = EFalse ); |
|
116 |
|
117 /** |
|
118 * Two-phased constructor. |
|
119 * For temporay use only. |
|
120 */ |
|
121 static CMceSecureInSession* NewL(); |
|
122 |
|
123 /** |
|
124 * C++ default constructor. |
|
125 * @param aManager, reference to session manager. |
|
126 * @param aProfileId, id of the sip profile used for the session. |
|
127 */ |
|
128 CMceSecureInSession( CMceManager* aManager, TUint32 aProfileId ); |
|
129 |
|
130 /** |
|
131 * Two-phased constructor. |
|
132 * @param aSerCtx, context containing read stream |
|
133 */ |
|
134 void InitializeInSessionL( MMceComSerializationContext& aSerCtx, |
|
135 TBool aUpdateSession ); |
|
136 |
|
137 private: //methods |
|
138 |
|
139 /** |
|
140 * second-phase constructor |
|
141 * @param aOriginator, the originator |
|
142 * @param aRecipient, the recipient |
|
143 */ |
|
144 void ConstructL( const TDesC8& aOriginator, const TDesC8& aRecipient ); |
|
145 |
|
146 |
|
147 private: //data |
|
148 |
|
149 RArray<TMceCryptoContext> iTemp; |
|
150 |
|
151 MCE_UNIT_TEST_DEFS |
|
152 |
|
153 }; |
|
154 |
|
155 |
|
156 #endif |