|
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 api of alf_core_toolkit |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // [INCLUDE FILES] |
|
20 #include <e32svr.h> |
|
21 #include <gdi.h> |
|
22 #include <stifparser.h> |
|
23 #include <stiftestinterface.h> |
|
24 #include <uiacceltk/huienv.h> |
|
25 #include <uiacceltk/huistatic.h> |
|
26 #include <uiacceltk/huidisplaycoecontrol.h> |
|
27 |
|
28 #include "testuiaifcoretoolkit.h" |
|
29 |
|
30 //this for testing the CHuiDisplayCoeControl class |
|
31 class CHuiDisplayCoeControlImp : public CHuiDisplayCoeControl |
|
32 { |
|
33 public: |
|
34 /** |
|
35 * test for HanlePointerEventL |
|
36 */ |
|
37 void TestHandlePointerEventL() |
|
38 { |
|
39 |
|
40 TPointerEvent event; |
|
41 HandlePointerEventL( event ); |
|
42 } |
|
43 |
|
44 /** |
|
45 * test for DisplayCoeCntrlExtension |
|
46 */ |
|
47 void TestDisplayCoeCntrlExtension() |
|
48 { |
|
49 TUid uid; |
|
50 TBool temp = ETrue; |
|
51 TAny *temp1 = &temp; |
|
52 TAny** any = &temp1; |
|
53 DisplayCoeCntrlExtension( uid, any); |
|
54 } |
|
55 }; |
|
56 |
|
57 // ----------------------------------------------------------------------------- |
|
58 // CTestUiAifCoreToolkit::TestTTHuiCCNewLL |
|
59 // ----------------------------------------------------------------------------- |
|
60 // |
|
61 TInt CTestUiAifCoreToolkit::TestTTHuiCCNewLL( CStifItemParser& /*aItem*/ ) |
|
62 { |
|
63 |
|
64 // Print to UI |
|
65 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
66 _LIT( KTestTHuiEnvL, "In TestTTHuiCCNewLL" ); |
|
67 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestTHuiEnvL ); |
|
68 // Print to log file |
|
69 iLog->Log( KTestTHuiEnvL ); |
|
70 |
|
71 CHuiDisplayCoeControl *displayControl = |
|
72 CHuiDisplayCoeControl::NewL( *iHuiEnv, iDisplayRect ); |
|
73 delete displayControl; |
|
74 |
|
75 return KErrNone; |
|
76 |
|
77 } |
|
78 |
|
79 // ----------------------------------------------------------------------------- |
|
80 // CTestUiAifCoreToolkit::TestTTHuiCCNewLCL |
|
81 // ----------------------------------------------------------------------------- |
|
82 // |
|
83 TInt CTestUiAifCoreToolkit::TestTTHuiCCNewLCL( CStifItemParser& /*aItem*/ ) |
|
84 { |
|
85 |
|
86 // Print to UI |
|
87 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
88 _LIT( KTestTTHuiCCNewLCL, "In TestTTHuiCCNewLCL" ); |
|
89 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestTTHuiCCNewLCL ); |
|
90 // Print to log file |
|
91 iLog->Log( KTestTTHuiCCNewLCL ); |
|
92 |
|
93 CHuiDisplayCoeControl *displayControl = |
|
94 CHuiDisplayCoeControl::NewLC( *iHuiEnv, iDisplayRect ); |
|
95 CleanupStack::PopAndDestroy( displayControl ); |
|
96 |
|
97 return KErrNone; |
|
98 |
|
99 } |
|
100 |
|
101 // ----------------------------------------------------------------------------- |
|
102 // CTestUiAifCoreToolkit::TestTTHuiCCEnvL |
|
103 // ----------------------------------------------------------------------------- |
|
104 // |
|
105 TInt CTestUiAifCoreToolkit::TestTTHuiCCEnvL( CStifItemParser& /*aItem*/ ) |
|
106 { |
|
107 |
|
108 // Print to UI |
|
109 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
110 _LIT( KTestTTHuiCCEnvL, "In TestTTHuiCCEnvL" ); |
|
111 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestTTHuiCCEnvL ); |
|
112 // Print to log file |
|
113 iLog->Log( KTestTTHuiCCEnvL ); |
|
114 |
|
115 CHuiDisplayCoeControl *displayControl = |
|
116 CHuiDisplayCoeControl::NewL( *iHuiEnv, iDisplayRect ); |
|
117 CleanupStack::PushL( displayControl ); |
|
118 displayControl->Env(); |
|
119 |
|
120 CleanupStack::PopAndDestroy( displayControl ); |
|
121 |
|
122 return KErrNone; |
|
123 |
|
124 } |
|
125 |
|
126 // ----------------------------------------------------------------------------- |
|
127 // CTestUiAifCoreToolkit::TestTTHuiCCDisplayL |
|
128 // ----------------------------------------------------------------------------- |
|
129 // |
|
130 TInt CTestUiAifCoreToolkit::TestTTHuiCCDisplayL( CStifItemParser& /*aItem*/ ) |
|
131 { |
|
132 |
|
133 // Print to UI |
|
134 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
135 _LIT( KTestTTHuiCCDisplayL, "In TestTTHuiCCDisplayL" ); |
|
136 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestTTHuiCCDisplayL ); |
|
137 // Print to log file |
|
138 iLog->Log( KTestTTHuiCCDisplayL ); |
|
139 |
|
140 CHuiDisplayCoeControl *displayControl = |
|
141 CHuiDisplayCoeControl::NewL( *iHuiEnv, iDisplayRect ); |
|
142 CleanupStack::PushL( displayControl ); |
|
143 displayControl->Display(); |
|
144 |
|
145 CleanupStack::PopAndDestroy( displayControl ); |
|
146 |
|
147 return KErrNone; |
|
148 |
|
149 } |
|
150 |
|
151 // ----------------------------------------------------------------------------- |
|
152 // CTestUiAifCoreToolkit::TestTTHuiCCHandlePointerEventL |
|
153 // ----------------------------------------------------------------------------- |
|
154 // |
|
155 TInt CTestUiAifCoreToolkit::TestTTHuiCCHandlePointerEventL( CStifItemParser& /*aItem*/ ) |
|
156 { |
|
157 |
|
158 // Print to UI |
|
159 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
160 _LIT( KTestTTHuiCCHandlePointerEventL, "In TestTTHuiCCHandlePointerEventL" ); |
|
161 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
162 KTestTTHuiCCHandlePointerEventL ); |
|
163 // Print to log file |
|
164 iLog->Log( KTestTTHuiCCHandlePointerEventL ); |
|
165 |
|
166 CHuiDisplayCoeControlImp *displayControl = |
|
167 ( CHuiDisplayCoeControlImp* )CHuiDisplayCoeControlImp::NewL( |
|
168 *iHuiEnv, iDisplayRect ); |
|
169 CleanupStack::PushL( displayControl ); |
|
170 displayControl->TestHandlePointerEventL(); |
|
171 |
|
172 CleanupStack::PopAndDestroy( displayControl ); |
|
173 |
|
174 return KErrNone; |
|
175 |
|
176 } |
|
177 |
|
178 // ----------------------------------------------------------------------------- |
|
179 // CTestUiAifCoreToolkit::TestTTHuiCCDisplayCoeCntrlExtensionL |
|
180 // ----------------------------------------------------------------------------- |
|
181 // |
|
182 TInt CTestUiAifCoreToolkit::TestTTHuiCCDisplayCoeCntrlExtensionL( CStifItemParser& /*aItem*/ ) |
|
183 { |
|
184 |
|
185 // Print to UI |
|
186 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
187 _LIT( KTestTTHuiCCDisplayCoeCntrlExtensionL, |
|
188 "In TestTTHuiCCDisplayCoeCntrlExtensionL" ); |
|
189 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
190 KTestTTHuiCCDisplayCoeCntrlExtensionL ); |
|
191 // Print to log file |
|
192 iLog->Log( KTestTTHuiCCDisplayCoeCntrlExtensionL ); |
|
193 |
|
194 CHuiDisplayCoeControlImp *displayControl = |
|
195 ( CHuiDisplayCoeControlImp* )CHuiDisplayCoeControlImp::NewL( |
|
196 *iHuiEnv, iDisplayRect ); |
|
197 CleanupStack::PushL( displayControl ); |
|
198 displayControl->TestDisplayCoeCntrlExtension(); |
|
199 |
|
200 CleanupStack::PopAndDestroy( displayControl ); |
|
201 |
|
202 return KErrNone; |
|
203 |
|
204 } |
|
205 |
|
206 // [End of File] |