|
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 CTestSetStartedCasesContainer |
|
15 * class declaration. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef TESTSETSTARTEDCASESCONTAINER_H |
|
20 #define TESTSETSTARTEDCASESCONTAINER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <coecntrl.h> |
|
24 #include <eiklbo.h> |
|
25 #include <bamdesca.h> // MDesCArray |
|
26 |
|
27 //#include "RRefArray.h" |
|
28 #include <stifinternal/RRefArray.h> |
|
29 |
|
30 |
|
31 // Define *.mbm file name. |
|
32 _LIT(KMbmFileName, "\\Resource\\Apps\\Stifui.mbm"); |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class CEikTextListBox; |
|
36 class CAknSingleGraphicStyleListBox; |
|
37 class CDesC16ArrayFlat; |
|
38 class CStartedTestCase; |
|
39 |
|
40 class CUIStore; |
|
41 class CStartedTestsListBoxModel; |
|
42 |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 * CTestSetStartedCasesContainer container control class. |
|
47 * |
|
48 */ |
|
49 class CTestSetStartedCasesContainer : public CCoeControl /*, MEikListBoxObserver */ /* MCoeControlObserver */ |
|
50 { |
|
51 public: // Constructors and destructor |
|
52 |
|
53 /** |
|
54 * Symbian OS default constructor. |
|
55 * @param aRect Frame rectangle for container. |
|
56 */ |
|
57 void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 ~CTestSetStartedCasesContainer(); |
|
63 |
|
64 public: // New functions |
|
65 |
|
66 /** |
|
67 * Returns reference to currently selected test case in view (listbox). |
|
68 * @return Currently selected test case. |
|
69 */ |
|
70 CStartedTestCase* SelectedTestCase(); |
|
71 |
|
72 /** |
|
73 * Constructs list box model. |
|
74 */ |
|
75 void ConstructListBoxModelL(); |
|
76 |
|
77 /** |
|
78 * Draws the list box. |
|
79 */ |
|
80 void DrawListBox(); |
|
81 |
|
82 /** |
|
83 * Returns count of test cases in view. |
|
84 * @return Count of test cases in view. |
|
85 */ |
|
86 TInt TestsInViewCount(); |
|
87 |
|
88 /** |
|
89 * Handles the addition of an item to the model. |
|
90 */ |
|
91 void HandleItemAdditionL(); |
|
92 |
|
93 /** |
|
94 * Handles the removal of an item from the model. |
|
95 */ |
|
96 void HandleItemRemovalL(); |
|
97 |
|
98 /** |
|
99 * Returns pointer to currently selected test case. |
|
100 * @param Current test case. |
|
101 */ |
|
102 CStartedTestCase* CurrentTestCase(); |
|
103 |
|
104 /** |
|
105 * Gets the index number of the current item in the view. |
|
106 * @return Index number of the current item. |
|
107 */ |
|
108 TInt CurrentItemIndex(); |
|
109 |
|
110 /** |
|
111 * Sets the current item. |
|
112 * @param aIndex Index of the item to make current. |
|
113 */ |
|
114 void SetCurrentItemIndex(TInt aIndex); |
|
115 |
|
116 /** |
|
117 * Resets the selection indices, top and current item indices, |
|
118 * the selection, and the horizontal scroll offset of this list box. |
|
119 * This function does not redraw the list box. |
|
120 */ |
|
121 void ResetListBox(); |
|
122 |
|
123 /** |
|
124 * Removes items from list box. |
|
125 */ |
|
126 void RemoveSelectedExecutionsL(); |
|
127 |
|
128 /** |
|
129 * Removes all started test cases from list box. |
|
130 */ |
|
131 void RemoveAllExecutionsInViewL(); |
|
132 |
|
133 /** |
|
134 * Stores current position of focus of iListBox to the CAppUiAppUi object |
|
135 */ |
|
136 void SaveActiveLine(); |
|
137 |
|
138 private: // New functions |
|
139 |
|
140 public: // Functions from base classes |
|
141 |
|
142 private: // Functions from base classes |
|
143 |
|
144 /** |
|
145 * From CoeControl,SizeChanged. |
|
146 * Called by framework when the view size is changed. |
|
147 */ |
|
148 void SizeChanged(); |
|
149 |
|
150 /** |
|
151 * From CoeControl,CountComponentControls. |
|
152 * Gets a count of the component controls of this list box control. |
|
153 * This information is used for DrawNow(). |
|
154 */ |
|
155 TInt CountComponentControls() const; |
|
156 |
|
157 /** |
|
158 * From CCoeControl,ComponentControl. |
|
159 * Gets a pointer to the specified component control. |
|
160 * @param aIndex Index of the component control to look up. |
|
161 * @return The control at aIndex. |
|
162 */ |
|
163 CCoeControl* ComponentControl(TInt aIndex) const; |
|
164 |
|
165 /** |
|
166 * From CCoeControl,Draw. |
|
167 * Draw a control, called by window server. |
|
168 * @param aRect The region of the control to be redrawn. Co-ordinates |
|
169 * are relative to the control's origin (top left corner). |
|
170 */ |
|
171 void Draw(const TRect& aRect) const; |
|
172 |
|
173 /** |
|
174 * From CCoeControl,OfferKeyEventL |
|
175 * Handles key events. |
|
176 * @param aKeyEvent The key event. |
|
177 * @param aType The type of key event. |
|
178 * @return Indicates whether or not the key event was used |
|
179 * by this control. |
|
180 */ |
|
181 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
182 |
|
183 private: //data |
|
184 |
|
185 CEikTextListBox* iListBox; |
|
186 CStartedTestsListBoxModel* iListBoxModel; |
|
187 RRefArray<CStartedTestCase> iStartedTestsPtrs; |
|
188 CUIStore* iUIStore; |
|
189 }; |
|
190 |
|
191 #endif // CTestSetStartedCasesCONTAINER_H |
|
192 |
|
193 // End of File |