|
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: Image decoding and scaling utility class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef AKNSSRVWALLPAPERSCALING_H |
|
20 #define AKNSSRVWALLPAPERSCALING_H |
|
21 |
|
22 #include <imageconversion.h> |
|
23 #include <bitmaptransforms.h> |
|
24 #include <SVGRequestObserver.h> |
|
25 |
|
26 class CSvgEngineInterfaceImpl; |
|
27 class MSvgError; |
|
28 |
|
29 /* |
|
30 * SVG Image decoder. |
|
31 */ |
|
32 NONSHARABLE_CLASS(CAknsSrvSVGImageDecoder) : public CBase, public MSvgRequestObserver |
|
33 { |
|
34 public: |
|
35 static CAknsSrvSVGImageDecoder* NewL(); |
|
36 ~CAknsSrvSVGImageDecoder(); |
|
37 void DecodeImageL( const TDesC& aFilename, |
|
38 const TSize& aTargetSize, |
|
39 CFbsBitmap*& aBitmap, |
|
40 CFbsBitmap*& aMask ); |
|
41 void LeaveIfErrorL( MSvgError* aError ); |
|
42 protected: |
|
43 CAknsSrvSVGImageDecoder(); |
|
44 void ConstructL(); |
|
45 private: |
|
46 void UpdateScreen(); |
|
47 TBool ScriptCall( const TDesC& aScript,CSvgElementImpl* aCallerElement ); |
|
48 TInt FetchImage( const TDesC& aUri, RFs& aSession, RFile& aFileHandle ); |
|
49 void GetSmilFitValue( TDes& aSmilValue ); |
|
50 void UpdatePresentation( const TInt32& aNoOfAnimation ); |
|
51 TInt FetchFont( const TDesC& aUri, RFs& aSession, RFile& aFileHandle ); |
|
52 private: |
|
53 CFbsBitmap* iBitmap; |
|
54 CFbsBitmap* iMask; |
|
55 CFbsBitmap* iDummyBitmap; |
|
56 CSvgEngineInterfaceImpl* iSvgEngine; |
|
57 }; |
|
58 |
|
59 /* |
|
60 * Non-SVG Image decoder. |
|
61 */ |
|
62 NONSHARABLE_CLASS(CAknsSrvImageConverter) : public CActive |
|
63 { |
|
64 public: |
|
65 static CAknsSrvImageConverter* NewL(); |
|
66 ~CAknsSrvImageConverter(); |
|
67 |
|
68 static void DecodeImageL( |
|
69 RFs& aRFs, |
|
70 const TDesC& aFilename, |
|
71 const TSize& aTargetSize, |
|
72 CFbsBitmap*& aBitmap, |
|
73 CFbsBitmap*& aMask, |
|
74 const TSize& aMaxSize ); |
|
75 |
|
76 void ScaleAndCropImageL( |
|
77 CFbsBitmap*& aBitmap, |
|
78 const TSize& aTargetSize ); |
|
79 void DoCancel(); |
|
80 void RunL(); |
|
81 |
|
82 protected: |
|
83 CAknsSrvImageConverter(); |
|
84 void ConstructL(); |
|
85 private: |
|
86 void BeginWait(); |
|
87 void EndWait(); |
|
88 |
|
89 private: |
|
90 CBitmapScaler* iBitmapScaler; |
|
91 TInt iConversionError; |
|
92 CActiveSchedulerWait iWait; |
|
93 TBool iWaitActive; |
|
94 }; |
|
95 |
|
96 #endif |
|
97 |