1 /* |
|
2 * Copyright (c) 2009 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: This file contains CTestCaseListBoxModel class |
|
15 * declaration |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef CCONTAINER_H |
|
20 #define CCONTAINER_H |
|
21 |
|
22 #include <e32std.h> |
|
23 // Define *.mbm file name. |
|
24 _LIT(KListMbmFileName, "\\Resource\\Apps\\Stifui.mbm"); |
|
25 |
|
26 // INCLUDES |
|
27 #include "View.h" |
|
28 |
|
29 #include <coecntrl.h> |
|
30 #include <eiklbo.h> // MEikListBoxObserver |
|
31 #include <bamdesca.h> // MDesCArray |
|
32 #include <aknsfld.h> |
|
33 |
|
34 //#include "RRefArray.h" |
|
35 //#include "UIEngine.h" |
|
36 //#include "UIStoreIf.h" |
|
37 //#include "UIStoreContainer.h" |
|
38 |
|
39 #include <stifinternal/RRefArray.h> |
|
40 #include <stifinternal/UIEngine.h> |
|
41 #include <stifinternal/UIStoreIf.h> |
|
42 #include <stifinternal/UIStoreContainer.h> |
|
43 |
|
44 // FORWARD DECLARATIONS |
|
45 class CEikTextListBox; |
|
46 class CDesC16Array; |
|
47 |
|
48 //class CTestSetInsertMenuView; |
|
49 class CEikColumnListBox; |
|
50 class CStartedTestCase; |
|
51 |
|
52 class CUIStoreHandler; |
|
53 class CUIStore; |
|
54 class CUIStoreIf; |
|
55 class CUIEngineContainer; |
|
56 class CUIEngine; |
|
57 |
|
58 // CLASS DECLARATION |
|
59 |
|
60 class CTestCaseListBoxModel : public CBase, public MDesCArray |
|
61 { |
|
62 public: |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 ~CTestCaseListBoxModel(); |
|
67 |
|
68 /** |
|
69 * Two-phased constructor. |
|
70 * @param aTestCasesInView Array of test cases in view. |
|
71 * @return Pointer to created list box model. |
|
72 */ |
|
73 static CTestCaseListBoxModel* NewL( |
|
74 RPointerArray<CTestInfo>* aTestCasesInView); |
|
75 |
|
76 public: // Functions from base classes |
|
77 |
|
78 /** |
|
79 * Returns the number of descriptor elements in the array. |
|
80 * @return The number of descriptor elements. |
|
81 */ |
|
82 virtual TInt MdcaCount() const; |
|
83 |
|
84 /** |
|
85 * Indexes into a descriptor array. |
|
86 * @param aIndex The position of the descriptor element within the |
|
87 * array. The position is relative to zero; i.e. zero |
|
88 * implies the first descriptor element in the array. |
|
89 * This value must be non-negative and less than the |
|
90 * number of descriptors currently within the array |
|
91 * otherwise the operator panics with |
|
92 * EArrayIndexOutOfRange. |
|
93 * @return A non-modifiable pointer descriptor representing the |
|
94 * descriptor element located at position aIndex within |
|
95 * the array. |
|
96 */ |
|
97 virtual TPtrC MdcaPoint(TInt aIndex) const; |
|
98 |
|
99 protected: |
|
100 /** |
|
101 * Symbian OS two phased constructor. |
|
102 * Completes the construction of the object. |
|
103 */ |
|
104 void ConstructL(); |
|
105 |
|
106 protected: //data |
|
107 RPointerArray<CTestInfo>* iTestCasesInView; |
|
108 HBufC* iBuffer; |
|
109 |
|
110 private: //data |
|
111 |
|
112 }; |
|
113 |
|
114 /** |
|
115 * CContainer container control class. |
|
116 * |
|
117 */ |
|
118 class CContainer : public CCoeControl |
|
119 { |
|
120 public: // Constructors and destructor |
|
121 |
|
122 /** |
|
123 * Symbian OS default constructor. |
|
124 * @param aRect Frame rectangle for container. |
|
125 */ |
|
126 void ConstructL(); |
|
127 |
|
128 /** |
|
129 * Destructor. |
|
130 */ |
|
131 ~CContainer(); |
|
132 |
|
133 public: // New functions |
|
134 |
|
135 /** |
|
136 * Show only testcases which are defined is specified module. |
|
137 * @param aModuleName Module which test cases are shown. |
|
138 */ |
|
139 virtual void FilterCasesByModuleL(TName aModuleName); |
|
140 |
|
141 /** |
|
142 * Show only testcases which are defined in specified test case file. |
|
143 * @param aTestCaseFileName Test cases file name. |
|
144 */ |
|
145 virtual void FilterCasesByTCFileNameL(TFileName aTestCaseFileName); |
|
146 |
|
147 /** |
|
148 * Remove possible filtering of test cases -> show all test cases. |
|
149 */ |
|
150 virtual void NoFilteringL(); |
|
151 |
|
152 /** |
|
153 * Returns pointers to selected test cases. |
|
154 * @param aSelectedTestCases Currently selected test case. |
|
155 */ |
|
156 virtual void SelectedTestCases(RPointerArray<CTestInfo>& aSelectedTestCases); |
|
157 |
|
158 /** |
|
159 * Sets graphic icon using listbox as CEikColumnListBox. |
|
160 * @param aListBox Pointer to list box. |
|
161 */ |
|
162 virtual void SetGraphicIconL( CEikColumnListBox* aListBox ); |
|
163 |
|
164 /** |
|
165 * Appends graphics data. |
|
166 * @param aIcons Pointer array of icons. |
|
167 */ |
|
168 virtual void GraphicIconL( CArrayPtr<CGulIcon>* aIcons ); |
|
169 |
|
170 /** |
|
171 * Gets the index number of the current item in the view. |
|
172 * @return Index number of the current item. |
|
173 */ |
|
174 virtual TInt CurrentItemIndex(); |
|
175 |
|
176 /** |
|
177 * Sets the current item. |
|
178 * @param aIndex Index of the item to make current. |
|
179 */ |
|
180 virtual void SetCurrentItemIndex(TInt aCurrentTestCase); |
|
181 |
|
182 /** |
|
183 * Inline function for getting pointer to list box. |
|
184 * @return Pointer to list box. |
|
185 */ |
|
186 virtual inline CEikListBox* ListBox() { return (CEikListBox*)iListBox; }; |
|
187 |
|
188 |
|
189 |
|
190 /** |
|
191 * Processes user commands. |
|
192 * @param aCommand ID of the command to respond to. |
|
193 */ |
|
194 virtual void ProcessCommandL( TInt aCommand ); |
|
195 |
|
196 /** |
|
197 * Processes user commands. |
|
198 * @param aCommand ID of the command to respond to. |
|
199 */ |
|
200 virtual void SelectionListProcessCommandL( TInt aCommand ); |
|
201 |
|
202 /** |
|
203 * Handles mark commands. |
|
204 * @param aCommand ID of the command to respond to. |
|
205 */ |
|
206 virtual void HandleMarkCommandL( TInt aCommand ); |
|
207 |
|
208 |
|
209 |
|
210 public: // Functions from base classes |
|
211 |
|
212 private: // Functions from base classes |
|
213 |
|
214 /** |
|
215 * From CoeControl,SizeChanged. |
|
216 * Called by framework when the view size is changed. |
|
217 */ |
|
218 virtual void SizeChanged(); |
|
219 |
|
220 |
|
221 |
|
222 |
|
223 /** |
|
224 * From CoeControl,CountComponentControls. |
|
225 * Gets a count of the component controls of this list box control. |
|
226 * This information is used for DrawNow(). |
|
227 */ |
|
228 virtual TInt CountComponentControls() const; |
|
229 |
|
230 /** |
|
231 * From CCoeControl,ComponentControl. |
|
232 * Gets a pointer to the specified component control. |
|
233 * @param aIndex Index of the component control to look up. |
|
234 * @return The control at aIndex. |
|
235 */ |
|
236 virtual CCoeControl* ComponentControl(TInt aIndex) const; |
|
237 |
|
238 |
|
239 |
|
240 /** |
|
241 * From CCoeControl,Draw. |
|
242 * Draw a control, called by window server. |
|
243 * @param aRect The region of the control to be redrawn. Co-ordinates |
|
244 * are relative to the control's origin (top left corner). |
|
245 */ |
|
246 virtual void Draw(const TRect& aRect) const; |
|
247 |
|
248 protected: //data |
|
249 |
|
250 CView* iParentView; |
|
251 CEikColumnListBox* iListBox; |
|
252 //CEikTextListBox* iListBox; |
|
253 CTestCaseListBoxModel* iListBoxModel; |
|
254 RPointerArray<CTestInfo> iTestCasesInView; |
|
255 CUIStore* iUIStore; |
|
256 |
|
257 private: //data |
|
258 |
|
259 }; |
|
260 |
|
261 #endif // CTestSetInsertMenuContainer_H |
|
262 |
|
263 // End of File |
|