|
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: SUPL Settings UI View's container |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_LOCSUPLSETTINGSCONTAINER_H_ |
|
20 #define C_LOCSUPLSETTINGSCONTAINER_H_ |
|
21 |
|
22 // System Includes |
|
23 #include <e32base.h> |
|
24 #include <coecntrl.h> |
|
25 #include <eiklbo.h> |
|
26 |
|
27 |
|
28 // Forward Declarations |
|
29 class CLocSUPLSettingsView; |
|
30 class CAknSettingStyleListBox; |
|
31 class CLocSUPLSettingsLBModel; |
|
32 class CLocSUPLSettingsUiEngine; |
|
33 |
|
34 // Class Declarations |
|
35 /** |
|
36 * Container for the SUPL Settings UI View. |
|
37 * |
|
38 * Contains the Listbox control that is used to configure various SUPL settings |
|
39 * options |
|
40 * |
|
41 * @lib locsuplsettings.lib |
|
42 * @since S60 v3.1 |
|
43 */ |
|
44 class CLocSUPLSettingsContainer : public CCoeControl, |
|
45 public MEikListBoxObserver |
|
46 { |
|
47 public: |
|
48 /** |
|
49 * Static Two phase contructor that instantiates the CLocSUPLSettingsContainer |
|
50 * |
|
51 * @param aRect Client rectangle |
|
52 * @param aEngine Reference to the SUPL Settings |
|
53 * engine |
|
54 * @param aSettingsView Reference to the container's view |
|
55 * @return CLocSUPLSettingsContainer* Reference to the object created |
|
56 */ |
|
57 static CLocSUPLSettingsContainer* NewL( |
|
58 const TRect& aRect, |
|
59 CLocSUPLSettingsUiEngine& aEngine, |
|
60 CLocSUPLSettingsView& aSettingsView ); |
|
61 |
|
62 /** |
|
63 * Static Two phase contructor that instantiates the CLocSUPLSettingsContainer |
|
64 * Leaves the object on the Cleanup stack |
|
65 * |
|
66 * @param aRect Client rectangle |
|
67 * @param aEngine Reference to the SUPL Settings |
|
68 * engine |
|
69 * @param aSettingsView Reference to the container's view |
|
70 * @return CLocSUPLSettingsContainer* Reference to the object created |
|
71 */ |
|
72 static CLocSUPLSettingsContainer* NewLC( |
|
73 const TRect& aRect, |
|
74 CLocSUPLSettingsUiEngine& aEngine, |
|
75 CLocSUPLSettingsView& aSettingsView ); |
|
76 |
|
77 /** |
|
78 * Destructor |
|
79 */ |
|
80 ~CLocSUPLSettingsContainer(); |
|
81 |
|
82 /** |
|
83 * Refreshes the screen so that the list box reflects the latest contents |
|
84 */ |
|
85 void UpdateScreen(); |
|
86 |
|
87 /** |
|
88 * Returns the Selected element. The list box model defines the |
|
89 * enumeration that would determine the current element that has been |
|
90 * selected |
|
91 * |
|
92 * @return TInt Index of the item selected |
|
93 */ |
|
94 TInt SelectedItemIndex(); |
|
95 |
|
96 /** |
|
97 * Sets focus to server detail or Active services item |
|
98 * @param aIndex Helps to know if server or session item has to be focussed |
|
99 */ |
|
100 void FocusToItemL( TInt aIndex ); |
|
101 |
|
102 /** |
|
103 * Returns the Active session count. |
|
104 * |
|
105 * @return TInt SUPL Active sessions count. |
|
106 */ |
|
107 TInt ActiveSessionCount( ) const; |
|
108 |
|
109 protected: |
|
110 |
|
111 /** |
|
112 * Inherited from CCoeControl |
|
113 */ |
|
114 void HandleResourceChange(TInt aType); |
|
115 |
|
116 /** |
|
117 * Returns the help context |
|
118 * |
|
119 * @param aContext The help context that has to be determined |
|
120 */ |
|
121 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
122 |
|
123 /** |
|
124 * From CoeControl |
|
125 */ |
|
126 TInt CountComponentControls() const; |
|
127 |
|
128 /** |
|
129 * From CCoeControl |
|
130 */ |
|
131 CCoeControl* ComponentControl(TInt aIndex) const; |
|
132 |
|
133 /** |
|
134 * Inherited from CCoeControl |
|
135 */ |
|
136 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
137 TEventCode aType ); |
|
138 |
|
139 /** |
|
140 * Inherited from MEikListBoxObserver |
|
141 */ |
|
142 void HandleListBoxEventL( CEikListBox* aListBox, |
|
143 TListBoxEvent aEventType ); |
|
144 |
|
145 protected: |
|
146 /** |
|
147 * Handles Focus Change to list |
|
148 */ |
|
149 void FocusChanged(TDrawNow aDrawNow); |
|
150 |
|
151 /** |
|
152 * From CoeControl,SizeChanged. |
|
153 */ |
|
154 void SizeChanged(); |
|
155 |
|
156 private: |
|
157 /** |
|
158 * Overloaded Constructor |
|
159 */ |
|
160 CLocSUPLSettingsContainer( CLocSUPLSettingsView& aSettingsView ); |
|
161 |
|
162 /** |
|
163 * Second phase of the two phase Construction process |
|
164 */ |
|
165 void ConstructL( const TRect& aRect , |
|
166 CLocSUPLSettingsUiEngine& aEngine ); |
|
167 |
|
168 /** |
|
169 * Sets the Title text |
|
170 * @param aResourceText Resource to create title |
|
171 */ |
|
172 void MakeTitleL( TInt aResourceText ); |
|
173 |
|
174 /** |
|
175 * Returns the Appui's status pane |
|
176 * @return CEikStatusPane* Statuspane pointer |
|
177 */ |
|
178 CEikStatusPane* StatusPane(); |
|
179 |
|
180 /** |
|
181 * Creates the List box and the Listbox model. Associates the |
|
182 * list box model wit the list box |
|
183 * |
|
184 * @param aEngine Reference to the SUPL Settings engine |
|
185 */ |
|
186 void CreateListboxL( CLocSUPLSettingsUiEngine& aEngine ); |
|
187 |
|
188 private: |
|
189 |
|
190 /** |
|
191 * Reference to the Container's view |
|
192 */ |
|
193 CLocSUPLSettingsView& iSettingsView; |
|
194 |
|
195 /** |
|
196 * Help context |
|
197 */ |
|
198 TCoeContextName iContextName; |
|
199 |
|
200 /** |
|
201 * Settings list box for SUPL settings |
|
202 * Owns |
|
203 */ |
|
204 CAknSettingStyleListBox* iListBox; |
|
205 |
|
206 /** |
|
207 * List Box model |
|
208 */ |
|
209 CLocSUPLSettingsLBModel* iListBoxModel; |
|
210 |
|
211 /** |
|
212 * Boolean flag to denote whether the pen down occured |
|
213 */ |
|
214 TBool iTouchFlag; |
|
215 }; |
|
216 |
|
217 #endif // C_LOCSUPLSETTINGSCONTAINER_H_ |
|
218 |