|
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 EIKCOLIB.H |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // [INCLUDE FILES] |
|
21 #include <e32svr.h> |
|
22 #include <f32file.h> |
|
23 #include <eikcolib.h> |
|
24 #include <akntitle.h> |
|
25 |
|
26 #include "testsdkinitialization.h" |
|
27 |
|
28 // ============================ MEMBER FUNCTIONS =============================== |
|
29 // =========================== CLASS CEikCoCtlLibrary=========================== |
|
30 // ----------------------------------------------------------------------------- |
|
31 // CTestSDKInitialization::TestCCLResourceFile |
|
32 // ----------------------------------------------------------------------------- |
|
33 TInt CTestSDKInitialization::TestCCLResourceFile( CStifItemParser& /*aItem*/ ) |
|
34 { |
|
35 TFileName fileName = CEikCoCtlLibrary::ResourceFile(); |
|
36 _LIT(KFileName,"z:\\resource\\eikcoctl.rsc"); |
|
37 STIF_ASSERT_TRUE( 0 == fileName.Compare( KFileName ) ); |
|
38 |
|
39 return KErrNone; |
|
40 |
|
41 } |
|
42 |
|
43 // ----------------------------------------------------------------------------- |
|
44 // CTestSDKInitialization::TestCCLControlFactory |
|
45 // ----------------------------------------------------------------------------- |
|
46 TInt CTestSDKInitialization::TestCCLControlFactory( CStifItemParser& /*aItem*/ ) |
|
47 { |
|
48 TCreateByTypeFunction function = CEikCoCtlLibrary::ControlFactory(); |
|
49 |
|
50 return KErrNone; |
|
51 |
|
52 } |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // CTestSDKInitialization::TestCCLButtonGroupFactory |
|
56 // ----------------------------------------------------------------------------- |
|
57 TInt CTestSDKInitialization::TestCCLButtonGroupFactory( CStifItemParser& /*aItem*/ ) |
|
58 { |
|
59 TCreateButtonGroupByTypeFunction function = CEikCoCtlLibrary::ButtonGroupFactory(); |
|
60 |
|
61 return KErrNone; |
|
62 |
|
63 } |
|
64 |
|
65 // ----------------------------------------------------------------------------- |
|
66 // CTestSDKInitialization::TestAUFCEikAppUiFactoryL |
|
67 // ----------------------------------------------------------------------------- |
|
68 TInt CTestSDKInitialization::TestAUFCEikAppUiFactoryL( CStifItemParser& /*aItem*/ ) |
|
69 { |
|
70 CEikAppUiFactory* factory = new (ELeave) CEikAppUiFactory; |
|
71 CleanupStack::PushL( factory ); |
|
72 STIF_ASSERT_NOT_NULL( factory ); |
|
73 |
|
74 CleanupStack::PopAndDestroy( factory ); |
|
75 |
|
76 return KErrNone; |
|
77 |
|
78 } |
|
79 |
|
80 // ----------------------------------------------------------------------------- |
|
81 // CTestSDKInitialization::TestAUFTouchPaneL |
|
82 // ----------------------------------------------------------------------------- |
|
83 TInt CTestSDKInitialization::TestAUFTouchPaneL( CStifItemParser& /*aItem*/ ) |
|
84 { |
|
85 CEikAppUiFactory* factory = new (ELeave) CEikAppUiFactory; |
|
86 CleanupStack::PushL( factory ); |
|
87 STIF_ASSERT_NOT_NULL( factory ); |
|
88 |
|
89 CAknTouchPane* pane = factory->TouchPane(); |
|
90 STIF_ASSERT_NULL( pane ); |
|
91 |
|
92 CleanupStack::PopAndDestroy( factory ); |
|
93 |
|
94 return KErrNone; |
|
95 |
|
96 } |
|
97 |
|
98 // ----------------------------------------------------------------------------- |
|
99 // CTestSDKInitialization::TestAUFPopupToolbarL |
|
100 // ----------------------------------------------------------------------------- |
|
101 TInt CTestSDKInitialization::TestAUFPopupToolbarL( CStifItemParser& /*aItem*/ ) |
|
102 { |
|
103 CEikAppUiFactory* factory = new (ELeave) CEikAppUiFactory; |
|
104 CleanupStack::PushL( factory ); |
|
105 STIF_ASSERT_NOT_NULL( factory ); |
|
106 |
|
107 CAknToolbar* toolBar = factory->PopupToolbar(); |
|
108 STIF_ASSERT_NULL( toolBar ); |
|
109 |
|
110 CleanupStack::PopAndDestroy( factory ); |
|
111 |
|
112 return KErrNone; |
|
113 |
|
114 } |
|
115 |
|
116 // ----------------------------------------------------------------------------- |
|
117 // CTestSDKInitialization::TestAUFCurrentPopupToolbarL |
|
118 // ----------------------------------------------------------------------------- |
|
119 TInt CTestSDKInitialization::TestAUFCurrentPopupToolbarL( CStifItemParser& /*aItem*/ ) |
|
120 { |
|
121 CEikAppUiFactory* factory = new (ELeave) CEikAppUiFactory; |
|
122 CleanupStack::PushL( factory ); |
|
123 STIF_ASSERT_NOT_NULL( factory ); |
|
124 |
|
125 CAknToolbar* toolBar = factory->CurrentPopupToolbar(); |
|
126 STIF_ASSERT_NULL( toolBar ); |
|
127 |
|
128 CleanupStack::PopAndDestroy( factory ); |
|
129 |
|
130 return KErrNone; |
|
131 |
|
132 } |
|
133 |
|
134 // ----------------------------------------------------------------------------- |
|
135 // CTestSDKInitialization::TestAUFSetViewPopupToolbarL |
|
136 // ----------------------------------------------------------------------------- |
|
137 TInt CTestSDKInitialization::TestAUFSetViewPopupToolbarL( CStifItemParser& /*aItem*/ ) |
|
138 { |
|
139 CEikAppUiFactory* factory = new (ELeave) CEikAppUiFactory; |
|
140 CleanupStack::PushL( factory ); |
|
141 STIF_ASSERT_NOT_NULL( factory ); |
|
142 |
|
143 CAknToolbar* toolBar = factory->CurrentFixedToolbar(); |
|
144 |
|
145 factory->SetViewPopupToolbar( toolBar ); |
|
146 |
|
147 CleanupStack::PopAndDestroy( factory ); |
|
148 |
|
149 return KErrNone; |
|
150 |
|
151 } |
|
152 |
|
153 // ----------------------------------------------------------------------------- |
|
154 // CTestSDKInitialization::TestAUFCurrentFixedToolbarL |
|
155 // ----------------------------------------------------------------------------- |
|
156 TInt CTestSDKInitialization::TestAUFCurrentFixedToolbarL( CStifItemParser& /*aItem*/ ) |
|
157 { |
|
158 CEikAppUiFactory* factory = new (ELeave) CEikAppUiFactory; |
|
159 CleanupStack::PushL( factory ); |
|
160 STIF_ASSERT_NOT_NULL( factory ); |
|
161 |
|
162 CAknToolbar* toolBar = factory->CurrentFixedToolbar(); |
|
163 STIF_ASSERT_NULL( toolBar ); |
|
164 |
|
165 CleanupStack::PopAndDestroy( factory ); |
|
166 |
|
167 return KErrNone; |
|
168 |
|
169 } |
|
170 |
|
171 // ----------------------------------------------------------------------------- |
|
172 // CTestSDKInitialization::TestAUFSetViewFixedToolbarL |
|
173 // ----------------------------------------------------------------------------- |
|
174 TInt CTestSDKInitialization::TestAUFSetViewFixedToolbarL( CStifItemParser& /*aItem*/ ) |
|
175 { |
|
176 CEikAppUiFactory* factory = new (ELeave) CEikAppUiFactory; |
|
177 CleanupStack::PushL( factory ); |
|
178 STIF_ASSERT_NOT_NULL( factory ); |
|
179 |
|
180 CAknToolbar* toolBar = factory->CurrentFixedToolbar(); |
|
181 |
|
182 factory->SetViewFixedToolbar( toolBar ); |
|
183 |
|
184 CleanupStack::PopAndDestroy( factory ); |
|
185 |
|
186 return KErrNone; |
|
187 |
|
188 } |