|
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: For test alf core toolkit api modules |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // [INCLUDE FILES] |
|
21 #include <e32svr.h> |
|
22 #include <stifparser.h> |
|
23 #include <stiftestinterface.h> |
|
24 #include <uiacceltk/huienv.h> |
|
25 #include <uiacceltk/huicontrol.h> |
|
26 #include <uiacceltk/huiControlGroup.h> |
|
27 #include <uiacceltk/huivisual.h> |
|
28 #include <uiacceltk/huianchorlayout.h> |
|
29 #include <uiacceltk/huievent.h> |
|
30 #include <uiacceltk/huicurvepath.h> |
|
31 #include <uiacceltk/huicurvepathlayout.h> |
|
32 #include <uiacceltk/huidecklayout.h> |
|
33 #include <eikenv.h> |
|
34 #include <e32err.h> |
|
35 |
|
36 #include "testuiaifcoretoolkit.h" |
|
37 // ----------------------------------------------------------------------------- |
|
38 // CTestUiAifCoreToolkit::TestCHuiDeckLayoutAddNewL |
|
39 // ----------------------------------------------------------------------------- |
|
40 // |
|
41 TInt CTestUiAifCoreToolkit::TestCHuiDeckLayoutAddNewL( CStifItemParser& /*aItem*/ ) |
|
42 { |
|
43 |
|
44 // Print to UI |
|
45 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
46 _LIT( KTestCHuiDeckLayoutAddNewL, "In TestCHuiDeckLayoutAddNewL" ); |
|
47 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestCHuiDeckLayoutAddNewL ); |
|
48 // Print to log file |
|
49 iLog->Log( KTestCHuiDeckLayoutAddNewL ); |
|
50 |
|
51 STIF_ASSERT_NOT_NULL( iHuiEnv ); |
|
52 STIF_ASSERT_NOT_NULL( iHuiControl ); |
|
53 CHuiControl* otherControl = new( ELeave ) CHuiControl( *iHuiEnv ); |
|
54 STIF_ASSERT_NOT_NULL( otherControl ); |
|
55 CleanupStack::PushL( otherControl ); |
|
56 iHuiControl->SetId( 0 ); |
|
57 STIF_ASSERT_NOT_NULL( iHuiControlGroup ); |
|
58 CHuiCurvePath* curvePath = CHuiCurvePath::NewL(); |
|
59 STIF_ASSERT_NOT_NULL( curvePath ); |
|
60 CleanupStack::PushL( curvePath ); |
|
61 curvePath->SetOrigin( 0 ); |
|
62 TReal32 length = curvePath->Length(); |
|
63 TReal32 aPos = 2; |
|
64 THuiRealPoint aPoint( 3, 3 ); |
|
65 curvePath->Evaluate( aPos, aPoint ); |
|
66 CleanupStack::PopAndDestroy( curvePath ); |
|
67 CHuiDeckLayout* deckLayout = CHuiDeckLayout::AddNewL( *iHuiControl ); |
|
68 STIF_ASSERT_NOT_NULL( deckLayout ); |
|
69 CleanupStack::PushL( deckLayout ); |
|
70 CleanupStack::Pop( 2 ); |
|
71 |
|
72 return KErrNone; |
|
73 |
|
74 } |
|
75 // ----------------------------------------------------------------------------- |
|
76 // CTestUiAifCoreToolkit::TestCHuiDeckLayoutDestructL |
|
77 // ----------------------------------------------------------------------------- |
|
78 // |
|
79 TInt CTestUiAifCoreToolkit::TestCHuiDeckLayoutDestructL( CStifItemParser& /*aItem*/ ) |
|
80 { |
|
81 |
|
82 // Print to UI |
|
83 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
84 _LIT( KTestCHuiDeckLayoutDestructL, "In TestCHuiDeckLayoutDestructL" ); |
|
85 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestCHuiDeckLayoutDestructL ); |
|
86 // Print to log file |
|
87 iLog->Log( KTestCHuiDeckLayoutDestructL ); |
|
88 |
|
89 STIF_ASSERT_NOT_NULL( iHuiEnv ); |
|
90 STIF_ASSERT_NOT_NULL( iHuiControl ); |
|
91 CHuiControl* otherControl = new( ELeave ) CHuiControl( *iHuiEnv ); |
|
92 STIF_ASSERT_NOT_NULL( otherControl ); |
|
93 CleanupStack::PushL( otherControl ); |
|
94 iHuiControl->SetId( 0 ); |
|
95 STIF_ASSERT_NOT_NULL( iHuiControlGroup ); |
|
96 CHuiCurvePath* curvePath = CHuiCurvePath::NewL(); |
|
97 STIF_ASSERT_NOT_NULL( curvePath ); |
|
98 CleanupStack::PushL( curvePath ); |
|
99 curvePath->SetOrigin( 0 ); |
|
100 TReal32 length = curvePath->Length(); |
|
101 TReal32 aPos = 2; |
|
102 THuiRealPoint aPoint( 3, 3 ); |
|
103 curvePath->Evaluate( aPos, aPoint ); |
|
104 CleanupStack::PopAndDestroy( curvePath ); |
|
105 CHuiDeckLayout* deckLayout = CHuiDeckLayout::AddNewL( *iHuiControl ); |
|
106 STIF_ASSERT_NOT_NULL( deckLayout ); |
|
107 CleanupStack::PushL( deckLayout ); |
|
108 CleanupStack::Pop( 2 ); |
|
109 |
|
110 return KErrNone; |
|
111 } |
|
112 |
|
113 // [End of File] |