|
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 CTestModulesListBoxModel class |
|
15 * declaration. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef CTESTMODULESMENUCONTAINER_H |
|
20 #define CTESTMODULESMENUCONTAINER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <coecntrl.h> |
|
24 #include <eiklbo.h> |
|
25 |
|
26 // #include "RRefArray.h" |
|
27 #include <stifinternal/RRefArray.h> |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CEikTextListBox; |
|
31 class CUIStore; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 class CTestModulesListBoxModel : public CBase, public MDesCArray |
|
35 { |
|
36 public: |
|
37 /** |
|
38 * Destructor. |
|
39 */ |
|
40 ~CTestModulesListBoxModel(); |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 * @param aTestModules Array of test modules names. |
|
45 * @return Pointer to created list box model. |
|
46 */ |
|
47 static CTestModulesListBoxModel* NewL(RRefArray<TDesC> aTestModules); |
|
48 |
|
49 public: // Functions from base classes |
|
50 |
|
51 /** |
|
52 * Returns the number of descriptor elements in the array. |
|
53 * @return The number of descriptor elements. |
|
54 */ |
|
55 TInt MdcaCount() const; |
|
56 |
|
57 /** |
|
58 * Indexes into a descriptor array. |
|
59 * @param aIndex The position of the descriptor element within the |
|
60 * array. The position is relative to zero; i.e. zero |
|
61 * implies the first descriptor element in the array. |
|
62 * This value must be non-negative and less than the |
|
63 * number of descriptors currently within the array |
|
64 * otherwise the operator panics with |
|
65 * EArrayIndexOutOfRange. |
|
66 * @return A non-modifiable pointer descriptor representing the |
|
67 * descriptor element located at position aIndex within |
|
68 * the array. |
|
69 */ |
|
70 TPtrC MdcaPoint(TInt aIndex) const; |
|
71 |
|
72 private: |
|
73 /** |
|
74 * Symbian OS two phased constructor. |
|
75 * Completes the construction of the object. |
|
76 */ |
|
77 void ConstructL(); |
|
78 |
|
79 private: //data |
|
80 RRefArray<TDesC> iTestModules; |
|
81 HBufC* iBuffer; |
|
82 }; |
|
83 |
|
84 /** |
|
85 * CTestModulesMenuContainer container control class. |
|
86 * |
|
87 */ |
|
88 class CTestModulesMenuContainer : public CCoeControl |
|
89 { |
|
90 public: // Constructors and destructor |
|
91 |
|
92 /** |
|
93 * Symbian OS default constructor. |
|
94 * @param aRect Frame rectangle for container. |
|
95 */ |
|
96 void ConstructL(const TRect& aRect, MEikListBoxObserver* aListBoxObserver); |
|
97 |
|
98 /** |
|
99 * Destructor. |
|
100 */ |
|
101 ~CTestModulesMenuContainer(); |
|
102 |
|
103 public: // New functions |
|
104 |
|
105 /** |
|
106 * Gets the index number of the current item in the view. |
|
107 * @return Index number of the current item. |
|
108 */ |
|
109 TInt CurrentItemIndex(); |
|
110 |
|
111 public: // New functions |
|
112 |
|
113 /** |
|
114 * Stores current position of focus of iListBox to the CAppUiAppUi object |
|
115 */ |
|
116 void SaveActiveLine(); |
|
117 |
|
118 private: // Functions from base classes |
|
119 |
|
120 /** |
|
121 * From CoeControl,SizeChanged. |
|
122 * Called by framework when the view size is changed. |
|
123 */ |
|
124 void SizeChanged(); |
|
125 |
|
126 /** |
|
127 * From CoeControl,CountComponentControls. |
|
128 * Gets a count of the component controls of this list box control. |
|
129 * This information is used for DrawNow(). |
|
130 */ |
|
131 TInt CountComponentControls() const; |
|
132 |
|
133 /** |
|
134 * From CCoeControl,ComponentControl. |
|
135 * Gets a pointer to the specified component control. |
|
136 * @param aIndex Index of the component control to look up. |
|
137 * @return The control at aIndex. |
|
138 */ |
|
139 CCoeControl* ComponentControl(TInt aIndex) const; |
|
140 |
|
141 /** |
|
142 * From CCoeControl,Draw. |
|
143 * Draw a control, called by window server. |
|
144 * @param aRect The region of the control to be redrawn. Co-ordinates |
|
145 * are relative to the control's origin (top left corner). |
|
146 */ |
|
147 void Draw(const TRect& aRect) const; |
|
148 |
|
149 /** |
|
150 * From CCoeControl,OfferKeyEventL |
|
151 * Handles key events. |
|
152 * @param aKeyEvent The key event. |
|
153 * @param aType The type of key event. |
|
154 * @return Indicates whether or not the key event was used |
|
155 * by this control. |
|
156 */ |
|
157 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
158 |
|
159 private: //data |
|
160 |
|
161 CEikTextListBox* iListBox; |
|
162 CTestModulesListBoxModel* iListBoxModel; |
|
163 CUIStore* iUIStore; |
|
164 RRefArray<TDesC> iModules; |
|
165 }; |
|
166 |
|
167 #endif // CTESTMODULESMENUCONTAINER_H |
|
168 |
|
169 // End of File |