79
|
1 |
/*
|
|
2 |
* Copyright (c) 2006,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: CUniEditorLaunchOperation
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
// ========== INCLUDE FILES ================================
|
|
21 |
|
|
22 |
#include <AknsConstants.h>
|
|
23 |
#include <data_caging_path_literals.hrh>
|
|
24 |
#include <aknlayoutscalable_apps.cdl.h>
|
|
25 |
|
|
26 |
// Features
|
|
27 |
#include <featmgr.h>
|
|
28 |
#include <bldvariant.hrh>
|
|
29 |
#include <centralrepository.h> // link against centralrepository.lib
|
|
30 |
#include <messaginginternalcrkeys.h> // for Central Repository keys
|
|
31 |
|
|
32 |
#include <mmsconst.h>
|
|
33 |
|
|
34 |
#include <MsgEditorView.h> // for CMsgEditorView
|
|
35 |
#include <MsgEditorAppUi.h>
|
|
36 |
#include <MsgEditorCommon.h>
|
|
37 |
#include <msgimagecontrol.h>
|
|
38 |
#include <MuiuMsgEditorLauncher.h>
|
|
39 |
|
|
40 |
#include <msgasynccontrolobserver.h>
|
|
41 |
|
|
42 |
#include <uniutils.mbg>
|
|
43 |
#include <UniEditor.rsg>
|
|
44 |
|
|
45 |
#include "UniPluginApi.h"
|
|
46 |
#include "UniSendingSettings.h"
|
|
47 |
#include <unidatamodel.h>
|
|
48 |
#include <unismilmodel.h>
|
|
49 |
#include <unislideloader.h>
|
|
50 |
#include <unimsventry.h>
|
|
51 |
|
|
52 |
#include "UniEditorDocument.h"
|
|
53 |
#include "UniEditorHeader.h"
|
|
54 |
#include "UniEditorLaunchOperation.h"
|
|
55 |
|
|
56 |
_LIT( KUniEditorMbmFile, "uniutils.mbm" );
|
|
57 |
|
|
58 |
// ========== EXTERNAL DATA STRUCTURES =====================
|
|
59 |
|
|
60 |
// ========== EXTERNAL FUNCTION PROTOTYPES =================
|
|
61 |
|
|
62 |
// ========== CONSTANTS ====================================
|
|
63 |
|
|
64 |
const TInt KMaxSubjectLength = 40; // From MMS Conformance Document
|
|
65 |
|
|
66 |
// ========== MACROS =======================================
|
|
67 |
|
|
68 |
// ========== LOCAL CONSTANTS AND MACROS ===================
|
|
69 |
|
|
70 |
// ========== MODULE DATA STRUCTURES =======================
|
|
71 |
|
|
72 |
// ========== LOCAL FUNCTION PROTOTYPES ====================
|
|
73 |
|
|
74 |
// ========== LOCAL FUNCTIONS ==============================
|
|
75 |
|
|
76 |
// ========== MEMBER FUNCTIONS =============================
|
|
77 |
|
|
78 |
// ---------------------------------------------------------
|
|
79 |
// CUniEditorLaunchOperation::NewL
|
|
80 |
//
|
|
81 |
// Factory method.
|
|
82 |
// ---------------------------------------------------------
|
|
83 |
//
|
|
84 |
CUniEditorLaunchOperation* CUniEditorLaunchOperation::NewL(
|
|
85 |
MMsgAsyncControlObserver& aControlObserver,
|
|
86 |
MUniEditorOperationObserver& aOperationObserver,
|
|
87 |
CUniEditorDocument& aDocument,
|
|
88 |
CMsgEditorView& aView,
|
|
89 |
CMsgEditorAppUi& aAppUi,
|
|
90 |
RFs& aFs )
|
|
91 |
{
|
|
92 |
CUniEditorLaunchOperation* self =
|
|
93 |
new ( ELeave ) CUniEditorLaunchOperation( aControlObserver, aOperationObserver, aDocument, aView, aAppUi, aFs );
|
|
94 |
|
|
95 |
CleanupStack::PushL( self );
|
|
96 |
self->ConstructL();
|
|
97 |
CleanupStack::Pop( self );
|
|
98 |
|
|
99 |
return self;
|
|
100 |
}
|
|
101 |
|
|
102 |
// ---------------------------------------------------------
|
|
103 |
// CUniEditorLaunchOperation::CUniEditorLaunchOperation
|
|
104 |
//
|
|
105 |
// Constructor.
|
|
106 |
// ---------------------------------------------------------
|
|
107 |
//
|
|
108 |
CUniEditorLaunchOperation::CUniEditorLaunchOperation(
|
|
109 |
MMsgAsyncControlObserver& aControlObserver,
|
|
110 |
MUniEditorOperationObserver& aOperationObserver,
|
|
111 |
CUniEditorDocument& aDocument,
|
|
112 |
CMsgEditorView& aView,
|
|
113 |
CMsgEditorAppUi& aAppUi,
|
|
114 |
RFs& aFs ) :
|
|
115 |
CUniEditorOperation( aOperationObserver, aDocument, aFs, EUniEditorOperationLaunch ),
|
|
116 |
iControlObserver( aControlObserver ),
|
|
117 |
iView( aView ),
|
|
118 |
iAppUi( aAppUi ),
|
|
119 |
iOptimizedFlow(EFalse)
|
|
120 |
{
|
|
121 |
}
|
|
122 |
|
|
123 |
// ---------------------------------------------------------
|
|
124 |
// CUniEditorLaunchOperation::ConstructL
|
|
125 |
//
|
|
126 |
// 2nd phase constructor.
|
|
127 |
// ---------------------------------------------------------
|
|
128 |
//
|
|
129 |
void CUniEditorLaunchOperation::ConstructL()
|
|
130 |
{
|
|
131 |
BaseConstructL();
|
|
132 |
FeatureManager::InitializeLibL();
|
|
133 |
iSmilEditorSupported = FeatureManager::FeatureSupported( KFeatureIdSmilEditor );
|
|
134 |
FeatureManager::UnInitializeLib();
|
|
135 |
}
|
|
136 |
|
|
137 |
// ---------------------------------------------------------
|
|
138 |
// CUniEditorLaunchOperation::CUniEditorLaunchOperation
|
|
139 |
//
|
|
140 |
// Destructor.
|
|
141 |
// ---------------------------------------------------------
|
|
142 |
//
|
|
143 |
CUniEditorLaunchOperation::~CUniEditorLaunchOperation()
|
|
144 |
{
|
|
145 |
Cancel();
|
|
146 |
delete iSendUiOperation;
|
|
147 |
delete iHeader;
|
|
148 |
delete iSlideLoader;
|
|
149 |
|
|
150 |
#ifdef RD_MSG_XHTML_SUPPORT
|
|
151 |
delete iTextOperation;
|
|
152 |
#endif
|
|
153 |
}
|
|
154 |
|
|
155 |
// ---------------------------------------------------------
|
|
156 |
// CUniEditorLaunchOperation::Launch
|
|
157 |
// ---------------------------------------------------------
|
|
158 |
//
|
|
159 |
void CUniEditorLaunchOperation::Launch()
|
|
160 |
{
|
|
161 |
iParseResultTemp= 0;
|
|
162 |
ResetErrors();
|
|
163 |
iOperationState = EUniLaunchInitializeDoc;
|
|
164 |
CompleteSelf( KErrNone );
|
|
165 |
}
|
|
166 |
|
|
167 |
// ---------------------------------------------------------
|
|
168 |
// CUniEditorLaunchOperation::DoLaunchStepL
|
|
169 |
// ---------------------------------------------------------
|
|
170 |
//
|
|
171 |
void CUniEditorLaunchOperation::DoLaunchStepL()
|
|
172 |
{
|
|
173 |
switch ( iOperationState )
|
|
174 |
{
|
|
175 |
case EUniLaunchInitializeDoc:
|
|
176 |
{
|
|
177 |
DoInitializeDocL();
|
|
178 |
break;
|
|
179 |
}
|
|
180 |
case EUniLaunchInitializeModel:
|
|
181 |
{
|
|
182 |
DoInitializeModelL();
|
|
183 |
break;
|
|
184 |
}
|
|
185 |
case EUniLaunchHandleMessage:
|
|
186 |
{
|
|
187 |
DoHandleMessageL();
|
|
188 |
break;
|
|
189 |
}
|
|
190 |
case EUniLaunchPrepareHeader:
|
|
191 |
{
|
|
192 |
DoPrepareHeaderL();
|
|
193 |
break;
|
|
194 |
}
|
|
195 |
case EUniLaunchPrepareBody:
|
|
196 |
{
|
|
197 |
DoPrepareBodyL();
|
|
198 |
break;
|
|
199 |
}
|
|
200 |
case EUniLaunchEnd:
|
|
201 |
{
|
|
202 |
iObserver.EditorOperationEvent(
|
|
203 |
EUniEditorOperationLaunch,
|
|
204 |
EUniEditorOperationComplete );
|
|
205 |
break;
|
|
206 |
}
|
|
207 |
default:
|
|
208 |
iObserver.EditorOperationEvent(
|
|
209 |
EUniEditorOperationLaunch,
|
|
210 |
EUniEditorOperationError );
|
|
211 |
break;
|
|
212 |
}
|
|
213 |
|
|
214 |
iOperationState++;
|
|
215 |
}
|
|
216 |
|
|
217 |
// ---------------------------------------------------------
|
|
218 |
// CUniEditorLaunchOperation::DoInitializeDocL
|
|
219 |
// ---------------------------------------------------------
|
|
220 |
//
|
|
221 |
void CUniEditorLaunchOperation::DoInitializeDocL()
|
|
222 |
{
|
|
223 |
TUniMessageCharSetSupport charSet = EUniMessageCharSetFull;
|
|
224 |
|
|
225 |
iDocument.LaunchPlugings();
|
|
226 |
|
|
227 |
CMsvStore* readStore = NULL;
|
|
228 |
if ( iDocument.Mtm().Entry().HasStoreL() )
|
|
229 |
{
|
|
230 |
readStore = iDocument.Mtm().Entry().ReadStoreL();
|
|
231 |
}
|
|
232 |
CleanupStack::PushL( readStore );
|
|
233 |
|
|
234 |
if( iDocument.SmsPlugin() )
|
|
235 |
{
|
|
236 |
iDocument.SmsPlugin()->LoadHeadersL( readStore );
|
|
237 |
|
|
238 |
// Check the valid charsupport setting
|
|
239 |
if( iDocument.MessageType() == EUniOpenFromDraft )
|
|
240 |
{
|
|
241 |
charSet = TUniMsvEntry::CharSetSupport( iDocument.Mtm().Entry().Entry() );
|
|
242 |
}
|
|
243 |
else
|
|
244 |
{
|
|
245 |
TInt features = 0;
|
|
246 |
CRepository* storage = CRepository::NewLC( KCRUidSmum );
|
|
247 |
|
|
248 |
if ( storage->Get( KSmumCharSupport, features ) == KErrNone )
|
|
249 |
{
|
|
250 |
if( features == EUniMessageCharSetReduced )
|
|
251 |
{
|
|
252 |
charSet = EUniMessageCharSetReduced;
|
|
253 |
}
|
|
254 |
else if( features == EUniMessageCharSetFullLocked )
|
|
255 |
{
|
|
256 |
charSet = EUniMessageCharSetFullLocked;
|
|
257 |
}
|
|
258 |
else if( features == EUniMessageCharSetReducedLocked )
|
|
259 |
{
|
|
260 |
charSet = EUniMessageCharSetReducedLocked;
|
|
261 |
}
|
|
262 |
else
|
|
263 |
{
|
|
264 |
charSet = EUniMessageCharSetFull;
|
|
265 |
}
|
|
266 |
}
|
|
267 |
|
|
268 |
CleanupStack::PopAndDestroy( storage );
|
|
269 |
}
|
|
270 |
}
|
|
271 |
|
|
272 |
if( iDocument.MmsPlugin() )
|
|
273 |
{
|
|
274 |
iDocument.MmsPlugin()->LoadHeadersL( readStore );
|
|
275 |
}
|
|
276 |
|
|
277 |
CleanupStack::PopAndDestroy( readStore );
|
|
278 |
|
|
279 |
iDocument.CreateCharConverterL( charSet );
|
|
280 |
|
|
281 |
CompleteSelf( KErrNone );
|
|
282 |
}
|
|
283 |
|
|
284 |
// ---------------------------------------------------------
|
|
285 |
// CUniEditorLaunchOperation::DoInitializeModelL
|
|
286 |
// ---------------------------------------------------------
|
|
287 |
//
|
|
288 |
void CUniEditorLaunchOperation::DoInitializeModelL()
|
|
289 |
{
|
|
290 |
iDocument.DataModel()->RestoreL( *this );
|
|
291 |
SetPending();
|
|
292 |
}
|
|
293 |
|
|
294 |
// ---------------------------------------------------------
|
|
295 |
// CUniEditorLaunchOperation::RestoreReady
|
|
296 |
//
|
|
297 |
// RestoreReady: a callback from RestoreL
|
|
298 |
// ---------------------------------------------------------
|
|
299 |
//
|
|
300 |
void CUniEditorLaunchOperation::RestoreReady( TInt /*aParseResult*/, TInt aError )
|
|
301 |
{
|
|
302 |
CompleteOperation( aError );
|
|
303 |
}
|
|
304 |
|
|
305 |
// ---------------------------------------------------------
|
|
306 |
// CUniEditorLaunchOperation::DoHandleMessageL
|
|
307 |
// ---------------------------------------------------------
|
|
308 |
//
|
|
309 |
void CUniEditorLaunchOperation::DoHandleMessageL()
|
|
310 |
{
|
|
311 |
// Synchronize uniobjects that are not yet parsed
|
|
312 |
iDocument.DataModel()->FinalizeMediaParse();
|
|
313 |
|
|
314 |
// Map NoSmil and MultipleSmil to MmsSmil
|
|
315 |
if ( iDocument.DataModel()->SmilType() == ENoSmil ||
|
|
316 |
iDocument.DataModel()->SmilType() == EMultipleSmil )
|
|
317 |
{
|
|
318 |
iDocument.DataModel()->SetSmilType( EMmsSmil );
|
|
319 |
}
|
|
320 |
|
|
321 |
if ( iDocument.Mtm().Body().DocumentLength() > 0 )
|
|
322 |
{
|
|
323 |
// When UniEditor message is formed from real SMS message the body text
|
|
324 |
// is not saved to text attachment but copied directly to text control.
|
|
325 |
// Setting the body modified will trigger the saving to be done.
|
|
326 |
iDocument.SetBodyModified( ETrue );
|
|
327 |
}
|
|
328 |
|
|
329 |
switch ( iDocument.MessageType() )
|
|
330 |
{
|
|
331 |
case EUniNewMessage:
|
|
332 |
{
|
|
333 |
//no operation
|
|
334 |
break;
|
|
335 |
}
|
|
336 |
case EUniReply:
|
|
337 |
{
|
|
338 |
AddSubjectPrefixL( ETrue );
|
|
339 |
iDocument.SetHeaderModified( ETrue ); // To get "Save message..." query always
|
|
340 |
break;
|
|
341 |
}
|
|
342 |
case EUniForward:
|
|
343 |
{
|
|
344 |
// Code runs here when message is forwarded and forwarded message
|
|
345 |
// has been saved into Drafts.
|
|
346 |
// iDocument.LaunchFlags() & EMsgForwardMessage is ETrue, only when
|
|
347 |
// message is being forwarded from Viewer
|
|
348 |
if ( ( iDocument.LaunchFlags() & EMsgForwardMessage ) &&
|
|
349 |
!TUniMsvEntry::IsMmsUpload( iDocument.Entry() ) )
|
|
350 |
{
|
|
351 |
AddSubjectPrefixL( EFalse );
|
|
352 |
}
|
|
353 |
|
|
354 |
// If Subject variation is Off, subject has been shown in the viewer
|
|
355 |
// but will not be shown and saved in the editor
|
|
356 |
iDocument.SetHeaderModified( ETrue ); // To get "Save message..." query always
|
|
357 |
|
|
358 |
#ifdef RD_MSG_XHTML_SUPPORT
|
|
359 |
iTextOperation = CUniEditorProcessTextOperation::NewL( *this, iDocument, iFs );
|
|
360 |
iTextOperation->Start();
|
|
361 |
|
|
362 |
SetPending();
|
|
363 |
return;
|
|
364 |
#else
|
|
365 |
break;
|
|
366 |
#endif
|
|
367 |
}
|
|
368 |
case EUniOpenFromDraft:
|
|
369 |
{
|
|
370 |
//no operation
|
|
371 |
// Added, because of additional header feature.
|
|
372 |
// Variation has changed On->Off and message opened from Drafts
|
|
373 |
// To get "Save message..." query always
|
|
374 |
iDocument.SetHeaderModified( ETrue );
|
|
375 |
break;
|
|
376 |
}
|
|
377 |
case EUniSendUi:
|
|
378 |
{
|
|
379 |
// NOTE: Write from phoneidle is handled as SendAs
|
|
380 |
iDocument.SetHeaderModified( ETrue ); // To get "Save message..." note always
|
|
381 |
|
|
382 |
|
|
383 |
iSendUiOperation = CUniEditorSendUiOperation::NewL( *this, iDocument, iFs );
|
|
384 |
iSendUiOperation->Start();
|
|
385 |
|
|
386 |
SetPending();
|
|
387 |
return;
|
|
388 |
}
|
|
389 |
default:
|
|
390 |
{
|
|
391 |
// Message type not known
|
|
392 |
User::Leave( KErrNotSupported );
|
|
393 |
break;
|
|
394 |
}
|
|
395 |
}
|
|
396 |
CompleteSelf( KErrNone );
|
|
397 |
}
|
|
398 |
|
|
399 |
// ---------------------------------------------------------
|
|
400 |
// CUniEditorLaunchOperation::DoPrepareHeaderL
|
|
401 |
// ---------------------------------------------------------
|
|
402 |
//
|
|
403 |
void CUniEditorLaunchOperation::DoPrepareHeaderL()
|
|
404 |
{
|
|
405 |
// Header is always drawn and populated
|
|
406 |
iHeader = CUniEditorHeader::NewL( iDocument.Mtm(), iDocument, iView, iFs );
|
|
407 |
CompleteSelf( KErrNone );
|
|
408 |
}
|
|
409 |
|
|
410 |
// ---------------------------------------------------------
|
|
411 |
// CUniEditorLaunchOperation::DoPrepareBodyL
|
|
412 |
// ---------------------------------------------------------
|
|
413 |
//
|
|
414 |
void CUniEditorLaunchOperation::DoPrepareBodyL()
|
|
415 |
{
|
|
416 |
iSlideLoader = CUniSlideLoader::NewL(
|
|
417 |
iControlObserver,
|
|
418 |
*iDocument.DataModel(),
|
|
419 |
iView,
|
|
420 |
EUniControlEditorMode );
|
|
421 |
|
|
422 |
if ( iDocument.DataModel()->SmilType() == EMmsSmil )
|
|
423 |
{
|
|
424 |
if ( !iDocument.DataModel()->SmilModel().SlideCount() )
|
|
425 |
{
|
|
426 |
iDocument.DataModel()->SmilModel().AddSlideL();
|
|
427 |
}
|
|
428 |
|
|
429 |
iSlideLoader->LoadSlideL( *this, 0 );
|
|
430 |
SetPending();
|
|
431 |
}
|
|
432 |
else
|
|
433 |
{
|
|
434 |
// All unsupported files should be in
|
|
435 |
// attachment list!
|
|
436 |
//
|
|
437 |
// We should get here only if the SMIL is
|
|
438 |
// more complex than MMS SMIL.
|
|
439 |
//
|
|
440 |
switch ( iDocument.CreationMode() )
|
|
441 |
{
|
|
442 |
case EMmsCreationModeRestricted:
|
|
443 |
{
|
|
444 |
// Other than MMS SMIL not supported in restricted mode
|
|
445 |
SetError( KUniLaunchAbortPresRestricted );
|
|
446 |
CompleteSelf( KErrNone );
|
|
447 |
return;
|
|
448 |
}
|
|
449 |
case EMmsCreationModeWarning:
|
|
450 |
{
|
|
451 |
// Should be handled in editor side.
|
|
452 |
SetError( KUniLaunchPresGuided );
|
|
453 |
}
|
|
454 |
// FALLTHROUGH
|
|
455 |
case EMmsCreationModeFree:
|
|
456 |
default:
|
|
457 |
{
|
|
458 |
if( TUniMsvEntry::IsForwardedMessage( iDocument.Entry() ) ||
|
|
459 |
!iSmilEditorSupported )
|
|
460 |
{
|
|
461 |
// No editing allowed for forwarded "TemplateSmil"
|
|
462 |
// "TemplateSmil" not supported in restricted mode
|
|
463 |
// "TemplateSmil" not supported if SmilEditor disabled
|
|
464 |
//
|
|
465 |
// Set SMIL type to "3GPPSmil"
|
|
466 |
iDocument.DataModel()->SetSmilType( E3GPPSmil );
|
|
467 |
}
|
|
468 |
break;
|
|
469 |
}
|
|
470 |
}
|
|
471 |
|
|
472 |
DoPrepare3GPPBodyL();
|
|
473 |
CompleteSelf( KErrNone );
|
|
474 |
}
|
|
475 |
}
|
|
476 |
|
|
477 |
// ---------------------------------------------------------
|
|
478 |
// CUniEditorLaunchOperation::DoPrepare3GPPBodyL
|
|
479 |
// ---------------------------------------------------------
|
|
480 |
//
|
|
481 |
void CUniEditorLaunchOperation::DoPrepare3GPPBodyL()
|
|
482 |
{
|
|
483 |
CMsgImageControl* imageControl = CMsgImageControl::NewL( iView,
|
|
484 |
&iControlObserver );
|
|
485 |
CleanupStack::PushL( imageControl );
|
|
486 |
|
|
487 |
imageControl->SetControlId( EMsgComponentIdImage );
|
|
488 |
|
|
489 |
TAknsItemID id = KAknsIIDQgnGrafMmsUnedit;
|
|
490 |
TInt icon = EMbmUniutilsQgn_graf_mms_unedit;
|
|
491 |
TInt mask = EMbmUniutilsQgn_graf_mms_unedit_mask;
|
|
492 |
|
|
493 |
if ( iDocument.DataModel()->SmilType() == ETemplateSmil )
|
|
494 |
{
|
|
495 |
id.Set( KAknsIIDQgnGrafMmsEdit );
|
|
496 |
icon = EMbmUniutilsQgn_graf_mms_edit;
|
|
497 |
mask = EMbmUniutilsQgn_graf_mms_edit_mask;
|
|
498 |
}
|
|
499 |
|
|
500 |
TParse fileParse;
|
|
501 |
fileParse.Set( KUniEditorMbmFile, &KDC_APP_BITMAP_DIR, NULL );
|
|
502 |
imageControl->LoadIconL( fileParse.FullName(), id, icon, mask );
|
|
503 |
|
|
504 |
TAknLayoutRect iconLayout;
|
|
505 |
iconLayout.LayoutRect( MsgEditorCommons::MsgDataPane(),
|
|
506 |
AknLayoutScalable_Apps::msg_data_pane_g4().LayoutLine() );
|
|
507 |
|
|
508 |
imageControl->SetIconSizeL( iconLayout.Rect().Size() );
|
|
509 |
imageControl->SetIconVisible( ETrue );
|
|
510 |
|
|
511 |
//The ownership of imageControl is transferred to iView
|
|
512 |
iView.AddControlL( imageControl, EMsgComponentIdImage, EMsgFirstControl, EMsgBody );
|
|
513 |
CleanupStack::Pop( imageControl );
|
|
514 |
}
|
|
515 |
|
|
516 |
// ---------------------------------------------------------
|
|
517 |
// CUniEditorLaunchOperation::AddSubjectPrefixL
|
|
518 |
// ---------------------------------------------------------
|
|
519 |
//
|
|
520 |
void CUniEditorLaunchOperation::AddSubjectPrefixL( TBool aReply )
|
|
521 |
{
|
|
522 |
HBufC* newSubject = NULL;
|
|
523 |
|
|
524 |
if( iDocument.Mtm().SubjectL().Length() > 0 )
|
|
525 |
{
|
|
526 |
// Add prefix only if there's some content in subject field
|
|
527 |
newSubject = iAppUi.CreateSubjectPrefixStringL( iDocument.Mtm().SubjectL(),
|
|
528 |
aReply );
|
|
529 |
}
|
|
530 |
|
|
531 |
if ( newSubject )
|
|
532 |
{
|
|
533 |
CleanupStack::PushL( newSubject );
|
|
534 |
iDocument.Mtm().SetSubjectL( newSubject->Left( KMaxSubjectLength ) );
|
|
535 |
iDocument.SetHeaderModified( ETrue ); // To get "Save message..." query always
|
|
536 |
CleanupStack::PopAndDestroy( newSubject );
|
|
537 |
}
|
|
538 |
}
|
|
539 |
|
|
540 |
// ---------------------------------------------------------
|
|
541 |
// CUniEditorLaunchOperation::DoCancelCleanup
|
|
542 |
// ---------------------------------------------------------
|
|
543 |
//
|
|
544 |
void CUniEditorLaunchOperation::DoCancelCleanup()
|
|
545 |
{
|
|
546 |
if ( iSlideLoader )
|
|
547 |
{
|
|
548 |
iSlideLoader->Cancel();
|
|
549 |
}
|
|
550 |
|
|
551 |
if ( iSendUiOperation )
|
|
552 |
{
|
|
553 |
iSendUiOperation->Cancel();
|
|
554 |
}
|
|
555 |
|
|
556 |
#ifdef RD_MSG_XHTML_SUPPORT
|
|
557 |
if ( iTextOperation )
|
|
558 |
{
|
|
559 |
iTextOperation->Cancel();
|
|
560 |
}
|
|
561 |
#endif
|
|
562 |
}
|
|
563 |
|
|
564 |
// ---------------------------------------------------------
|
|
565 |
// CUniEditorLaunchOperation::RunL
|
|
566 |
// ---------------------------------------------------------
|
|
567 |
//
|
|
568 |
void CUniEditorLaunchOperation::RunL()
|
|
569 |
{
|
|
570 |
PrintOperationAndState();
|
|
571 |
if ( iStatus.Int() != KErrNone )
|
|
572 |
{
|
|
573 |
// if EUniEditorExit, next error code is reason to exit
|
|
574 |
SetError( EUniEditorExit );
|
|
575 |
SetErrorAndReport( iStatus.Int() );
|
|
576 |
}
|
|
577 |
else
|
|
578 |
{
|
|
579 |
DoLaunchStepL();
|
|
580 |
}
|
|
581 |
}
|
|
582 |
|
|
583 |
// ---------------------------------------------------------
|
|
584 |
// CUniEditorLaunchOperation::RunError
|
|
585 |
// ---------------------------------------------------------
|
|
586 |
//
|
|
587 |
TInt CUniEditorLaunchOperation::RunError( TInt aError )
|
|
588 |
{
|
|
589 |
// If EUniEditorExit, next error code is reason to exit
|
|
590 |
SetError( EUniEditorExit );
|
|
591 |
SetError( aError );
|
|
592 |
|
|
593 |
iObserver.EditorOperationEvent( EUniEditorOperationLaunch,
|
|
594 |
EUniEditorOperationError );
|
|
595 |
return KErrNone;
|
|
596 |
}
|
|
597 |
|
|
598 |
// ---------------------------------------------------------
|
|
599 |
// CUniEditorLaunchOperation::SlideLoadReady
|
|
600 |
// ---------------------------------------------------------
|
|
601 |
//
|
|
602 |
void CUniEditorLaunchOperation::SlideLoadReady( TInt aError )
|
|
603 |
{
|
|
604 |
CompleteOperation( aError );
|
|
605 |
}
|
|
606 |
|
|
607 |
// ---------------------------------------------------------
|
|
608 |
// CUniEditorLaunchOperation::HandleOperationEvent
|
|
609 |
// ---------------------------------------------------------
|
|
610 |
//
|
|
611 |
void CUniEditorLaunchOperation::HandleOperationEvent( TUniEditorOperationType aOperation,
|
|
612 |
TUniEditorOperationEvent aEvent )
|
|
613 |
{
|
|
614 |
if ( aOperation == EUniEditorOperationSendUi )
|
|
615 |
{
|
|
616 |
iOptimizedFlow = EFalse;
|
|
617 |
if(aEvent == EUniEditorOperationPartialComplete)
|
|
618 |
{
|
|
619 |
iOptimizedFlow = iSendUiOperation->IsOptimizedFlagSet();
|
|
620 |
if(iOptimizedFlow)
|
|
621 |
{
|
|
622 |
iObserver.EditorOperationEvent(
|
|
623 |
EUniEditorOperationLaunch,
|
|
624 |
EUniEditorOperationComplete );
|
|
625 |
iOptimizedFlow = EFalse;
|
|
626 |
}
|
|
627 |
return;
|
|
628 |
}
|
|
629 |
CArrayFixFlat<TInt>* errors = iSendUiOperation->GetErrors();
|
|
630 |
for ( TInt i = 0; i < errors->Count(); i++ )
|
|
631 |
{
|
|
632 |
if ( errors->At( i ) == EUniProcessImgUserAbort )
|
|
633 |
{
|
|
634 |
iOperationState = EUniLaunchEnd;
|
|
635 |
}
|
|
636 |
else if ( errors->At( i ) == EUniProcessImgCouldNotScale &&
|
|
637 |
iDocument.CreationMode() != EMmsCreationModeRestricted )
|
|
638 |
{
|
|
639 |
// This occurs when animated or transparent gif. Other cases?
|
|
640 |
// Gif type is by default conformant
|
|
641 |
iParseResultTemp++;
|
|
642 |
}
|
|
643 |
SetError( errors->At( i ) );
|
|
644 |
}
|
|
645 |
}
|
|
646 |
#ifdef RD_MSG_XHTML_SUPPORT
|
|
647 |
else
|
|
648 |
{
|
|
649 |
CArrayFixFlat<TInt>* errors = iTextOperation->GetErrors();
|
|
650 |
for ( TInt i = 0; i < errors->Count(); i++ )
|
|
651 |
{
|
|
652 |
SetError( errors->At( i ) );
|
|
653 |
}
|
|
654 |
}
|
|
655 |
#endif
|
|
656 |
|
|
657 |
CompleteOperation( KErrNone );
|
|
658 |
}
|
|
659 |
|
|
660 |
// ---------------------------------------------------------
|
|
661 |
// CUniEditorLaunchOperation::ParseResult
|
|
662 |
// ---------------------------------------------------------
|
|
663 |
//
|
|
664 |
TInt CUniEditorLaunchOperation::ParseResult()
|
|
665 |
{
|
|
666 |
TInt parseResult = iDocument.UpdatedNonConformantCount();
|
|
667 |
parseResult += iParseResultTemp;
|
|
668 |
|
|
669 |
return parseResult;
|
|
670 |
}
|
|
671 |
|
|
672 |
// ---------------------------------------------------------
|
|
673 |
// CUniEditorLaunchOperation::IsOptimizedFlagSet
|
|
674 |
// ---------------------------------------------------------
|
|
675 |
//
|
|
676 |
TBool CUniEditorLaunchOperation::IsOptimizedFlagSet()
|
|
677 |
{
|
|
678 |
return iOptimizedFlow;
|
|
679 |
}
|
|
680 |
|
|
681 |
// EOF
|