|
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: CUniEditorConvertVideoOperation class definition. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __UNIEDITORCONVERTVIDEOOPERATION_H |
|
21 #define __UNIEDITORCONVERTVIDEOOPERATION_H |
|
22 |
|
23 // INCLUDES |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <msvapi.h> |
|
27 |
|
28 #include <uniobject.h> |
|
29 #include <cmsvattachment.h> |
|
30 |
|
31 #include "UniEditorOperation.h" |
|
32 #include "VideoConversionApi.h" |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 |
|
36 class CMsgVideoInfo; |
|
37 class CUniEditorDocument; |
|
38 class MMsvAttachmentManager; |
|
39 class CMsvStore; |
|
40 |
|
41 // DATA TYPES |
|
42 |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 * CUniEditorConvertVideoOperation |
|
47 * |
|
48 * @since 3.2 |
|
49 */ |
|
50 class CUniEditorConvertVideoOperation : public CUniEditorOperation, |
|
51 public MVideoConversionCallback |
|
52 { |
|
53 public: // new operations |
|
54 |
|
55 /** |
|
56 * Factory method |
|
57 */ |
|
58 static CUniEditorConvertVideoOperation* NewL( |
|
59 MUniEditorOperationObserver& aObserver, |
|
60 CUniEditorDocument& aDocument, |
|
61 RFs& aFs ); |
|
62 |
|
63 |
|
64 /** |
|
65 * Returns whether converter is implemented |
|
66 */ |
|
67 static TBool IsImplementedL(); |
|
68 |
|
69 /** |
|
70 * Start video convert operation |
|
71 * |
|
72 * @param aImageInfo |
|
73 * @param aAttachmentId Attachment id, if the image is already stored as an attachment |
|
74 * KMsvNullIndexEntryId, otherwise. |
|
75 * @param aMessageSize |
|
76 */ |
|
77 void Process( CMsgVideoInfo* aVideoInfo, |
|
78 TMsvAttachmentId aAttachmentId, |
|
79 TInt aMessageSize ); |
|
80 |
|
81 /** |
|
82 * Destructor |
|
83 */ |
|
84 virtual ~CUniEditorConvertVideoOperation(); |
|
85 |
|
86 /** |
|
87 * Detaches video info object. |
|
88 */ |
|
89 CMsgVideoInfo* DetachVideoInfo(); |
|
90 |
|
91 /** |
|
92 * Detaches attachment id |
|
93 */ |
|
94 void DetachAttachmentId( TMsvAttachmentId& aAttachmentId ); |
|
95 |
|
96 protected: |
|
97 |
|
98 /** |
|
99 * From CActive. |
|
100 */ |
|
101 void RunL(); |
|
102 |
|
103 /** |
|
104 * From CUniEditorOperation |
|
105 */ |
|
106 void DoCancelCleanup(); |
|
107 |
|
108 /** |
|
109 * From MVideoConversionCallback. Called when |
|
110 * video conversion has been completed by video |
|
111 * conversion plugin |
|
112 */ |
|
113 void VideoConversionDone( TInt aStatus ); |
|
114 |
|
115 private: // new operations |
|
116 |
|
117 /** |
|
118 * C++ constructor |
|
119 */ |
|
120 CUniEditorConvertVideoOperation( MUniEditorOperationObserver& aObserver, |
|
121 CUniEditorDocument& aDocument, |
|
122 RFs& aFs ); |
|
123 |
|
124 /** |
|
125 * 2nd phase constructor. |
|
126 */ |
|
127 void ConstructL(); |
|
128 |
|
129 |
|
130 /** |
|
131 * Creates empty attachment |
|
132 */ |
|
133 void CreateEmptyAttachmentL(); |
|
134 |
|
135 /** |
|
136 * Performs processing start |
|
137 */ |
|
138 void DoStartProcessL(); |
|
139 |
|
140 /** |
|
141 * Start resolving |
|
142 */ |
|
143 void DoStartResolveL(); |
|
144 |
|
145 /** |
|
146 * Performs actions when conversion is ready |
|
147 */ |
|
148 void DoReady(); |
|
149 |
|
150 /** |
|
151 * Performs error handling without state change. |
|
152 */ |
|
153 void DoErrorWithoutStateChange(); |
|
154 |
|
155 /** |
|
156 * Opens file by file name. If it fails with KErrPermissionDenied, |
|
157 * file is searched from message store and opened from there. |
|
158 */ |
|
159 RFile OpenFileForReadingL(); |
|
160 |
|
161 private: // data |
|
162 |
|
163 // assigned to iOperationState in base class |
|
164 enum TUniProcessStates |
|
165 { |
|
166 EUniConvertVidCheck, |
|
167 EUniConvertVidProcess, |
|
168 EUniConvertVidResolve, |
|
169 EUniConvertVidReady, |
|
170 EUniConvertVidError |
|
171 }; |
|
172 |
|
173 TInt iTargetSize; |
|
174 |
|
175 CMsgVideoInfo* iVideoInfo; |
|
176 TMsvAttachmentId iAttachmentId; |
|
177 |
|
178 CMsgVideoInfo* iNewVideoInfo; |
|
179 RFile iNewVideoFile; |
|
180 TMsvAttachmentId iNewAttaId; |
|
181 CMsvStore* iEditStore; |
|
182 |
|
183 CVideoConversionPlugin* iConverter; |
|
184 }; |
|
185 |
|
186 #endif //__UNIEDITORCONVERTVIDEOOPERATION_H |