|
1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef IMAGEROTATERPROVIDER_H |
|
21 #define IMAGEROTATERPROVIDER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <AiwServiceIfMenu.h> |
|
25 #include <apparc.h> |
|
26 #include <ConeResLoader.h> |
|
27 #include "JpegRotatorHelperObserver.h" |
|
28 |
|
29 |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CJpegRotatorHelper; |
|
33 class MAiwNotifyCallback; |
|
34 class TDataType; |
|
35 |
|
36 /** CRotateProvider |
|
37 * |
|
38 * CRotateProvider acts as a service provider of Image Editor in |
|
39 * Series 60 2.8 platform. It implements the base and menu service classes |
|
40 * as an ECom component. |
|
41 * |
|
42 */ |
|
43 class CRotateProvider : public CAiwServiceIfMenu, public MJpegRotatorHelperObserver |
|
44 { |
|
45 |
|
46 public: |
|
47 |
|
48 /** New factory method |
|
49 * |
|
50 * |
|
51 * @param - |
|
52 * @return - pointer to a new instance of CRotateProvider |
|
53 */ |
|
54 static CRotateProvider * NewL(); |
|
55 |
|
56 /** Destructor |
|
57 * |
|
58 * @param - |
|
59 * @return - |
|
60 */ |
|
61 virtual ~CRotateProvider(); |
|
62 |
|
63 /** InitialiseL |
|
64 * |
|
65 * @see CAiwServiceIfBase |
|
66 */ |
|
67 virtual void InitialiseL ( |
|
68 MAiwNotifyCallback & aFrameworkCallback, |
|
69 const RCriteriaArray & aInterest |
|
70 ); |
|
71 |
|
72 /** HandleServiceCmdL |
|
73 * |
|
74 * @see CAiwServiceIfBase |
|
75 */ |
|
76 virtual void HandleServiceCmdL ( |
|
77 const TInt & aCmdId, |
|
78 const CAiwGenericParamList & aInParamList, |
|
79 CAiwGenericParamList & aOutParamList, |
|
80 TUint aCmdOptions, |
|
81 const MAiwNotifyCallback * aCallback |
|
82 ); |
|
83 |
|
84 /** InitializeMenuPaneL |
|
85 * |
|
86 * @see CAiwServiceIfMenu |
|
87 */ |
|
88 virtual void InitializeMenuPaneL ( |
|
89 CAiwMenuPane & aMenuPane, |
|
90 TInt aIndex, |
|
91 TInt aCascadeId, |
|
92 const CAiwGenericParamList & aInParamList |
|
93 ); |
|
94 |
|
95 /** HandleMenuCmdL |
|
96 * |
|
97 * @see CAiwServiceIfMenu |
|
98 */ |
|
99 virtual void HandleMenuCmdL ( |
|
100 TInt aMenuCmdId, |
|
101 const CAiwGenericParamList & aInParamList, |
|
102 CAiwGenericParamList & aOutParamList, |
|
103 TUint aCmdOptions, |
|
104 const MAiwNotifyCallback * aCallback |
|
105 ); |
|
106 |
|
107 protected: |
|
108 |
|
109 /** Default constructor |
|
110 * |
|
111 * @param - |
|
112 * @return - |
|
113 */ |
|
114 CRotateProvider(); |
|
115 |
|
116 /** |
|
117 * @param aInParamList |
|
118 * @return CDesCArray* |
|
119 */ |
|
120 CDesCArray* CheckInputFilesLC ( |
|
121 const CAiwGenericParamList & aInParamList |
|
122 ); |
|
123 |
|
124 /** |
|
125 * @param aOutParamList |
|
126 * @param aCallback |
|
127 * @return - |
|
128 */ |
|
129 void CheckAiwCallBackL ( |
|
130 CAiwGenericParamList & aOutParamList, |
|
131 const MAiwNotifyCallback * aCallback |
|
132 ); |
|
133 |
|
134 /** |
|
135 * @param aFileName |
|
136 * @param aCmdId |
|
137 * @return - |
|
138 */ |
|
139 void LaunchJpegRotatorL( |
|
140 const CDesCArray * aInputFileList, |
|
141 TInt aCmdId |
|
142 ); |
|
143 |
|
144 /** CheckDRMProtectionL |
|
145 * |
|
146 * Checks if file is DRM protected. |
|
147 * |
|
148 * @param aFileName - file name |
|
149 * @return - ETrue if protected, otherwise EFalse, |
|
150 */ |
|
151 TBool CheckDRMProtectionL(const TDesC& aFileName) const; |
|
152 |
|
153 /** IsJpeg |
|
154 * |
|
155 * @param aDataType |
|
156 * @return TBool |
|
157 */ |
|
158 TBool IsJpeg (const TDataType& aDataType) const; |
|
159 |
|
160 /** CheckDiskSpaceL |
|
161 * |
|
162 * Checks if there is enough space in the disk (MMC/PhoneMemory). |
|
163 * |
|
164 * @param aFsSession - file server session |
|
165 * @param aFileName - file name |
|
166 * @return - ETrue if enough free memory, otherwise EFalse |
|
167 */ |
|
168 TBool CheckDiskSpaceL(RFs& aFsSession, const TDesC& aFileName) const; |
|
169 |
|
170 /** CheckDiskSpaceL |
|
171 * |
|
172 * Checks if there is enough space in the disk (MMC/PhoneMemory). |
|
173 * |
|
174 * @param aFsSession - file server session |
|
175 * @param aFileList - list of file names |
|
176 * @return - ETrue if enough free memory, otherwise EFalse |
|
177 */ |
|
178 TBool CheckDiskSpaceL(RFs& aFsSession, const CDesCArray* aFileList) const; |
|
179 |
|
180 /** HandleCmdsL |
|
181 * |
|
182 * Handle menu and service commands |
|
183 * |
|
184 * @see HandleMenuCmdL |
|
185 * @see HandleServiceCmdL |
|
186 */ |
|
187 void HandleCmdsL ( |
|
188 TInt aMenuCmdId, |
|
189 const CAiwGenericParamList & aInParamList, |
|
190 CAiwGenericParamList & aOutParamList, |
|
191 TUint aCmdOptions, |
|
192 const MAiwNotifyCallback * aCallback |
|
193 ); |
|
194 |
|
195 private: // from MJpegRotatorHelperObserver |
|
196 |
|
197 /** RotateOperationReadyL |
|
198 * |
|
199 * @see MJpegRotatorHelperObserver |
|
200 */ |
|
201 virtual void RotateOperationReadyL (TInt aError); |
|
202 |
|
203 private: |
|
204 |
|
205 TFileName iResourceFile; |
|
206 RConeResourceLoader iResLoader; |
|
207 TBool iResLoaderOpen; |
|
208 TBool iFileServerConnected; |
|
209 TBool iUseCallBack; |
|
210 RFs iSharableFS; |
|
211 RFile iFileHandle; |
|
212 |
|
213 const MAiwNotifyCallback* iCallback; |
|
214 CAiwGenericParamList* iInParamList; |
|
215 CAiwGenericParamList* iOutParamList; |
|
216 |
|
217 CJpegRotatorHelper* iJpegRotatorHelper; |
|
218 CDesCArray* iInputFileList; |
|
219 CDesCArray* iTargetFileList; |
|
220 |
|
221 }; |
|
222 |
|
223 |
|
224 #endif // EOF EditorServiceProvider.h |