|
1 //Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
2 //All rights reserved. |
|
3 //This component and the accompanying materials are made available |
|
4 //under the terms of "Eclipse Public License v1.0" |
|
5 //which accompanies this distribution, and is available |
|
6 //at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 |
|
8 //Initial Contributors: |
|
9 //Nokia Corporation - initial contribution. |
|
10 |
|
11 //Contributors: |
|
12 |
|
13 //Description: |
|
14 |
|
15 ///////////////////////////////////////////////////////////////////// |
|
16 |
|
17 #ifndef T_TSGRAPHICFILESCALINGHANDLER_H |
|
18 #define T_TSGRAPHICFILESCALINGHANDLER_H |
|
19 |
|
20 // INCLUDED FILES |
|
21 #include <QObject> |
|
22 #include <QPixmap> |
|
23 #include "tsgraphicfilescalinghandler.h" |
|
24 |
|
25 class T_CTsGraphicFileScalingHandler : |
|
26 public QObject, |
|
27 public MImageReadyCallBack |
|
28 { |
|
29 Q_OBJECT |
|
30 |
|
31 private: |
|
32 static TInt CallStop(TAny *aWait); |
|
33 static void WaitActive(TInt aTime); |
|
34 |
|
35 //From MImageReadyCallBack |
|
36 private: |
|
37 virtual void ImageReadyCallBack(TInt error, const CFbsBitmap *bitmap); |
|
38 |
|
39 public: |
|
40 explicit T_CTsGraphicFileScalingHandler(QObject *parent = 0); |
|
41 virtual ~T_CTsGraphicFileScalingHandler(); |
|
42 |
|
43 private slots: |
|
44 |
|
45 // tests for file path and kind of graphic file as imput |
|
46 void testGraphicFileScalingIgnoreAspectRatio_LessWidth(); |
|
47 void testGraphicFileScalingIgnoreAspectRatio_LessHeight(); |
|
48 void testGraphicFileScalingIgnoreAspectRatio_TheSameRatio(); |
|
49 void testGraphicFileScalingKeepAspectRatio_LessWidth(); |
|
50 void testGraphicFileScalingKeepAspectRatio_LessHeight(); |
|
51 void testGraphicFileScalingKeepAspectRatio_TheSameRatio(); |
|
52 void testGraphicFileScalingKeepAspectRatioByExpanding_LessWidth(); |
|
53 void testGraphicFileScalingKeepAspectRatioByExpanding_LessHeight(); |
|
54 void testGraphicFileScalingKeepAspectRatioByExpanding_TheSameRatio(); |
|
55 |
|
56 // tests incorrect situation |
|
57 void testGraphicFileScalingInvalidImagePath(); |
|
58 void testGraphicFileScalingEmptyImagePath(); |
|
59 void testGraphicFileScalingEmptyMimeType(); |
|
60 void testGraphicFileScalingScalingToIncorrectWidthSize(); |
|
61 void testGraphicFileScalingScalingToIncorrectHeightSize(); |
|
62 void testGraphicFileScalingScalingToZeroSize(); |
|
63 void testDoCancel(); |
|
64 |
|
65 // tests for CFbsBitmap as imput |
|
66 void testCFbsBitmapScalingToCorrectSize(); |
|
67 void testCFbsBitmapScalinToIncorrectWidthSize(); |
|
68 void testCFbsBitmapScalinToIncorrectHeightSize(); |
|
69 |
|
70 private: |
|
71 RFs mFs; |
|
72 QPixmap mPixMapCallBack; |
|
73 TInt mErrorCallBack; |
|
74 }; |
|
75 |
|
76 #endif // T_TSGRAPHICFILESCALINGHANDLER_H |
|
77 // End of File |