|
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, asynchronous operation for object saving |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __UNIEDITORLAUNCHOPERATION_H |
|
21 #define __UNIEDITORLAUNCHOPERATION_H |
|
22 |
|
23 // INCLUDES |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <e32std.h> |
|
27 |
|
28 #include <unislideloader.h> |
|
29 |
|
30 #include "UniEditorOperation.h" |
|
31 #include "UniEditorDocument.h" |
|
32 #include "UniEditorSendUiOperation.h" |
|
33 #include "UniEditorProcessTextOperation.h" |
|
34 |
|
35 // CONSTANTS |
|
36 |
|
37 // MACROS |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 |
|
41 class MMsgAsyncControlObserver; |
|
42 class MUniDataModelObserver; |
|
43 class CMsgEditorView; |
|
44 class CMsgEditorAppUi; |
|
45 class CUniEditorHeader; |
|
46 |
|
47 // DATA TYPES |
|
48 |
|
49 // FUNCTION PROTOTYPES |
|
50 |
|
51 // CLASS DECLARATION |
|
52 |
|
53 /** |
|
54 * CUniEditorLaunchOperation |
|
55 * |
|
56 * @since 3.2 |
|
57 */ |
|
58 class CUniEditorLaunchOperation : public CUniEditorOperation, |
|
59 public MUniSlideLoaderObserver, |
|
60 public MUniDataModelObserver |
|
61 { |
|
62 public: // New methods |
|
63 |
|
64 /** |
|
65 * Factory method that creates this object. |
|
66 * |
|
67 * @param aObserver |
|
68 * @return Pointer to instance in cleanup stack |
|
69 */ |
|
70 static CUniEditorLaunchOperation* NewL( |
|
71 MMsgAsyncControlObserver& aControlObserver, |
|
72 MUniEditorOperationObserver& aOperationObserver, |
|
73 CUniEditorDocument& aDocument, |
|
74 CMsgEditorView& aView, |
|
75 CMsgEditorAppUi& aAppUi, |
|
76 RFs& aFs ); |
|
77 |
|
78 /** |
|
79 * Destructor |
|
80 */ |
|
81 virtual ~CUniEditorLaunchOperation(); |
|
82 |
|
83 /** |
|
84 * Start launch process |
|
85 */ |
|
86 void Launch(); |
|
87 |
|
88 /** |
|
89 * Detach header object |
|
90 */ |
|
91 inline CUniEditorHeader* DetachHeader(); |
|
92 |
|
93 /** |
|
94 * Detach slide loader object |
|
95 */ |
|
96 inline CUniSlideLoader* DetachSlideLoader(); |
|
97 |
|
98 /** |
|
99 * get header object |
|
100 */ |
|
101 inline CUniEditorHeader* GetHeader(); |
|
102 |
|
103 /** |
|
104 * get slide loader object |
|
105 */ |
|
106 inline CUniSlideLoader* GetSlideLoader(); |
|
107 |
|
108 |
|
109 /** |
|
110 * Return parse result |
|
111 */ |
|
112 TInt ParseResult(); |
|
113 |
|
114 /** |
|
115 * From MUniDataModelObserver |
|
116 */ |
|
117 void RestoreReady( TInt aParseResult, TInt aError ); |
|
118 |
|
119 /** |
|
120 * check Is optimized flow |
|
121 */ |
|
122 TBool IsOptimizedFlagSet(); |
|
123 |
|
124 protected: |
|
125 |
|
126 /** |
|
127 * From CActive |
|
128 */ |
|
129 void RunL(); |
|
130 |
|
131 /** |
|
132 * From CActive |
|
133 */ |
|
134 TInt RunError( TInt aError ); |
|
135 |
|
136 /** |
|
137 * From MUniSlideLoaderObserver |
|
138 */ |
|
139 void SlideLoadReady( TInt aError ); |
|
140 |
|
141 /** |
|
142 * From CUniEditorOperation |
|
143 */ |
|
144 void DoCancelCleanup(); |
|
145 |
|
146 /** |
|
147 * From CUniEditorOperation |
|
148 */ |
|
149 void HandleOperationEvent( TUniEditorOperationType aOperation, |
|
150 TUniEditorOperationEvent aEvent ); |
|
151 |
|
152 private: |
|
153 |
|
154 /** |
|
155 * C++ constructor. |
|
156 */ |
|
157 CUniEditorLaunchOperation( MMsgAsyncControlObserver& aControlObserver, |
|
158 MUniEditorOperationObserver& aOperationObserver, |
|
159 CUniEditorDocument& aDocument, |
|
160 CMsgEditorView& aView, |
|
161 CMsgEditorAppUi& aAppUi, |
|
162 RFs& aFs ); |
|
163 |
|
164 /** |
|
165 * 2nd phase constructor. |
|
166 */ |
|
167 void ConstructL(); |
|
168 |
|
169 /** |
|
170 * Performs lauch step |
|
171 */ |
|
172 void DoLaunchStepL(); |
|
173 |
|
174 /** |
|
175 * Initializes document. |
|
176 */ |
|
177 void DoInitializeDocL(); |
|
178 |
|
179 /** |
|
180 * Initializes data model |
|
181 */ |
|
182 void DoInitializeModelL(); |
|
183 |
|
184 /** |
|
185 * Processes message |
|
186 */ |
|
187 void DoHandleMessageL(); |
|
188 |
|
189 /** |
|
190 * Prepares header |
|
191 */ |
|
192 void DoPrepareHeaderL(); |
|
193 |
|
194 /** |
|
195 * Prepares body |
|
196 */ |
|
197 void DoPrepareBodyL(); |
|
198 |
|
199 /** |
|
200 * Prepares 3GPP body |
|
201 */ |
|
202 void DoPrepare3GPPBodyL(); |
|
203 |
|
204 /** |
|
205 * Add subject prefix ("Re:" or "Fw:") |
|
206 * @param ETrue, for reply -> "Re:" |
|
207 * EFalse, for forward -> "Fw:" |
|
208 */ |
|
209 void AddSubjectPrefixL( TBool aReply ); |
|
210 |
|
211 protected: // data |
|
212 |
|
213 // assigned to iOperationState in base class |
|
214 enum TUniLaunchState |
|
215 { |
|
216 EUniLaunchInitializeDoc = 0, |
|
217 EUniLaunchInitializeModel, |
|
218 EUniLaunchHandleMessage, |
|
219 EUniLaunchPrepareHeader, |
|
220 EUniLaunchPrepareBody, |
|
221 EUniLaunchEnd |
|
222 }; |
|
223 |
|
224 MMsgAsyncControlObserver& iControlObserver; |
|
225 CMsgEditorView& iView; |
|
226 CMsgEditorAppUi& iAppUi; |
|
227 |
|
228 CUniEditorSendUiOperation* iSendUiOperation; |
|
229 CUniEditorHeader* iHeader; |
|
230 CUniSlideLoader* iSlideLoader; |
|
231 |
|
232 CUniEditorProcessTextOperation* iTextOperation; |
|
233 |
|
234 TInt iError; |
|
235 TBool iSmilEditorSupported; |
|
236 // count of failed image operations |
|
237 TInt iParseResultTemp; |
|
238 // sendui+jepg optimization changes |
|
239 TBool iOptimizedFlow; |
|
240 |
|
241 }; |
|
242 |
|
243 #include "UniEditorLaunchOperation.inl" |
|
244 |
|
245 #endif // __UNIEDITORLAUNCHOPERATION_H |
|
246 |
|
247 // End of file |
|
248 |