1 /* |
|
2 * Copyright (c) 2002,2005 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: Positioning Method Settings UI main view's container class |
|
15 * definition. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CLOCPSYSETTINGSCONTAINER_H_ |
|
22 #define CLOCPSYSETTINGSCONTAINER_H_ |
|
23 |
|
24 // INCLUDES |
|
25 #include <coecntrl.h> |
|
26 #include <eiklbo.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CAknSingleGraphicStyleListBox; |
|
30 class CAknIconArray; |
|
31 class CEikColumnListBox; |
|
32 class CEikListBox; |
|
33 class CEikStatusPane; |
|
34 |
|
35 class CLocPsySettingsView; |
|
36 class MLocPsyKeyProcessor; |
|
37 class MLocPsySettings; |
|
38 |
|
39 // CLASS DECLARATION |
|
40 |
|
41 /** |
|
42 * CLocPsySettingsContainer container control class. |
|
43 * |
|
44 */ |
|
45 class CLocPsySettingsContainer : public CCoeControl, |
|
46 public MEikListBoxObserver |
|
47 { |
|
48 private: |
|
49 /** |
|
50 * C++ default constructor. |
|
51 */ |
|
52 CLocPsySettingsContainer( MLocPsyKeyProcessor* aKeyProcessor, |
|
53 CLocPsySettingsView* aView ); |
|
54 |
|
55 public: |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 virtual ~CLocPsySettingsContainer(); |
|
60 |
|
61 /** |
|
62 * Two-phased constructor |
|
63 * |
|
64 * @param aMainView A pointer to MainView |
|
65 * @param aAppUi A pointer to Location AppUi. |
|
66 * @param aRect A rectangle for drawing. |
|
67 * @return CLocPsySettingsContainer* The newly created object. |
|
68 */ |
|
69 static CLocPsySettingsContainer* NewL( |
|
70 MLocPsyKeyProcessor* aKeyProcessor, |
|
71 MObjectProvider* aParent, |
|
72 CLocPsySettingsView* aView, |
|
73 MLocPsySettings* aSettingsModel, |
|
74 const TRect& aRect ); |
|
75 /** |
|
76 * Inherited From CCoeControl |
|
77 */ |
|
78 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
79 TEventCode aType ); |
|
80 |
|
81 /** |
|
82 * Inherited from CCoeControl. Handles resource changes |
|
83 * |
|
84 * @param Row index |
|
85 */ |
|
86 void HandleResourceChange( TInt aType ); |
|
87 |
|
88 /** |
|
89 * Inherited from CCoeControl. Handles list box events |
|
90 * |
|
91 * @param aListBox Listbox on which the event was generated |
|
92 * @param aEventType Type of event that was generated |
|
93 */ |
|
94 void HandleListBoxEventL( CEikListBox* aListBox, |
|
95 TListBoxEvent aEventType ); |
|
96 /** |
|
97 * Returns the help context |
|
98 * |
|
99 * @param aContext The help context that has to be determined |
|
100 */ |
|
101 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
102 |
|
103 /** |
|
104 * Returns selected row in main view |
|
105 * |
|
106 * @return Row index |
|
107 */ |
|
108 TInt SelectedRow() const; |
|
109 |
|
110 /** |
|
111 * Sets selected row in main view |
|
112 * |
|
113 * @param Row index |
|
114 */ |
|
115 void SetSelectedRow( TInt aIndex ) const; |
|
116 |
|
117 /** |
|
118 * Handle the mark commands for the Markable ListBox |
|
119 * |
|
120 * @param Markable Commands EAknCmdMark and EAknCmdUnmark |
|
121 */ |
|
122 void HandleMarkCommandL( TInt aCommand ); |
|
123 |
|
124 /** |
|
125 * Updates the List box |
|
126 */ |
|
127 void UpdateL(); |
|
128 |
|
129 protected: |
|
130 /** |
|
131 * Inherited from CCoeControl |
|
132 * Handles Focus Change to list |
|
133 */ |
|
134 void FocusChanged( TDrawNow aDrawNow ); |
|
135 |
|
136 private: |
|
137 /** |
|
138 * By default Symbian 2nd phase constructor is private. |
|
139 * @param aRect Frame rectangle for container. |
|
140 */ |
|
141 void ConstructL( MLocPsySettings* aSettingsModel, const TRect& aRect ); |
|
142 |
|
143 /** |
|
144 * From CoeControl,SizeChanged. |
|
145 */ |
|
146 void SizeChanged(); |
|
147 |
|
148 /** |
|
149 * From CoeControl,CountComponentControls. |
|
150 */ |
|
151 TInt CountComponentControls() const; |
|
152 |
|
153 /** |
|
154 * From CCoeControl,ComponentControl. |
|
155 */ |
|
156 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
157 |
|
158 /** |
|
159 * Append icon to icon array. CAknIconArray owns icons so it is |
|
160 * easier to it leave safely. |
|
161 * @param aIcons icon array |
|
162 * @param aIconFileWithPath icon file name with path |
|
163 * @param aSkinID skin id of the icon |
|
164 * @param aIconGraphicsIndex picture index |
|
165 * @param aIconGraphicsMaskIndex mask index |
|
166 */ |
|
167 void AddIconL( CAknIconArray* aIcons, |
|
168 const TDesC& aIconFileWithPath, |
|
169 TAknsItemID aSkinID, |
|
170 TInt aIconGraphicsIndex, |
|
171 TInt aIconGraphicsMaskIndex ); |
|
172 |
|
173 /** |
|
174 * Gets location icon file path and name. Ownership is transferred, |
|
175 * item is left in the cleanup stack. |
|
176 * @return full path and name, ownership is transferred |
|
177 */ |
|
178 TFileName* LocIconFileNameLC() const; |
|
179 |
|
180 /** |
|
181 * Gets avkon icon file path and name. Ownership is transferred, |
|
182 * item is left in the cleanup stack. |
|
183 * @return full path and name, ownership is transferred |
|
184 */ |
|
185 TFileName* AvkonIconFileNameLC() const; |
|
186 |
|
187 /** |
|
188 * Make title |
|
189 * @param aResourceText resource to create title |
|
190 */ |
|
191 void MakeTitleL( TInt aResourceText ); |
|
192 |
|
193 /** |
|
194 * Make title |
|
195 * @param aListbox listbox reference |
|
196 * @param aResourceText resourse id |
|
197 */ |
|
198 void MakeEmptyTextListBoxL( CEikListBox& aListBox, TInt aResourceText ); |
|
199 |
|
200 /** |
|
201 * Appui's status pane getter |
|
202 * @return Statuspane pointer |
|
203 */ |
|
204 CEikStatusPane* StatusPane(); |
|
205 |
|
206 /** |
|
207 * Creates List box. |
|
208 */ |
|
209 void CreateListboxL( MLocPsySettings* aSettingsModel ); |
|
210 |
|
211 /** |
|
212 * Update icons |
|
213 */ |
|
214 void UpdateIconsL(); |
|
215 |
|
216 private: //data |
|
217 |
|
218 // help context |
|
219 TCoeContextName iContextName; |
|
220 |
|
221 // Key Processor to route the keys before it is processed by the control |
|
222 // not own |
|
223 MLocPsyKeyProcessor* iKeyProcessor; |
|
224 |
|
225 /// Own: List box. |
|
226 CAknSingleGraphicStyleListBox* iListBox; |
|
227 |
|
228 // The parent View |
|
229 // Not Owned |
|
230 CLocPsySettingsView* iParentView; |
|
231 }; |
|
232 |
|
233 #endif |
|
234 |
|
235 // End of File CLOCPSYSETTINGSCONTAINER_H_ |
|