|
1 /* |
|
2 * Copyright (c) 2006 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: view class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <aknviewappui.h> |
|
20 |
|
21 #include <bctestlist.rsg> |
|
22 #include "bctestlistview.h" |
|
23 #include "bctestlistcontainer.h" |
|
24 #include "bctestlist.hrh" |
|
25 #include "bctestutil.h" |
|
26 #include "bctestlistcolumncase.h" |
|
27 #include "bctestlistformattedcase.h" |
|
28 #include "bctestlistsettingcase.h" |
|
29 #include "bctestlistpopupcase.h" |
|
30 #include "bctestlistgridcase.h" |
|
31 #include "bctestlistdecoratorcase.h" |
|
32 #include "bctestlistcolumnbasecase.h" |
|
33 #include "bctestlistformatbasecase.h" |
|
34 #include "bctestlisteiklistcase.h" |
|
35 #include "bctestlistselectioncase.h" |
|
36 |
|
37 _LIT( KColumnListCase, "Column Lists" ); |
|
38 _LIT( KFormattedCase, "Formatted Lists" ); |
|
39 _LIT( KSettingListCase, "Settings Lists" ); |
|
40 _LIT( KPopupCase, "Popup Lists" ); |
|
41 _LIT( KGridCase, "Grid pane Lists" ); |
|
42 _LIT( KDecoratorCase, "Decorator test case" ); |
|
43 _LIT( KColumnBaseCase, "Eikon column list" ); |
|
44 _LIT( KFormattedBaseCase, "Eikon formatted cell list" ); |
|
45 _LIT( KEikListCase, "Eikon list box" ); |
|
46 _LIT( KSelectionListCase, "Selection list" ); |
|
47 |
|
48 // ======== MEMBER FUNCTIONS ======== |
|
49 |
|
50 // --------------------------------------------------------------------------- |
|
51 // Symbian 2nd static Constructor |
|
52 // --------------------------------------------------------------------------- |
|
53 // |
|
54 CBCTestListView* CBCTestListView::NewL() |
|
55 { |
|
56 CBCTestListView* self = new( ELeave ) CBCTestListView(); |
|
57 CleanupStack::PushL( self ); |
|
58 self->ConstructL(); |
|
59 CleanupStack::Pop( self ); |
|
60 return self; |
|
61 } |
|
62 |
|
63 // --------------------------------------------------------------------------- |
|
64 // C++ default Constructor |
|
65 // --------------------------------------------------------------------------- |
|
66 // |
|
67 CBCTestListView::CBCTestListView() |
|
68 { |
|
69 } |
|
70 |
|
71 // --------------------------------------------------------------------------- |
|
72 // Symbian 2nd Constructor |
|
73 // --------------------------------------------------------------------------- |
|
74 // |
|
75 void CBCTestListView::ConstructL() |
|
76 { |
|
77 BaseConstructL( R_BCTESTLIST_VIEW ); |
|
78 |
|
79 iContainer = new( ELeave ) CBCTestListContainer(); |
|
80 iContainer->SetMopParent( this ); |
|
81 iContainer->ConstructL( ClientRect() ); |
|
82 iContainer->MakeVisible( ETrue ); |
|
83 |
|
84 CEikonEnv* eikEnv = CEikonEnv::Static(); |
|
85 iTestUtil = CBCTestUtil::NewL(); |
|
86 iTestUtil->AddTestCaseL( |
|
87 CBCTestListColumnCase::NewL( iContainer, eikEnv ), |
|
88 KColumnListCase ); |
|
89 iTestUtil->AddTestCaseL( |
|
90 CBCTestListFormattedCase::NewL( iContainer, eikEnv ), |
|
91 KFormattedCase ); |
|
92 iTestUtil->AddTestCaseL( |
|
93 CBCTestListSettingCase::NewL( iContainer, eikEnv ), |
|
94 KSettingListCase ); |
|
95 iTestUtil->AddTestCaseL( |
|
96 CBCTestListPopupCase::NewL( iContainer, eikEnv ), |
|
97 KPopupCase ); |
|
98 iTestUtil->AddTestCaseL( |
|
99 CBCTestListGridCase::NewL( iContainer, eikEnv ), |
|
100 KGridCase ); |
|
101 iTestUtil->AddTestCaseL( |
|
102 CBCTestListDecoratorCase::NewL( iContainer, eikEnv ), |
|
103 KDecoratorCase ); |
|
104 iTestUtil->AddTestCaseL( |
|
105 CBCTestListColumnBaseCase::NewL( iContainer, eikEnv ), |
|
106 KColumnBaseCase ); |
|
107 iTestUtil->AddTestCaseL( |
|
108 CBCTestListFormatBaseCase::NewL( iContainer, eikEnv ), |
|
109 KFormattedBaseCase ); |
|
110 iTestUtil->AddTestCaseL( |
|
111 CBCTestListEiklistCase::NewL( iContainer, eikEnv ), |
|
112 KEikListCase ); |
|
113 iTestUtil->AddTestCaseL( |
|
114 CBCTestListSelectionCase::NewL( iContainer, eikEnv ), |
|
115 KSelectionListCase ); |
|
116 } |
|
117 |
|
118 // --------------------------------------------------------------------------- |
|
119 // Destructor |
|
120 // --------------------------------------------------------------------------- |
|
121 // |
|
122 CBCTestListView::~CBCTestListView() |
|
123 { |
|
124 delete iTestUtil; |
|
125 delete iContainer; |
|
126 } |
|
127 |
|
128 // --------------------------------------------------------------------------- |
|
129 // CBCTestListView::Id |
|
130 // --------------------------------------------------------------------------- |
|
131 // |
|
132 TUid CBCTestListView::Id() const |
|
133 { |
|
134 return KBCTestListViewId; |
|
135 } |
|
136 |
|
137 // --------------------------------------------------------------------------- |
|
138 // CBCTestListView::DoActivateL |
|
139 // --------------------------------------------------------------------------- |
|
140 // |
|
141 void CBCTestListView::DoActivateL( const TVwsViewId&, TUid, const TDesC8& ) |
|
142 { |
|
143 } |
|
144 |
|
145 // --------------------------------------------------------------------------- |
|
146 // CBCTestListView::DoDeactivate |
|
147 // --------------------------------------------------------------------------- |
|
148 // |
|
149 void CBCTestListView::DoDeactivate() |
|
150 { |
|
151 } |
|
152 |
|
153 // --------------------------------------------------------------------------- |
|
154 // CBCTestListView::Container |
|
155 // --------------------------------------------------------------------------- |
|
156 // |
|
157 CBCTestListContainer* CBCTestListView::Container() |
|
158 { |
|
159 return iContainer; |
|
160 } |
|
161 |
|
162 // --------------------------------------------------------------------------- |
|
163 // CBCTestListView::HandleCommandL |
|
164 // --------------------------------------------------------------------------- |
|
165 // |
|
166 void CBCTestListView::HandleCommandL( TInt aCommand ) |
|
167 { |
|
168 switch ( aCommand ) |
|
169 { |
|
170 case EProgCmdAutoTest: |
|
171 iTestUtil->RunL(); |
|
172 break; |
|
173 default: |
|
174 if ( aCommand > EBCTestCmdEmptyOutline && |
|
175 aCommand < EProgSoftkeyNextOutline ) |
|
176 { |
|
177 iTestUtil->RunL( aCommand ); |
|
178 } |
|
179 break; |
|
180 } |
|
181 } |