author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 15 Sep 2010 12:09:15 +0300 | |
branch | RCL_3 |
changeset 38 | ac48f0cc9f9c |
parent 35 | 6c57ef9392d2 |
child 41 | 755f0370535b |
permissions | -rw-r--r-- |
33 | 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 |
#include "musuisendcontroller.h" |
|
21 |
#include "musuieventobserver.h" |
|
22 |
#include "musuisharingobserver.h" |
|
23 |
#include "musuisendobserver.h" |
|
24 |
#include "musuidialogutil.h" |
|
25 |
#include "musuicallbackservice.h" |
|
26 |
#include "musuifileutil.h" |
|
27 |
#include "mussettings.h" |
|
28 |
#include "musuipropertywatch.h" |
|
29 |
#include "mussessionproperties.h" |
|
30 |
#include "mussettingskeys.h" |
|
31 |
#include "musuiresourcehandler.h" |
|
32 |
#include "muslogger.h" // debug logging |
|
33 |
||
34 |
#include "musengmceoutsession.h" |
|
35 |
#include "musenguriparser.h" |
|
36 |
#include <musui.rsg> |
|
37 |
||
38 |
#include <StringLoader.h> |
|
39 |
#include <pathinfo.h> |
|
40 |
#include <CDirectoryLocalizer.h> |
|
41 |
||
38
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
42 |
_LIT16( KMusUSign, "%U" ); |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
43 |
|
33 | 44 |
|
45 |
using namespace NMusSessionApi; |
|
46 |
||
47 |
// ----------------------------------------------------------------------------- |
|
48 |
// |
|
49 |
// ----------------------------------------------------------------------------- |
|
50 |
// |
|
51 |
CMusUiSendController::~CMusUiSendController() |
|
52 |
{ |
|
53 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::~CMusUiSendController" ); |
|
54 |
||
55 |
delete iAddress; |
|
56 |
delete iRemoteSipAddress; |
|
57 |
delete iRemoteSipAddressProposal; |
|
58 |
TRAP_IGNORE( DeleteFileL() ); |
|
59 |
delete iVideoFileName; |
|
60 |
delete iLocalizer; |
|
61 |
||
62 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::~CMusUiSendController" ); |
|
63 |
} |
|
64 |
||
65 |
||
66 |
// ----------------------------------------------------------------------------- |
|
67 |
// |
|
68 |
// ----------------------------------------------------------------------------- |
|
69 |
// |
|
70 |
CMusEngMceSession* CMusUiSendController::EngineSession() |
|
71 |
{ |
|
72 |
return EngineOutSession(); // Engine out session is CMusEngMceSession |
|
73 |
} |
|
74 |
||
75 |
||
76 |
// ----------------------------------------------------------------------------- |
|
77 |
// |
|
78 |
// ----------------------------------------------------------------------------- |
|
79 |
// |
|
80 |
void CMusUiSendController::DeleteEngineSession() |
|
81 |
{ |
|
82 |
// Cancel invite |
|
83 |
if ( EngineOutSession() && !ConnectionEstablished() ) |
|
84 |
{ |
|
85 |
MUS_LOG( "mus: [MUSUI ] CMusUiSendController::DeleteEngineSession:\ |
|
86 |
Canceling inviting..." ); |
|
87 |
TRAP_IGNORE( EngineOutSession()->CancelInviteL() ); |
|
88 |
} |
|
89 |
} |
|
90 |
||
91 |
||
92 |
// ----------------------------------------------------------------------------- |
|
93 |
// |
|
94 |
// ----------------------------------------------------------------------------- |
|
95 |
// |
|
96 |
void CMusUiSendController::HandlePropertyError( const TInt aReason ) |
|
97 |
{ |
|
98 |
MUS_LOG1( "mus: [MUSUI ] -> CMusUiEventController::HandleError [%d]", |
|
99 |
aReason ); |
|
100 |
TRAP_IGNORE( DeleteVideoL() ); |
|
101 |
||
102 |
CMusUiEventController::HandlePropertyError( aReason ); // For the base class |
|
103 |
||
104 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiEventController::HandleError" ); |
|
105 |
} |
|
106 |
||
107 |
||
108 |
// ----------------------------------------------------------------------------- |
|
109 |
// |
|
110 |
// ----------------------------------------------------------------------------- |
|
111 |
// |
|
112 |
void CMusUiSendController::HandleAsyncEventL( TMusUiAsyncEvent aEventId ) |
|
113 |
{ |
|
114 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::HandleAsyncEventL" ); |
|
115 |
switch ( aEventId ) |
|
116 |
{ |
|
117 |
case EMusUiAsyncInviteCancel: |
|
118 |
{ |
|
119 |
MUS_LOG( "mus: [MUSUI ] CMusUiSendController::\ |
|
120 |
HandleAsyncEventL: EMusUiAsyncInviteCancel" ); |
|
121 |
HandleExitL(); |
|
122 |
break; |
|
123 |
} |
|
124 |
case EMusUiAsyncManualAddressEntry: |
|
125 |
{ |
|
126 |
iResourceHandler->RequestKeypadL( ETrue ); // Exits on fail |
|
127 |
iSendObserver.ManualAddressEntryL( *iRemoteSipAddressProposal ); |
|
128 |
break; |
|
129 |
} |
|
130 |
case EMusUiAsyncStartInvitation: |
|
131 |
{ |
|
132 |
MUS_LOG( "mus: [MUSUI ] CMusUiSendController::\ |
|
133 |
HandleAsyncEventL: EMusUiAsyncStartInvitation" ); |
|
134 |
InviteL(); |
|
135 |
break; |
|
136 |
} |
|
137 |
default: |
|
138 |
{ |
|
139 |
// Not send specific, let the base class handle |
|
140 |
CMusUiEventController::HandleAsyncEventL( aEventId ); |
|
141 |
} |
|
142 |
} |
|
143 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::HandleAsyncEventL" ); |
|
144 |
||
145 |
} |
|
146 |
||
147 |
||
148 |
// ----------------------------------------------------------------------------- |
|
149 |
// |
|
150 |
// ----------------------------------------------------------------------------- |
|
151 |
// |
|
152 |
const TDesC& CMusUiSendController::TypedAddress() const |
|
153 |
{ |
|
154 |
return *iAddress; |
|
155 |
} |
|
156 |
||
157 |
||
158 |
// ----------------------------------------------------------------------------- |
|
159 |
// |
|
160 |
// ----------------------------------------------------------------------------- |
|
161 |
// |
|
162 |
TBool CMusUiSendController::ManualAddressTyped() const |
|
163 |
{ |
|
164 |
return iManualAddressTyped; |
|
165 |
} |
|
166 |
||
167 |
||
168 |
// ----------------------------------------------------------------------------- |
|
169 |
// |
|
170 |
// ----------------------------------------------------------------------------- |
|
171 |
// |
|
172 |
void CMusUiSendController::StartInvitationL() |
|
173 |
{ |
|
174 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::StartInvitationL" ); |
|
175 |
||
176 |
iCallbackService->AsyncEventL( EMusUiAsyncStartInvitation ); |
|
177 |
||
178 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::StartInvitationL" ); |
|
179 |
} |
|
180 |
||
181 |
||
182 |
// ----------------------------------------------------------------------------- |
|
183 |
// |
|
184 |
// ----------------------------------------------------------------------------- |
|
185 |
// |
|
186 |
void CMusUiSendController::InviteL() |
|
187 |
{ |
|
188 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::InviteL" ); |
|
189 |
||
190 |
if ( !iSipRegistrationPending ) |
|
191 |
{ |
|
192 |
TRAPD( error, |
|
193 |
iRemoteSipAddress = CMusUiPropertyWatch::ReadDescPropertyL( |
|
194 |
KRemoteSipAddress ) ); |
|
195 |
if ( error != KErrNone ) |
|
196 |
{ |
|
197 |
iRemoteSipAddress = KNullDesC().AllocL(); |
|
198 |
} |
|
199 |
||
200 |
TRAP( error, iRemoteSipAddressProposal = |
|
201 |
CMusUiPropertyWatch::ReadDescPropertyL( |
|
202 |
KRemoteSipAddressProposal ) ); |
|
203 |
if ( error != KErrNone ) |
|
204 |
{ |
|
205 |
iRemoteSipAddressProposal = KNullDesC().AllocL(); |
|
206 |
} |
|
207 |
||
208 |
if ( iRemoteSipAddress->Length() > 0 ) |
|
209 |
{ |
|
210 |
if ( iRemoteSipAddress->Find( KMusCommaSymbol ) == KErrNotFound ) |
|
211 |
{ |
|
212 |
InviteL( *iRemoteSipAddress ); |
|
213 |
} |
|
214 |
else |
|
215 |
{ |
|
216 |
// Split the addresses using KMusCommaSymbol as a separator |
|
217 |
CDesCArray* addressArray = |
|
218 |
new ( ELeave ) CDesCArrayFlat( |
|
219 |
KMusSipAddressesMaxAmount ); |
|
220 |
SplitL( *iRemoteSipAddress, KMusCommaSymbol, addressArray ); |
|
221 |
// Show List Query Dialog |
|
222 |
TBuf<KMusSipAddressMaxLength> selectedAddress; |
|
223 |
if ( MusUiDialogUtil::SelectAddressDialogL( addressArray, |
|
224 |
selectedAddress ) ) |
|
225 |
{ |
|
226 |
// Invite with the chosen address |
|
227 |
InviteL( selectedAddress ); |
|
228 |
} |
|
229 |
else |
|
230 |
{ |
|
231 |
HandleExitL(); |
|
232 |
} |
|
233 |
} |
|
234 |
} |
|
235 |
else |
|
236 |
{ |
|
237 |
iResourceHandler->RequestKeypadL( ETrue ); // Exits on failure |
|
238 |
iManualAddressTyped = ETrue; |
|
239 |
iSendObserver.ManualAddressEntryL( *iRemoteSipAddressProposal ); |
|
240 |
} |
|
241 |
} |
|
242 |
else |
|
243 |
{ |
|
244 |
// Show waiting dialog |
|
245 |
delete iDialogPrompt; |
|
246 |
iDialogPrompt = NULL; |
|
247 |
iDialogPrompt = StringLoader::LoadL( |
|
248 |
R_MUS_REGISTRATION_PENDING_WAIT_NOTE_TXT ); |
|
249 |
||
250 |
if ( !iSharingObserver.ShowWaitDialogL( |
|
251 |
*iDialogPrompt, |
|
252 |
KMusInviteExpireTimeout, //Reuse 1 min timer |
|
253 |
R_MUS_LIVE_SHARING_VIEW_NOTE_NO_REG ) ) |
|
254 |
{ |
|
255 |
iEventObserver.HandleExit(); |
|
256 |
} |
|
257 |
||
258 |
} |
|
259 |
||
260 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::InviteL" ); |
|
261 |
} |
|
262 |
||
263 |
||
264 |
// ----------------------------------------------------------------------------- |
|
265 |
// |
|
266 |
// ----------------------------------------------------------------------------- |
|
267 |
// |
|
268 |
void CMusUiSendController::CancelInvitationL() |
|
269 |
{ |
|
270 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::CancelInvitationL" ); |
|
271 |
||
272 |
if ( EngineOutSession() && !ConnectionEstablished() ) |
|
273 |
{ |
|
274 |
TRAP_IGNORE( EngineOutSession()->CancelInviteL() ); |
|
275 |
} |
|
276 |
||
277 |
HandleExitL(); |
|
278 |
||
279 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::CancelInvitationL" ); |
|
280 |
} |
|
281 |
||
282 |
||
283 |
// ----------------------------------------------------------------------------- |
|
284 |
// |
|
285 |
// ----------------------------------------------------------------------------- |
|
286 |
// |
|
287 |
void CMusUiSendController::HandleForegroundEventL( TBool aForeground ) |
|
288 |
{ |
|
289 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::HandleForegroundEventL" ); |
|
290 |
||
291 |
CMusUiEventController::HandleForegroundEventL( aForeground ); |
|
292 |
||
293 |
if ( ConnectionEstablished() && !ExitOccured() ) |
|
294 |
{ |
|
295 |
if ( aForeground ) |
|
296 |
{ |
|
297 |
if ( iContinuePlayingWhenForeground ) |
|
298 |
{ |
|
299 |
MUS_LOG( "mus: [MUSUI ] Resume playing" ); |
|
300 |
PlayL(); |
|
301 |
} |
|
302 |
} |
|
303 |
else |
|
304 |
{ |
|
305 |
MUS_LOG( "mus: [MUSUI ] Pause playing" ); |
|
306 |
if ( EngineOutSession() ) |
|
307 |
{ |
|
308 |
iContinuePlayingWhenForeground = IsPlayingL(); |
|
309 |
} |
|
310 |
PauseL(); |
|
311 |
} |
|
312 |
} |
|
313 |
||
314 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::HandleForegroundEventL" ); |
|
315 |
} |
|
316 |
||
317 |
||
318 |
// ----------------------------------------------------------------------------- |
|
319 |
// |
|
320 |
// ----------------------------------------------------------------------------- |
|
321 |
// |
|
322 |
void CMusUiSendController::PlayL() |
|
323 |
{ |
|
324 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::PlayL" ); |
|
325 |
if ( EngineOutSession() ) |
|
326 |
{ |
|
327 |
EngineOutSession()->PlayL(); |
|
328 |
} |
|
329 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::PlayL" ); |
|
330 |
} |
|
331 |
||
332 |
||
333 |
// ----------------------------------------------------------------------------- |
|
334 |
// |
|
335 |
// ----------------------------------------------------------------------------- |
|
336 |
// |
|
337 |
void CMusUiSendController::PauseL() |
|
338 |
{ |
|
339 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::PauseL" ); |
|
340 |
if ( EngineOutSession() ) |
|
341 |
{ |
|
342 |
EngineOutSession()->PauseL(); |
|
343 |
} |
|
344 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::PauseL" ); |
|
345 |
} |
|
346 |
||
347 |
||
348 |
// ----------------------------------------------------------------------------- |
|
349 |
// |
|
350 |
// ----------------------------------------------------------------------------- |
|
351 |
// |
|
352 |
TBool CMusUiSendController::IsPlayingL() |
|
353 |
{ |
|
354 |
TBool isPlaying( EFalse ); |
|
355 |
||
356 |
if ( EngineOutSession() ) |
|
357 |
{ |
|
358 |
isPlaying = EngineOutSession()->IsPlayingL(); |
|
359 |
} |
|
360 |
||
361 |
return isPlaying; |
|
362 |
} |
|
363 |
||
364 |
||
365 |
// ----------------------------------------------------------------------------- |
|
366 |
// |
|
367 |
// ----------------------------------------------------------------------------- |
|
368 |
// |
|
369 |
void CMusUiSendController::SessionEstablished() |
|
370 |
{ |
|
371 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionEstablished" ); |
|
372 |
||
373 |
// Common handling first |
|
374 |
CMusUiEventController::SessionEstablished(); |
|
375 |
||
376 |
iConnectionEstablished = ETrue; |
|
377 |
DismissWaitDialog(); |
|
378 |
||
379 |
if ( iForeground ) |
|
380 |
{ |
|
381 |
MUS_LOG( "mus: [MUSUI ] Enable display and start playing" ); |
|
382 |
TRAP_IGNORE( PlayL(); |
|
383 |
EnableDisplayL( ETrue ); ) |
|
384 |
||
385 |
iEventObserver.SetToolbarVisibility( ETrue ); |
|
386 |
||
387 |
} |
|
388 |
else |
|
389 |
{ |
|
390 |
MUS_LOG( "mus: [MUSUI ] In background, don't start playing yet" ); |
|
391 |
iContinuePlayingWhenForeground = ETrue; |
|
392 |
} |
|
393 |
||
394 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionEstablished" ); |
|
395 |
} |
|
396 |
||
397 |
||
398 |
// ----------------------------------------------------------------------------- |
|
399 |
// |
|
400 |
// ----------------------------------------------------------------------------- |
|
401 |
// |
|
402 |
void CMusUiSendController::SessionRejected() |
|
403 |
{ |
|
404 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionRejected" ); |
|
405 |
DismissWaitDialog(); |
|
38
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
406 |
|
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
407 |
delete iDialogPrompt; |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
408 |
iDialogPrompt = NULL; |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
409 |
|
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
410 |
TRAP_IGNORE ( iDialogPrompt = StringLoader::LoadL( |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
411 |
R_MUS_LIVE_SHARING_VIEW_NOTE_CONNECTION_REJECTED ) ); |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
412 |
|
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
413 |
if ( iDialogPrompt->Find( KMusUSign ) >= KErrNone ) |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
414 |
{ |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
415 |
delete iDialogPrompt; |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
416 |
iDialogPrompt = NULL; |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
417 |
TRAP_IGNORE ( iDialogPrompt = StringLoader::LoadL( |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
418 |
R_MUS_LIVE_SHARING_VIEW_NOTE_CONNECTION_REJECTED, |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
419 |
MusTelNumberValue() ) ); |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
420 |
} |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
421 |
else |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
422 |
{ |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
423 |
// NOP |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
424 |
} |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
425 |
|
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
426 |
if ( iDialogPrompt ) |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
427 |
{ |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
428 |
TRAP_IGNORE ( |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
429 |
MusUiDialogUtil::ShowInformationDialogL( *iDialogPrompt ) ); |
ac48f0cc9f9c
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
430 |
} |
33 | 431 |
|
432 |
TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); |
|
433 |
||
434 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionRejected" ); |
|
435 |
} |
|
436 |
||
437 |
||
438 |
// ----------------------------------------------------------------------------- |
|
439 |
// |
|
440 |
// ----------------------------------------------------------------------------- |
|
441 |
// |
|
442 |
void CMusUiSendController::SessionBadRequest() |
|
443 |
{ |
|
444 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionBadRequest" ); |
|
445 |
||
446 |
DismissWaitDialog(); |
|
447 |
TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); |
|
448 |
||
449 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionBadRequest" ); |
|
450 |
} |
|
451 |
||
452 |
||
453 |
// ----------------------------------------------------------------------------- |
|
454 |
// |
|
455 |
// ----------------------------------------------------------------------------- |
|
456 |
// |
|
457 |
void CMusUiSendController::SessionUnauthorized() |
|
458 |
{ |
|
459 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionUnauthorized" ); |
|
460 |
||
461 |
DismissWaitDialog(); |
|
462 |
TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); |
|
463 |
||
464 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionUnauthorized" ); |
|
465 |
} |
|
466 |
||
467 |
||
468 |
// ----------------------------------------------------------------------------- |
|
469 |
// |
|
470 |
// ----------------------------------------------------------------------------- |
|
471 |
// |
|
472 |
void CMusUiSendController::SessionPaymentRequired() |
|
473 |
{ |
|
474 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionPaymentRequired" ); |
|
475 |
||
476 |
DismissWaitDialog(); |
|
477 |
TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); |
|
478 |
||
479 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionPaymentRequired" ); |
|
480 |
} |
|
481 |
||
482 |
// ----------------------------------------------------------------------------- |
|
483 |
// |
|
484 |
// ----------------------------------------------------------------------------- |
|
485 |
// |
|
486 |
void CMusUiSendController::SessionRecipientNotFound() |
|
487 |
{ |
|
488 |
MUS_LOG1( "mus: [MUSUI ] -> CMusUiSendController::SessionRecipientNotFound [%d]", |
|
489 |
iTriedInvitations ); |
|
490 |
DismissWaitDialog(); |
|
491 |
if ( ExitOccured() ) |
|
492 |
{ |
|
493 |
return; |
|
494 |
} |
|
495 |
if ( ++iTriedInvitations > 1 ) |
|
496 |
{ |
|
497 |
TRAP_IGNORE( MusUiDialogUtil::ShowInformationDialogL( |
|
498 |
R_MUS_LIVE_SHARING_VIEW_NOTE_WRONG_ADDRESS ) ); |
|
499 |
||
500 |
TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncInviteCancel ) ); |
|
501 |
||
502 |
} |
|
503 |
else |
|
504 |
{ |
|
505 |
TRAP_IGNORE( MusUiDialogUtil::ShowInformationDialogL( |
|
506 |
R_MUS_LIVE_SHARING_VIEW_NOTE_WRONG_ADDRESS ) ); |
|
507 |
iManualAddressTyped = ETrue; |
|
508 |
||
509 |
TRAP_IGNORE( |
|
510 |
iCallbackService->AsyncEventL( EMusUiAsyncManualAddressEntry ) ); |
|
511 |
||
512 |
} |
|
513 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionRecipientNotFound" ); |
|
514 |
} |
|
515 |
||
516 |
||
517 |
// ----------------------------------------------------------------------------- |
|
518 |
// |
|
519 |
// ----------------------------------------------------------------------------- |
|
520 |
// |
|
521 |
void CMusUiSendController::SessionProxyAuthenticationRequired() |
|
522 |
{ |
|
523 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionProxyAuthenticationRequired" ); |
|
524 |
||
525 |
DismissWaitDialog(); |
|
526 |
TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); |
|
527 |
||
528 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionProxyAuthenticationRequired" ); |
|
529 |
} |
|
530 |
||
531 |
||
532 |
// ----------------------------------------------------------------------------- |
|
533 |
// |
|
534 |
// ----------------------------------------------------------------------------- |
|
535 |
// |
|
536 |
void CMusUiSendController::SessionRequestTimeOut() |
|
537 |
{ |
|
538 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionRequestTimeOut" ); |
|
539 |
DismissWaitDialog(); |
|
540 |
TRAP_IGNORE( MusUiDialogUtil::ShowInformationDialogL( |
|
541 |
R_MUS_LIVE_SHARING_VIEW_NOTE_NO_RESPONSE ) ); |
|
542 |
||
543 |
TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); |
|
544 |
||
545 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionRequestTimeOut" ); |
|
546 |
} |
|
547 |
||
548 |
||
549 |
// ----------------------------------------------------------------------------- |
|
550 |
// |
|
551 |
// ----------------------------------------------------------------------------- |
|
552 |
// |
|
553 |
void CMusUiSendController::SessionUnsupportedMediaType() |
|
554 |
{ |
|
555 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionUnsupportedMediaType" ); |
|
556 |
DismissWaitDialog(); |
|
557 |
if ( !ExitOccured() ) |
|
558 |
{ |
|
559 |
TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( |
|
560 |
R_MUS_LIVE_SHARING_VIEW_NOTE_APP_N_A ) ); |
|
561 |
} |
|
562 |
||
563 |
TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); |
|
564 |
||
565 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionUnsupportedMediaType" ); |
|
566 |
} |
|
567 |
||
568 |
||
569 |
// ----------------------------------------------------------------------------- |
|
570 |
// |
|
571 |
// ----------------------------------------------------------------------------- |
|
572 |
// |
|
573 |
void CMusUiSendController::SessionBusyHere() |
|
574 |
{ |
|
575 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionBusyHere" ); |
|
576 |
DismissWaitDialog(); |
|
577 |
TRAP_IGNORE( |
|
578 |
MusUiDialogUtil::ShowInformationDialogL( |
|
579 |
R_MUS_LIVE_SHARING_VIEW_NOTE_RECIPIENT_N_A ) ); |
|
580 |
||
581 |
TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); |
|
582 |
||
583 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionBusyHere" ); |
|
584 |
} |
|
585 |
||
586 |
||
587 |
// ----------------------------------------------------------------------------- |
|
588 |
// |
|
589 |
// ----------------------------------------------------------------------------- |
|
590 |
// |
|
591 |
void CMusUiSendController::SessionRequestCancelled() |
|
592 |
{ |
|
593 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionRequestCancelled" ); |
|
594 |
DismissWaitDialog(); |
|
595 |
TRAP_IGNORE( |
|
596 |
MusUiDialogUtil::ShowInformationDialogL( |
|
597 |
R_MUS_LIVE_SHARING_VIEW_NOTE_INVITATION_CANCELLED ) ); |
|
598 |
||
599 |
TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); |
|
600 |
||
601 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionRequestCancelled" ); |
|
602 |
} |
|
603 |
||
604 |
||
605 |
// ----------------------------------------------------------------------------- |
|
606 |
// |
|
607 |
// ----------------------------------------------------------------------------- |
|
608 |
// |
|
609 |
void CMusUiSendController::SessionTemporarilyNotAvailable() |
|
610 |
{ |
|
611 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SessionRequestCancelled" ); |
|
612 |
DismissWaitDialog(); |
|
613 |
if ( !ExitOccured() ) |
|
614 |
{ |
|
615 |
TRAP_IGNORE( MusUiDialogUtil::ShowGlobalErrorDialogL( |
|
616 |
R_MUS_LIVE_SHARING_VIEW_NOTE_SERVICE_N_A ) ); |
|
617 |
} |
|
618 |
||
619 |
TRAP_IGNORE( iCallbackService->AsyncEventL( EMusUiAsyncHandleExit ) ); |
|
620 |
||
621 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::SessionRequestCancelled" ); |
|
622 |
} |
|
623 |
||
624 |
||
625 |
// ----------------------------------------------------------------------------- |
|
626 |
// |
|
627 |
// ----------------------------------------------------------------------------- |
|
628 |
// |
|
629 |
void CMusUiSendController::ConstructL() |
|
630 |
{ |
|
631 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::ConstructL" ); |
|
632 |
||
633 |
CMusUiEventController::ConstructL(); // Base class construction |
|
634 |
iLocalizer = CDirectoryLocalizer::NewL(); |
|
635 |
||
636 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::ConstructL" ); |
|
637 |
} |
|
638 |
||
639 |
||
640 |
// ----------------------------------------------------------------------------- |
|
641 |
// |
|
642 |
// ----------------------------------------------------------------------------- |
|
643 |
// |
|
644 |
CMusUiSendController::CMusUiSendController( |
|
645 |
MMusUiEventObserver& aEventObserver, |
|
646 |
MMusUiSharingObserver& aSharingObserver, |
|
647 |
MMusUiSendObserver& aSendObserver ) |
|
648 |
: CMusUiEventController( aEventObserver, aSharingObserver ), |
|
649 |
iSendObserver( aSendObserver ), |
|
650 |
iTriedInvitations( 0 ), |
|
651 |
iContinuePlayingWhenForeground( ETrue ), |
|
652 |
iWaitDialogCallback( *this ) |
|
653 |
{ |
|
654 |
||
655 |
} |
|
656 |
||
657 |
||
658 |
// ----------------------------------------------------------------------------- |
|
659 |
// |
|
660 |
// ----------------------------------------------------------------------------- |
|
661 |
// |
|
662 |
void CMusUiSendController::ExitProcedureL( TBool aUserAcceptance ) |
|
663 |
{ |
|
664 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::ExitProcedureL" ); |
|
665 |
||
666 |
DismissWaitDialog(); |
|
35
6c57ef9392d2
Revision: 201032
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
667 |
iEventObserver.SetExitingFlag(); |
33 | 668 |
switch ( iShutdownState ) |
669 |
{ |
|
670 |
case EMusUiShutdownStarted: |
|
671 |
{ |
|
672 |
MUS_LOG( "mus: [MUSUI ] ExitProcedureL: EMusuiShutdownStarted" ); |
|
673 |
||
674 |
if ( iVideoToBeSaved && |
|
675 |
iVideoFileName && |
|
676 |
MusUiFileUtil::FileExists( *iVideoFileName ) ) |
|
677 |
{ |
|
678 |
iShutdownState = EMusUiShutdownVideoSaved; |
|
679 |
ShowVideoSavedDialogL(); |
|
680 |
ExitProcedureL( ETrue ); // Accept saving |
|
681 |
} |
|
682 |
else |
|
683 |
{ |
|
684 |
CMusUiEventController::ExitProcedureL( aUserAcceptance ); |
|
685 |
} |
|
686 |
break; |
|
687 |
} |
|
688 |
||
689 |
case EMusUiShutdownVideoSaved: |
|
690 |
{ |
|
691 |
MUS_LOG( "mus: [MUSUI ] ExitProcedureL: EMusuiShutdownVideoSaved" ); |
|
692 |
||
693 |
// Check if our address is valid sip or tel uri. If not, there is no |
|
694 |
// point to query user about permission to save it to contacts. |
|
695 |
||
696 |
TInt error = KErrNotFound; |
|
697 |
if ( iAddress ) |
|
698 |
{ |
|
699 |
TMusEngUriParser parser( *iAddress ); |
|
700 |
TRAP( error, parser.ParseUriL() ) |
|
701 |
} |
|
702 |
||
703 |
// Save Address to Contacts query if manually entered |
|
704 |
// and if is the standard variant. |
|
705 |
// NOTE: KErrNotSupported means there is more than one contact id. |
|
706 |
if ( !iOperatorSpecificFunctionality && ManualAddressTyped() && |
|
707 |
iContactId != KErrNotSupported && |
|
708 |
error == KErrNone ) |
|
709 |
{ |
|
710 |
iShutdownState = EMusUiShutdownContactSavingQueried; |
|
711 |
SaveContactQueryL(); |
|
712 |
} |
|
713 |
else |
|
714 |
{ |
|
715 |
// Nothing send specific, let the base class handle |
|
716 |
CMusUiEventController::ExitProcedureL( aUserAcceptance ); |
|
717 |
} |
|
718 |
break; |
|
719 |
} |
|
720 |
||
721 |
default: |
|
722 |
{ |
|
723 |
// Nothing send specific, let the base class handle |
|
724 |
CMusUiEventController::ExitProcedureL( aUserAcceptance ); |
|
725 |
break; |
|
726 |
} |
|
727 |
} |
|
728 |
||
729 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::ExitProcedureL" ); |
|
730 |
} |
|
731 |
||
732 |
||
733 |
// ----------------------------------------------------------------------------- |
|
734 |
// Handles status changes specific to sending sharing types. |
|
735 |
// Calls base class version for status changes that are not sending specific. |
|
736 |
// ----------------------------------------------------------------------------- |
|
737 |
// |
|
738 |
void CMusUiSendController::HandleChangedStatusL( |
|
739 |
TMusAvailabilityStatus aStatus ) |
|
740 |
{ |
|
741 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::HandleChangedStatusL" ) |
|
742 |
switch( aStatus ) |
|
743 |
{ |
|
744 |
case ESipRegistrationPending: |
|
745 |
{ |
|
746 |
MUS_LOG( "mus: [MUSUI ] ESipRegistrationPending" ); |
|
747 |
iSipRegistrationPending = ETrue; |
|
748 |
break; |
|
749 |
} |
|
750 |
case ESipOptionsNotSent: // FALLTHROUGH |
|
751 |
case ESipOptionsSent: // FALLTHROUGH |
|
752 |
{ |
|
753 |
break; |
|
754 |
} |
|
755 |
case EManualActivation: // FALLTHROUGH |
|
756 |
case EMultimediaSharingAvailable: |
|
757 |
{ |
|
758 |
MUS_LOG( "mus: [MUSUI ] EManualActivation or EMultimediaSharingAvailable" ) |
|
759 |
||
760 |
if( iSipRegistrationPending ) |
|
761 |
{ |
|
762 |
iSipRegistrationPending = EFalse; |
|
763 |
// Set callback service, Call StartInvitationL when wait dialog dismissed |
|
764 |
TRAPD( err, iSharingObserver.SetWaitDialogCallbackL( |
|
765 |
&iWaitDialogCallback ) ); |
|
766 |
// Dismiss pending wait note |
|
767 |
iSharingObserver.DismissWaitDialogL(); |
|
768 |
if ( err == KErrNotReady ) |
|
769 |
{ |
|
770 |
StartInvitationL(); |
|
771 |
} |
|
772 |
} |
|
773 |
break; |
|
774 |
} |
|
775 |
||
776 |
default: |
|
777 |
{ |
|
778 |
// Not sending specific, let the base class handle |
|
779 |
CMusUiEventController::HandleChangedStatusL( aStatus ); |
|
780 |
break; |
|
781 |
} |
|
782 |
} |
|
783 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::HandleChangedStatusL" ) |
|
784 |
} |
|
785 |
||
786 |
||
787 |
// ----------------------------------------------------------------------------- |
|
788 |
// |
|
789 |
// ----------------------------------------------------------------------------- |
|
790 |
// |
|
791 |
const TDesC& CMusUiSendController::VideoFileNameL() |
|
792 |
{ |
|
793 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::VideoFileNameL" ); |
|
794 |
||
795 |
TParse parse; |
|
796 |
TPtrC rootPath; |
|
797 |
||
798 |
SetVideoPathValueL();//sets video rootpath according to setting value. |
|
799 |
||
800 |
if ( parse.Set( iVideoFilePath,NULL,NULL) != KErrBadName ) |
|
801 |
{ |
|
802 |
||
803 |
if(parse.Drive().Compare( PathInfo::MemoryCardRootPath())) |
|
804 |
{ |
|
805 |
TRAPD(error,MusUiFileUtil::VideoFilePathExistsL(iVideoFilePath)); |
|
806 |
||
807 |
switch(error) |
|
808 |
{ |
|
809 |
case KErrNotReady: |
|
810 |
case KErrCorrupt: |
|
811 |
case KErrLocked: |
|
812 |
{ |
|
813 |
MusUiDialogUtil::ShowGlobalInformationDialogL( |
|
814 |
R_MUS_VIEW_NOTE_MEMORYCARD_PROBLEM); |
|
815 |
||
816 |
MUS_LOG( "mus: [MUSUI ] -> Changing to Phone Memory " ); |
|
817 |
rootPath.Set(PathInfo::PhoneMemoryRootPath()); |
|
818 |
TParsePtrC pathPtr(rootPath); |
|
819 |
iVideoFilePath = rootPath; |
|
820 |
iVideoFilePath += PathInfo::VideosPath(); |
|
821 |
// Make sure the new path exists |
|
822 |
TRAP_IGNORE( MusUiFileUtil::VideoFilePathExistsL(iVideoFilePath) ) |
|
823 |
break; |
|
824 |
} |
|
825 |
case KErrAlreadyExists: |
|
826 |
case KErrNone: |
|
827 |
{ |
|
828 |
MUS_LOG( "mus: [MUSUI ] -> Using MMC " ); |
|
829 |
rootPath.Set(PathInfo::MemoryCardRootPath()); |
|
830 |
break; |
|
831 |
} |
|
832 |
default: |
|
833 |
{ |
|
834 |
delete iVideoFileName; |
|
835 |
iVideoFileNamePlain = KNullDesC; |
|
836 |
iVideoFileName = iVideoFileNamePlain.AllocL(); |
|
837 |
HandleError( error); |
|
838 |
break; |
|
839 |
} |
|
840 |
} |
|
841 |
} |
|
842 |
else//Phone memory is being used. |
|
843 |
{ |
|
844 |
TRAPD(error,MusUiFileUtil::VideoFilePathExistsL(iVideoFilePath)); |
|
845 |
||
846 |
switch(error) |
|
847 |
{ |
|
848 |
case KErrAlreadyExists: |
|
849 |
case KErrNone: |
|
850 |
{ |
|
851 |
MUS_LOG( "mus: [MUSUI ] -> Using Phone memory" ); |
|
852 |
rootPath.Set(PathInfo::PhoneMemoryRootPath()); |
|
853 |
break; |
|
854 |
} |
|
855 |
default: |
|
856 |
{ |
|
857 |
delete iVideoFileName; |
|
858 |
iVideoFileNamePlain = KNullDesC; |
|
859 |
iVideoFileName = iVideoFileNamePlain.AllocL(); |
|
860 |
HandleError( error); |
|
861 |
break; |
|
862 |
} |
|
863 |
} |
|
864 |
} |
|
865 |
||
866 |
} |
|
867 |
else |
|
868 |
{ |
|
869 |
delete iVideoFileName; |
|
870 |
iVideoFileNamePlain = KNullDesC; |
|
871 |
iVideoFileName = iVideoFileNamePlain.AllocL(); |
|
872 |
HandleError(KErrBadName); |
|
873 |
} |
|
874 |
||
875 |
TParsePtrC pathPtr(rootPath); |
|
876 |
iVideoFilePath += pathPtr.NameAndExt(); |
|
877 |
MusUiFileUtil::CreateVideoFileNameL(iVideoFilePath, |
|
878 |
iVideoFileNamePlain); |
|
879 |
||
880 |
delete iVideoFileName; |
|
881 |
TFileName videoFileName; |
|
882 |
videoFileName += iVideoFilePath; |
|
883 |
videoFileName += iVideoFileNamePlain; |
|
884 |
videoFileName += KMusVideoFileNameExtension; |
|
885 |
iVideoFileName = videoFileName.AllocL(); |
|
886 |
||
887 |
MUS_LOG_TDESC( "mus: [MUSUI ] <- CMusUiSendController::VideoFileNameL:", |
|
888 |
iVideoFileName->Des() ); |
|
889 |
return *iVideoFileName; |
|
890 |
} |
|
891 |
||
892 |
||
893 |
// ----------------------------------------------------------------------------- |
|
894 |
// |
|
895 |
// ----------------------------------------------------------------------------- |
|
896 |
// |
|
897 |
void CMusUiSendController::ShowInvitingWaitDialogL() |
|
898 |
{ |
|
899 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::ShowWaitDialogL" ); |
|
900 |
delete iDialogPrompt; |
|
901 |
iDialogPrompt = NULL; |
|
902 |
iDialogPrompt = StringLoader::LoadL( |
|
903 |
R_MUS_LIVE_SHARING_VIEW_INVITING_WAIT_NOTE_TXT, |
|
904 |
MusContactName().Length() > 0 ? |
|
905 |
MusContactName() : iOperatorSpecificFunctionality ? |
|
906 |
MusTelNumberValue() : *iAddress ); |
|
907 |
||
908 |
if ( !iSharingObserver.ShowWaitDialogL( |
|
909 |
*iDialogPrompt, |
|
910 |
KMusInviteExpireTimeout, |
|
911 |
R_MUS_LIVE_SHARING_VIEW_NOTE_NO_RESPONSE ) ) |
|
912 |
{ |
|
913 |
CancelInvitationL(); |
|
914 |
} |
|
915 |
||
916 |
||
917 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::ShowWaitDialogL" ); |
|
918 |
} |
|
919 |
||
920 |
||
921 |
// ----------------------------------------------------------------------------- |
|
922 |
// |
|
923 |
// ----------------------------------------------------------------------------- |
|
924 |
// |
|
925 |
void CMusUiSendController::DismissWaitDialog() |
|
926 |
{ |
|
927 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::DismissWaitDialog" ); |
|
928 |
TRAPD( err, iSharingObserver.DismissWaitDialogL(); ); |
|
929 |
if ( err != KErrNone ) |
|
930 |
{ |
|
931 |
HandleError( err ); |
|
932 |
} |
|
933 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::DismissWaitDialog" ); |
|
934 |
} |
|
935 |
||
936 |
||
937 |
// ----------------------------------------------------------------------------- |
|
938 |
// |
|
939 |
// ----------------------------------------------------------------------------- |
|
940 |
// |
|
941 |
void CMusUiSendController::SplitL( const TDesC& aDes, |
|
942 |
const TDesC& aChar, |
|
943 |
CDesCArray* aArray ) |
|
944 |
{ |
|
945 |
TInt charPos( 0 ); |
|
946 |
TPtrC ptr( aDes ); |
|
947 |
TBool found = EFalse; |
|
948 |
while( ( charPos = ptr.Find( aChar ) ) > 0 ) |
|
949 |
{ |
|
950 |
found = ETrue; |
|
951 |
TPtrC str = ptr.Left( charPos ); |
|
952 |
aArray->AppendL( str ); |
|
953 |
ptr.Set( ptr.Right( ptr.Length() - str.Length() - 1 ) ); |
|
954 |
} |
|
955 |
if ( found && ptr.Length() > 0 ) |
|
956 |
{ |
|
957 |
aArray->AppendL( ptr ); |
|
958 |
} |
|
959 |
} |
|
960 |
||
961 |
||
962 |
// ----------------------------------------------------------------------------- |
|
963 |
// |
|
964 |
// ----------------------------------------------------------------------------- |
|
965 |
// |
|
966 |
void CMusUiSendController::SetVideoPathValueL() |
|
967 |
{ |
|
968 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::SetVideoPathValueL" ); |
|
969 |
TInt drive = MultimediaSharingSettings::VideoLocationSettingL(); |
|
970 |
||
971 |
TFileName rootPath; |
|
972 |
User::LeaveIfError( PathInfo::GetRootPath( rootPath, drive ) ); |
|
973 |
||
974 |
TParsePtrC pathPtr(rootPath); |
|
975 |
iVideoFilePath = rootPath; |
|
976 |
iVideoFilePath += PathInfo::VideosPath(); |
|
977 |
MUS_LOG_TDESC( "mus: [MUSUI ] <- CMusUiSendController::SetVideoPathValueL: ", |
|
978 |
iVideoFilePath ); |
|
979 |
iLocalizer->SetFullPath( iVideoFilePath ); |
|
980 |
if ( iLocalizer->IsLocalized() ) |
|
981 |
{ |
|
982 |
iLocalizedVideoFilePath =iLocalizer->LocalizedName(); |
|
983 |
} |
|
984 |
} |
|
985 |
||
986 |
||
987 |
// ----------------------------------------------------------------------------- |
|
988 |
// |
|
989 |
// ----------------------------------------------------------------------------- |
|
990 |
// |
|
991 |
void CMusUiSendController::ShowVideoSavedDialogL() |
|
992 |
{ |
|
993 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::ShowVideoSavedDialogL" ); |
|
994 |
//MUS_LOG_TDESC( "mus: [MUSUI ] ", iVideoFileNamePlain ); |
|
995 |
//MUS_LOG_TDESC( "mus: [MUSUI ] ", iVideoFilePath ); |
|
996 |
||
997 |
delete iDialogPrompt; |
|
998 |
iDialogPrompt = NULL; |
|
999 |
||
1000 |
TBuf<KMusFileNameMaxLength> buf; |
|
1001 |
TFileName videoFileName; |
|
1002 |
videoFileName += iVideoFileNamePlain; |
|
1003 |
videoFileName += KMusVideoFileNameExtension; |
|
1004 |
buf = videoFileName; |
|
1005 |
||
1006 |
CDesCArrayFlat* savingTextsArray = |
|
1007 |
new ( ELeave ) CDesCArrayFlat( KMusStringSubstArrayGranularity ); |
|
1008 |
CleanupStack::PushL( savingTextsArray ); |
|
1009 |
//"File %0U saved to folder %1U" |
|
1010 |
//%0U = iVideoFileName |
|
1011 |
//%1U = iVideoFilePath |
|
1012 |
savingTextsArray->InsertL( 0, videoFileName ); |
|
1013 |
||
1014 |
if ( MultimediaSharingSettings::OperatorVariantSettingL() == |
|
1015 |
MusSettingsKeys::EOperatorSpecific ) // For AT&T products |
|
1016 |
{ |
|
1017 |
HBufC* folder = StringLoader::LoadLC( R_MUS_VIDEO_SAVE_FOLDER_NAME ); |
|
1018 |
savingTextsArray->InsertL( 1, *folder ); |
|
1019 |
CleanupStack::PopAndDestroy( folder ); |
|
1020 |
} |
|
1021 |
else // Standard products |
|
1022 |
{ |
|
1023 |
if ( iLocalizer->IsLocalized() ) |
|
1024 |
{ |
|
1025 |
savingTextsArray->InsertL( 1, iLocalizedVideoFilePath ); |
|
1026 |
} |
|
1027 |
else |
|
1028 |
{ |
|
1029 |
savingTextsArray->InsertL( 1, iVideoFilePath ); |
|
1030 |
} |
|
1031 |
} |
|
1032 |
||
1033 |
MUS_LOG_TDESC( "mus: [MUSUI ] filename:", savingTextsArray->MdcaPoint( 0 ) ); |
|
1034 |
MUS_LOG_TDESC( "mus: [MUSUI ] path:", savingTextsArray->MdcaPoint( 1 ) ); |
|
1035 |
||
1036 |
iDialogPrompt = StringLoader::LoadL( R_MUS_VIEW_NOTE_VIDEO_SAVED, |
|
1037 |
*savingTextsArray ); |
|
1038 |
CleanupStack::Pop( savingTextsArray ); |
|
1039 |
||
1040 |
MUS_LOG_TDESC( "mus: [MUSUI ] ", iDialogPrompt->Des() ); |
|
1041 |
||
1042 |
MusUiDialogUtil::ShowGlobalInformationDialogL( *iDialogPrompt ); |
|
1043 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::ShowVideoSavedDialogL" ); |
|
1044 |
} |
|
1045 |
||
1046 |
||
1047 |
// ----------------------------------------------------------------------------- |
|
1048 |
// |
|
1049 |
// ----------------------------------------------------------------------------- |
|
1050 |
// |
|
1051 |
void CMusUiSendController::DeleteVideoL() |
|
1052 |
{ |
|
1053 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::DeleteVideoL" ); |
|
1054 |
if ( iVideoFileName ) |
|
1055 |
{ |
|
1056 |
MusUiFileUtil::DeleteFileL( *iVideoFileName ); |
|
1057 |
} |
|
1058 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::DeleteVideoL" ); |
|
1059 |
} |
|
1060 |
||
1061 |
||
1062 |
// ----------------------------------------------------------------------------- |
|
1063 |
// |
|
1064 |
// ----------------------------------------------------------------------------- |
|
1065 |
// |
|
1066 |
void CMusUiSendController::DeleteFileL() |
|
1067 |
{ |
|
1068 |
MUS_LOG( "mus: [MUSUI ] -> CMusUiSendController::DeleteFileL" ); |
|
1069 |
if ( iVideoFileName && |
|
1070 |
MusUiFileUtil::FileExists( *iVideoFileName ) && !iVideoToBeSaved ) |
|
1071 |
{ |
|
1072 |
DeleteVideoL(); |
|
1073 |
} |
|
1074 |
MUS_LOG( "mus: [MUSUI ] <- CMusUiSendController::DeleteFileL" ); |
|
1075 |
} |
|
1076 |
||
1077 |
||
1078 |
||
1079 |
// ----------------------------------------------------------------------------- |
|
1080 |
// |
|
1081 |
// ----------------------------------------------------------------------------- |
|
1082 |
// |
|
1083 |
CMusUiSendController:: |
|
1084 |
TWaitDialogCallback::TWaitDialogCallback( CMusUiSendController& aController ) |
|
1085 |
: iController( aController ) |
|
1086 |
{ |
|
1087 |
} |
|
1088 |
||
1089 |
||
1090 |
// ----------------------------------------------------------------------------- |
|
1091 |
// |
|
1092 |
// ----------------------------------------------------------------------------- |
|
1093 |
// |
|
1094 |
void CMusUiSendController:: |
|
1095 |
TWaitDialogCallback::DialogDismissedL( TInt /*aButtonId*/ ) |
|
1096 |
{ |
|
1097 |
iController.StartInvitationL(); |
|
1098 |
} |
|
1099 |
||
1100 |
// End of file |
|
1101 |