|
1 /* |
|
2 * Copyright (c) 2008 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 aknscbut.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // [INCLUDE FILES] |
|
20 #include <aknscbut.h> |
|
21 |
|
22 #include "testsdkscroller.h" |
|
23 #include "testsdkscrollercontrol.h" |
|
24 |
|
25 // CONSTANTS |
|
26 const TInt KScrollSpan = 9; |
|
27 |
|
28 // ============================ MEMBER FUNCTIONS =============================== |
|
29 |
|
30 // ----------------------------------------------------------------------------- |
|
31 // CTestSDKScroller::TestSDKAknScbNewL |
|
32 // ----------------------------------------------------------------------------- |
|
33 // |
|
34 TInt CTestSDKScroller::TestSDKAknScbNewL( CStifItemParser& /*aItem*/ ) |
|
35 { |
|
36 |
|
37 // Print to UI |
|
38 _LIT( KTestSDKScroller, "testsdkscroller" ); |
|
39 _LIT( KTestSDKAknScbNewL, "in AknScButNewL" ); |
|
40 TestModuleIf().Printf( 0, KTestSDKScroller, KTestSDKAknScbNewL ); |
|
41 // Print to log file |
|
42 iLog->Log( KTestSDKAknScbNewL ); |
|
43 |
|
44 CAknScrollButton::TType type = CAknScrollButton::ENudgeLeft; |
|
45 CAknScrollButton* scButton = CAknScrollButton::NewL( type ); |
|
46 CleanupStack::PushL( scButton ); |
|
47 STIF_ASSERT_NOT_NULL( scButton ); |
|
48 |
|
49 CleanupStack::PopAndDestroy( scButton ); |
|
50 return KErrNone; |
|
51 |
|
52 } |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // CTestSDKScroller::TestSDKAknScbNewLWithScBarL |
|
56 // ----------------------------------------------------------------------------- |
|
57 // |
|
58 TInt CTestSDKScroller::TestSDKAknScbNewLWithScBarL( CStifItemParser& /*aItem*/ ) |
|
59 { |
|
60 |
|
61 // Print to UI |
|
62 _LIT( KTestSDKScroller, "testsdkscroller" ); |
|
63 _LIT( KTestSDKAknScbNewLWithScBarL, "in AknScButNewLWithScBarL" ); |
|
64 TestModuleIf().Printf( 0, KTestSDKScroller, KTestSDKAknScbNewLWithScBarL ); |
|
65 // Print to log file |
|
66 iLog->Log( KTestSDKAknScbNewLWithScBarL ); |
|
67 |
|
68 CAknScrollButton::TType type = CAknScrollButton::ENudgeLeft; |
|
69 CAknScrollButton::TTypeOfScrollBar scType = CAknScrollButton::ENormal; |
|
70 |
|
71 CAknScrollButton* scButton = CAknScrollButton::NewL( type, scType ); |
|
72 CleanupStack::PushL( scButton ); |
|
73 STIF_ASSERT_NOT_NULL( scButton ); |
|
74 |
|
75 CleanupStack::PopAndDestroy( scButton ); |
|
76 return KErrNone; |
|
77 |
|
78 } |
|
79 |
|
80 // ----------------------------------------------------------------------------- |
|
81 // CTestSDKScroller::TestSDKAknScbTypeL |
|
82 // ----------------------------------------------------------------------------- |
|
83 // |
|
84 TInt CTestSDKScroller::TestSDKAknScbTypeL( CStifItemParser& /*aItem*/ ) |
|
85 { |
|
86 |
|
87 // Print to UI |
|
88 _LIT( KTestSDKScroller, "testsdkscroller" ); |
|
89 _LIT( KTestSDKAknScbType, "in AknScButType" ); |
|
90 TestModuleIf().Printf( 0, KTestSDKScroller, KTestSDKAknScbType ); |
|
91 // Print to log file |
|
92 iLog->Log( KTestSDKAknScbType ); |
|
93 |
|
94 CAknScrollButton::TType type = CAknScrollButton::ENudgeLeft; |
|
95 CAknScrollButton* scButton = CAknScrollButton::NewL( type ); |
|
96 CleanupStack::PushL( scButton ); |
|
97 |
|
98 CAknScrollButton::TType scButType = scButton->Type(); |
|
99 STIF_ASSERT_EQUALS( type, scButType ); |
|
100 |
|
101 CleanupStack::PopAndDestroy( scButton ); |
|
102 return KErrNone; |
|
103 |
|
104 } |
|
105 |
|
106 // ----------------------------------------------------------------------------- |
|
107 // CTestSDKScroller::TestSDKAknScbCreWinOnlyForArrsL |
|
108 // ----------------------------------------------------------------------------- |
|
109 // |
|
110 TInt CTestSDKScroller::TestSDKAknScbCreWinOnlyForArrsL( CStifItemParser& /*aItem*/ ) |
|
111 { |
|
112 |
|
113 // Print to UI |
|
114 _LIT( KTestSDKScroller, "testsdkscroller" ); |
|
115 _LIT( KTestSDKAknScbCreWinOnlyForArrsL, "in AknScButCreWinOnlyForArrsL" ); |
|
116 TestModuleIf().Printf( 0, KTestSDKScroller, KTestSDKAknScbCreWinOnlyForArrsL ); |
|
117 // Print to log file |
|
118 iLog->Log( KTestSDKAknScbCreWinOnlyForArrsL ); |
|
119 |
|
120 CAknScrollButton::TType type = CAknScrollButton::ENudgeLeft; |
|
121 CAknScrollButton* scButton = CAknScrollButton::NewL( type ); |
|
122 CleanupStack::PushL( scButton ); |
|
123 CTestScrollerControl* control = CTestScrollerControl::NewL(); |
|
124 CleanupStack::PushL( control ); |
|
125 |
|
126 scButton->CreateWindowOnlyForArrowsL( control ); |
|
127 |
|
128 CleanupStack::PopAndDestroy( control ); |
|
129 CleanupStack::PopAndDestroy( scButton ); |
|
130 return KErrNone; |
|
131 |
|
132 } |
|
133 |
|
134 // ----------------------------------------------------------------------------- |
|
135 // CTestSDKScroller::TestSDKAknScbIsNormalSbUsingButL |
|
136 // ----------------------------------------------------------------------------- |
|
137 // |
|
138 TInt CTestSDKScroller::TestSDKAknScbIsNormalSbUsingButL( CStifItemParser& /*aItem*/ ) |
|
139 { |
|
140 |
|
141 // Print to UI |
|
142 _LIT( KTestSDKScroller, "testsdkscroller" ); |
|
143 _LIT( KTestSDKAknScbIsNormalSbUsingBut, "in AknScButIsNormalSbUsingBut" ); |
|
144 TestModuleIf().Printf( 0, KTestSDKScroller, KTestSDKAknScbIsNormalSbUsingBut ); |
|
145 // Print to log file |
|
146 iLog->Log( KTestSDKAknScbIsNormalSbUsingBut ); |
|
147 |
|
148 CAknScrollButton::TType type = CAknScrollButton::ENudgeLeft; |
|
149 CAknScrollButton* scButton = CAknScrollButton::NewL( type ); |
|
150 CleanupStack::PushL( scButton ); |
|
151 |
|
152 scButton->IsNormalScrollBarUsingButton(); |
|
153 |
|
154 CleanupStack::PopAndDestroy( scButton ); |
|
155 return KErrNone; |
|
156 |
|
157 } |
|
158 |
|
159 // ----------------------------------------------------------------------------- |
|
160 // CTestSDKScroller::TestSDKAknScbSetTypeOfSbUsingButL |
|
161 // ----------------------------------------------------------------------------- |
|
162 // |
|
163 TInt CTestSDKScroller::TestSDKAknScbSetTypeOfSbUsingButL( CStifItemParser& /*aItem*/ ) |
|
164 { |
|
165 |
|
166 // Print to UI |
|
167 _LIT( KTestSDKScroller, "testsdkscroller" ); |
|
168 _LIT( KTestSDKAknScbSetTypeOfSbUsingBut, "in AknScButSetTypeOfSbUsingBut" ); |
|
169 TestModuleIf().Printf( 0, KTestSDKScroller, KTestSDKAknScbSetTypeOfSbUsingBut ); |
|
170 // Print to log file |
|
171 iLog->Log( KTestSDKAknScbSetTypeOfSbUsingBut ); |
|
172 |
|
173 CAknScrollButton::TType type = CAknScrollButton::ENudgeLeft; |
|
174 CAknScrollButton* scButton = CAknScrollButton::NewL( type ); |
|
175 CleanupStack::PushL( scButton ); |
|
176 |
|
177 CAknScrollButton::TTypeOfScrollBar scType = CAknScrollButton::ENormal; |
|
178 scButton->SetTypeOfScrollBarUsingButton( scType ); |
|
179 |
|
180 CleanupStack::PopAndDestroy( scButton ); |
|
181 return KErrNone; |
|
182 |
|
183 } |
|
184 |
|
185 // ----------------------------------------------------------------------------- |
|
186 // CTestSDKScroller::TestSDKAknScbSetPositionL |
|
187 // ----------------------------------------------------------------------------- |
|
188 // |
|
189 TInt CTestSDKScroller::TestSDKAknScbSetPositionL( CStifItemParser& /*aItem*/ ) |
|
190 { |
|
191 |
|
192 // Print to UI |
|
193 _LIT( KTestSDKScroller, "testsdkscroller" ); |
|
194 _LIT( KTestSDKAknScbSetPosition, "in AknScButSetPosition" ); |
|
195 TestModuleIf().Printf( 0, KTestSDKScroller, KTestSDKAknScbSetPosition ); |
|
196 // Print to log file |
|
197 iLog->Log( KTestSDKAknScbSetPosition ); |
|
198 |
|
199 CAknScrollButton::TType type = CAknScrollButton::ENudgeLeft; |
|
200 CAknScrollButton* scButton = CAknScrollButton::NewL( type ); |
|
201 CleanupStack::PushL( scButton ); |
|
202 |
|
203 TInt focusPosition = 0; |
|
204 scButton->SetPosition( focusPosition, KScrollSpan ); |
|
205 |
|
206 CleanupStack::PopAndDestroy( scButton ); |
|
207 return KErrNone; |
|
208 |
|
209 } |
|
210 |
|
211 |
|
212 // [End of File] |