|
1 /* |
|
2 * Copyright (c) 2002 - 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: test functions for alfvisual.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // [INCLUDE FILES] |
|
21 #include <e32svr.h> |
|
22 #include <stifparser.h> |
|
23 #include <stiftestinterface.h> |
|
24 |
|
25 #include "testplatalfvisual.h" |
|
26 |
|
27 |
|
28 |
|
29 // ============================ MEMBER FUNCTIONS =============================== |
|
30 |
|
31 // ----------------------------------------------------------------------------- |
|
32 // CTestPlatAlfVisual::TestAlfGradientBrushNewL |
|
33 // ----------------------------------------------------------------------------- |
|
34 // |
|
35 TInt CTestPlatAlfVisual::TestAlfGradientBrushNewL( CStifItemParser& /*aItem*/ ) |
|
36 { |
|
37 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
38 _LIT( KTestAlfGradientBrushNewL, "TestAlfGradientBrushNewL" ); |
|
39 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfGradientBrushNewL ); |
|
40 // Print to log file |
|
41 iLog->Log( KTestAlfGradientBrushNewL ); |
|
42 |
|
43 CAlfGradientBrush* vBrush = CAlfGradientBrush::NewL( *iAlfEnv ); |
|
44 CleanupStack::PushL( vBrush ); |
|
45 STIF_ASSERT_NOT_NULL( vBrush ); |
|
46 CleanupStack::PopAndDestroy( vBrush ); |
|
47 |
|
48 vBrush = NULL; |
|
49 vBrush = CAlfGradientBrush::NewLC( *iAlfEnv ); |
|
50 STIF_ASSERT_NOT_NULL( vBrush ); |
|
51 CleanupStack::PopAndDestroy( vBrush ); |
|
52 |
|
53 return KErrNone; |
|
54 } |
|
55 |
|
56 // ----------------------------------------------------------------------------- |
|
57 // CTestPlatAlfVisual::TestAlfGradientBrushSetL |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 TInt CTestPlatAlfVisual::TestAlfGradientBrushSetL( CStifItemParser& /*aItem*/ ) |
|
61 { |
|
62 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
63 _LIT( KTestAlfGradientBrushSetL, "TestAlfGradientBrushSetL" ); |
|
64 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfGradientBrushSetL ); |
|
65 // Print to log file |
|
66 iLog->Log( KTestAlfGradientBrushSetL ); |
|
67 |
|
68 CAlfGradientBrush* vBrush = CAlfGradientBrush::NewLC( *iAlfEnv ); |
|
69 vBrush->SetDirection( CAlfGradientBrush::EDirectionLeft ); |
|
70 TRgb vRgb( KRgbBlue ); |
|
71 vBrush->SetColor( vRgb ); |
|
72 TAlfImage vImage; |
|
73 vBrush->SetImage( vImage ); |
|
74 vBrush->AppendColorL( 1.0, vRgb); |
|
75 CleanupStack::PopAndDestroy( vBrush ); |
|
76 |
|
77 return KErrNone; |
|
78 } |
|
79 |
|
80 // ----------------------------------------------------------------------------- |
|
81 // CTestPlatAlfVisual::TestAlfGradientBrushGetL |
|
82 // ----------------------------------------------------------------------------- |
|
83 // |
|
84 TInt CTestPlatAlfVisual::TestAlfGradientBrushGetL( CStifItemParser& /*aItem*/ ) |
|
85 { |
|
86 _LIT( KTestPlatAlfVisual, "TestPlatAlfVisual" ); |
|
87 _LIT( KTestAlfGradientBrushGetL, "TestAlfGradientBrushGetL" ); |
|
88 TestModuleIf().Printf( 0, KTestPlatAlfVisual, KTestAlfGradientBrushGetL ); |
|
89 // Print to log file |
|
90 iLog->Log( KTestAlfGradientBrushGetL ); |
|
91 |
|
92 CAlfGradientBrush* vBrush = CAlfGradientBrush::NewLC( *iAlfEnv ); |
|
93 vBrush->Color( 0 ); |
|
94 vBrush->Opacity( 0 ); |
|
95 vBrush->Image(); |
|
96 CleanupStack::PopAndDestroy( vBrush ); |
|
97 |
|
98 return KErrNone; |
|
99 } |
|
100 |
|
101 // End of file |
|
102 |
|
103 |