|
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 // INCLUDE FILES |
|
21 #include "JpegRotator.h" |
|
22 #include "JpegRotatorImpl.h" |
|
23 |
|
24 // CONSTANTS |
|
25 |
|
26 // debug log |
|
27 #include "imageeditordebugutils.h" |
|
28 |
|
29 //============================================================================= |
|
30 EXPORT_C CJpegRotator * CJpegRotator::NewLC (RFs& aFsSession) |
|
31 { |
|
32 CJpegRotator * self = new (ELeave) CJpegRotator (); |
|
33 CleanupStack::PushL (self); |
|
34 self->ConstructL (aFsSession); |
|
35 return self; |
|
36 } |
|
37 |
|
38 //============================================================================= |
|
39 EXPORT_C CJpegRotator * CJpegRotator::NewL (RFs& aFsSession) |
|
40 { |
|
41 CJpegRotator * self = CJpegRotator::NewLC (aFsSession); |
|
42 CleanupStack::Pop(); // self |
|
43 return self; |
|
44 } |
|
45 |
|
46 //============================================================================= |
|
47 EXPORT_C CJpegRotator::~CJpegRotator () |
|
48 { |
|
49 LOG( KJpegRotatorLogFile, "CJpegRotator::~CJpegRotator"); |
|
50 |
|
51 delete iImplementation; |
|
52 } |
|
53 |
|
54 //============================================================================= |
|
55 EXPORT_C void CJpegRotator::RotateImageL ( |
|
56 TRequestStatus & aStatus, |
|
57 const TDesC & aSourceFileName, |
|
58 const TDesC & aTargetFileName, |
|
59 CJpegRotator::TRotationMode aRotationMode, |
|
60 TBool aHandleExifData, |
|
61 TBool aForceLossyMode |
|
62 ) |
|
63 { |
|
64 LOGFMT( KJpegRotatorLogFile, "CJpegRotator::RotateImageL (rotation mode: %d)", aRotationMode ); |
|
65 LOGFMT( KJpegRotatorLogFile, "\tSource image: %S", &aSourceFileName ); |
|
66 LOGFMT( KJpegRotatorLogFile, "\tTarget image: %S", &aTargetFileName ); |
|
67 |
|
68 iImplementation->PrepareRotateFileL (aSourceFileName, aTargetFileName, aRotationMode, aHandleExifData); |
|
69 iImplementation->StartAsyncRotate (aStatus, aForceLossyMode); |
|
70 } |
|
71 |
|
72 //============================================================================= |
|
73 EXPORT_C void CJpegRotator::Cancel () |
|
74 { |
|
75 LOG( KJpegRotatorLogFile, "CJpegRotator::Cancel()"); |
|
76 |
|
77 iImplementation->Cancel(); |
|
78 } |
|
79 |
|
80 //============================================================================= |
|
81 CJpegRotator::CJpegRotator () |
|
82 { |
|
83 } |
|
84 |
|
85 //============================================================================= |
|
86 void CJpegRotator::ConstructL (RFs& aFsSession) |
|
87 { |
|
88 LOG_INIT( KJpegRotatorLogFile ); |
|
89 |
|
90 iImplementation = CJpegRotatorImpl::NewL (aFsSession); |
|
91 } |
|
92 |
|
93 // End of File |