|
1 /* |
|
2 * Copyright (c) 2009 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 #ifndef LCSESSIONSTUB_H |
|
19 #define LCSESSIONSTUB_H |
|
20 |
|
21 #include <QString> |
|
22 #include <QMap> |
|
23 #include <e32std.h> |
|
24 |
|
25 class MLcUiProvider; |
|
26 |
|
27 extern bool lcutStub_LcSession_expectCall( const QString& call, int callNdx = 0); |
|
28 extern void lcutStub_LcSession_reset(); |
|
29 extern MLcUiProvider* lcutStub_LcSession_lcUiProvider(); |
|
30 |
|
31 const char lcutStub_LcSession_NoCall[] = "NOCALL"; |
|
32 const char lcutStub_LcSession_establishSession[] = "LcEngine::EstablishLcSessionL"; |
|
33 const char lcutStub_LcSession_terminateSession[] = "LcEngine::TerminateLcSessionL"; |
|
34 const char lcutStub_LcSession_updateSession[] = "LcEngine::UpdateLcSessionL"; |
|
35 |
|
36 _LIT( KLcStubLocalDisplayName, "local"); |
|
37 _LIT( KLcStubRemoteDisplayName, "remote"); |
|
38 _LIT( KLcStubRemoteDetails, "112233459"); |
|
39 |
|
40 // INCLUDES |
|
41 #include "lcsession.h" |
|
42 |
|
43 #include <e32std.h> |
|
44 #include <e32base.h> |
|
45 |
|
46 // FORWARD DECLARATIONS |
|
47 class MLcSessionObserver; |
|
48 class MLcUiProvider; |
|
49 class CLcVideoPlayer; |
|
50 |
|
51 |
|
52 // CLASS DECLARATION |
|
53 /** |
|
54 * A class representing a Live Comms session. |
|
55 */ |
|
56 class CLcSession : public CBase, |
|
57 public MLcSession |
|
58 { |
|
59 public: |
|
60 /** |
|
61 * Creates new CLcSession. |
|
62 * |
|
63 * @return CLcSession* New instanse of specified class |
|
64 */ |
|
65 static CLcSession* NewL(); |
|
66 |
|
67 |
|
68 public: |
|
69 |
|
70 /** |
|
71 * Destructor |
|
72 */ |
|
73 ~CLcSession(); |
|
74 |
|
75 public: // from MLcSession |
|
76 |
|
77 /** |
|
78 * Returns the current session state. |
|
79 * @return the session state |
|
80 */ |
|
81 TLcSessionState LcSessionState() const; |
|
82 |
|
83 /** |
|
84 * Sets the observer for the session related events. |
|
85 * @param aObserver the observer |
|
86 */ |
|
87 void SetLcSessionObserver( MLcSessionObserver* aObserver ); |
|
88 |
|
89 /** |
|
90 * Sets the callback for the UI prompts. |
|
91 * @param aUiProvider callback for UI prompts |
|
92 */ |
|
93 void SetLcUiProvider( MLcUiProvider* aUiProvider ); |
|
94 |
|
95 /** |
|
96 * Establishes the session. |
|
97 * In case of a MO session initiates the session negotiation. |
|
98 * In case of a MT session accepts the incoming session. |
|
99 */ |
|
100 void EstablishLcSessionL(); |
|
101 |
|
102 /** |
|
103 * Terminates the session. |
|
104 * Can be used for terminating an existing session as well as |
|
105 * cancelling a MO session that has not yet been established. |
|
106 * Can also be used for rejecting an incoming session. |
|
107 */ |
|
108 void TerminateLcSessionL(); |
|
109 |
|
110 /** |
|
111 * Returns the video player for the received media. |
|
112 * Is present if the session contains video |
|
113 * received from the remote participant. |
|
114 * @return the remote video player or NULL if not present |
|
115 */ |
|
116 MLcVideoPlayer* RemoteVideoPlayer(); |
|
117 |
|
118 /** |
|
119 * Returns the video player for the media that is being sent. |
|
120 * Is present if the session contains outgoing video. |
|
121 * @return the local video player or NULL if not present |
|
122 */ |
|
123 MLcVideoPlayer* LocalVideoPlayer(); |
|
124 |
|
125 /** |
|
126 * Returns the own display name for the session. |
|
127 * @return the local display name |
|
128 */ |
|
129 const TDesC& LocalDisplayName(); |
|
130 |
|
131 /** |
|
132 * Returns the remote party's display name for the session. |
|
133 * @return the remote display name |
|
134 */ |
|
135 const TDesC& RemoteDisplayName(); |
|
136 |
|
137 /** |
|
138 * Sets a parameter for the session. |
|
139 * The parameters can be plug-in specific. |
|
140 * @param aId the identifier for the parameter |
|
141 * @param aValue the value for the parameter |
|
142 */ |
|
143 TInt SetParameter( TInt aId, TInt aValue ); |
|
144 |
|
145 /** |
|
146 * Returns a value for a session parameter. |
|
147 * @param aId the identifier for the parameter |
|
148 * @return the value for the parameter or an error if not present |
|
149 */ |
|
150 TInt ParameterValue( TInt aId ); |
|
151 |
|
152 /** |
|
153 * Checks whether application should be started in background mode. |
|
154 * In background mode session will be pre-set up without user |
|
155 * interaction and will be in paused state. |
|
156 * @return ETrue if background mode should be used |
|
157 */ |
|
158 TBool IsBackgroundStartup(); |
|
159 |
|
160 /** |
|
161 * Engine can be informed about application foreground status via |
|
162 * this method. |
|
163 * @param aIsForeground ETrue if application is at foreground, EFalse |
|
164 * if at background |
|
165 * @return KErrNone if succesfully handled |
|
166 */ |
|
167 TInt SetForegroundStatus( TBool aIsForeground ); |
|
168 |
|
169 /** |
|
170 * Returns remote party details for the session |
|
171 * @return remote party details or KNullDesC if those are not known |
|
172 */ |
|
173 const TDesC& RemoteDetails(); |
|
174 |
|
175 /** |
|
176 * Updates established session. |
|
177 * All the changes, if they are not yet delivered, to players, windows |
|
178 * and session parameters has been commited after the call. |
|
179 */ |
|
180 void UpdateLcSessionL(); |
|
181 |
|
182 /** |
|
183 * Send DTMF signals. |
|
184 * @param aKey Key pressed from dialpad. Key can be [0-9],*,#,A,B,C,D. |
|
185 * which is 16 key combination of DTMF. |
|
186 * Send DTMF signals to remote party. |
|
187 * @return ETrue upon success else EFalse. |
|
188 */ |
|
189 TBool SendDialTone( TChar aKey); |
|
190 |
|
191 |
|
192 protected: |
|
193 |
|
194 /** |
|
195 * Constructor |
|
196 */ |
|
197 CLcSession( ); |
|
198 |
|
199 /** |
|
200 * Second-phase constructor |
|
201 */ |
|
202 void ConstructL(); |
|
203 public: |
|
204 |
|
205 MLcSessionObserver* iSessionObserver; |
|
206 MLcUiProvider* iLcUiProvider; |
|
207 HBufC* iLocalDisplayName; |
|
208 HBufC* iRemoteDisplayName; |
|
209 HBufC* iRemoteDetails; |
|
210 CLcVideoPlayer* iLocalPlayer; |
|
211 CLcVideoPlayer* iRemotePlayer; |
|
212 TBool iIsForeground; |
|
213 TBool iForegroundChange; |
|
214 TLcSessionState iState; |
|
215 |
|
216 QMap<int, int> mParams; |
|
217 |
|
218 }; |
|
219 |
|
220 #endif // LCSESSIONSTUB_H |
|
221 |
|
222 // end of file |