|
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: Main view for Sensor plug-in. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef GSSENSORPLUGIN_H |
|
20 #define GSSENSORPLUGIN_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <gsbaseview.h> |
|
24 #include <gspluginloader.h> |
|
25 #include "gssensormskobserver.h" |
|
26 |
|
27 // FORWARD CLASS DECLARATION |
|
28 class CAknView; |
|
29 class CAknViewAppUi; |
|
30 class CGSSensorPluginContainer; |
|
31 class CGSSensorPluginModel; |
|
32 |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * CGSSensorPlugin view class |
|
38 * |
|
39 * Plugin implementation for sensor settings |
|
40 * |
|
41 * @lib gssensorplugin.lib |
|
42 * @since S60 5.0 |
|
43 */ |
|
44 class CGSSensorPlugin : public CGSBaseView, |
|
45 public MGSPluginLoadObserver, |
|
46 public MGSSensorMskObserver |
|
47 { |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Symbian OS two-phased constructor |
|
52 * |
|
53 * @param aInitParams Initialization parameters |
|
54 */ |
|
55 static CGSSensorPlugin* NewL( TAny* aInitParams ); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 virtual ~CGSSensorPlugin(); |
|
61 |
|
62 /** |
|
63 * Returns view id. This is same as this plug-ins UID |
|
64 * |
|
65 * @return TUid |
|
66 */ |
|
67 TUid Id() const; |
|
68 |
|
69 /** |
|
70 * Handles commands from user. |
|
71 * |
|
72 * @param aCommand Command to be handled. |
|
73 */ |
|
74 void HandleCommandL( TInt aCommand ); |
|
75 |
|
76 /** |
|
77 * From MEikCommandObserver, handles the commands. |
|
78 * |
|
79 * @param aCommand identifies the command given. |
|
80 */ |
|
81 void ProcessCommandL( TInt aCommand ); |
|
82 |
|
83 /** |
|
84 * @see CGSPluginInterface header file. |
|
85 */ |
|
86 void GetCaptionL( TDes& aCaption ) const; |
|
87 |
|
88 /** |
|
89 * @see CGSPluginInterface header file. |
|
90 */ |
|
91 TInt PluginProviderCategory() const; |
|
92 |
|
93 /** |
|
94 * @see CGSPluginInterface header file. |
|
95 */ |
|
96 CGulIcon* CreateIconL( const TUid aIconType ); |
|
97 |
|
98 /** |
|
99 * @see MGSPluginLoadObserver header file. |
|
100 */ |
|
101 void HandlePluginLoaded( KGSPluginLoaderStatus aStatus ); |
|
102 |
|
103 /** |
|
104 * Updates listbox's item's value. |
|
105 * |
|
106 * @param aItemId An item which is updated. |
|
107 */ |
|
108 void UpdateListBoxL( TInt aItemId ); |
|
109 |
|
110 /** |
|
111 * Get CGSSensorPlugin's container. |
|
112 */ |
|
113 CGSSensorPluginContainer* Container(); |
|
114 |
|
115 /** |
|
116 * From MGSSensorMskObserver. |
|
117 * Checks currently activated item in list and updates MSK label if needed |
|
118 */ |
|
119 void CheckMiddleSoftkeyLabelL(); |
|
120 |
|
121 protected: |
|
122 |
|
123 /** |
|
124 * From CAknView. Handles a view activation. |
|
125 * |
|
126 * @param aPrevViewId Specifies the view previously active. |
|
127 * @param aCustomMessageId Specifies the message type. |
|
128 * @param aCustomMessage The activation message. |
|
129 */ |
|
130 void DoActivateL( const TVwsViewId& aPrevViewId, |
|
131 TUid aCustomMessageId, |
|
132 const TDesC8& aCustomMessage ); |
|
133 |
|
134 /** |
|
135 * Deactivates current view. |
|
136 */ |
|
137 void DoDeactivate(); |
|
138 |
|
139 /** |
|
140 * From MEikMenuObserver. |
|
141 * Changes MenuPane dynamically. |
|
142 */ |
|
143 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
144 |
|
145 /** |
|
146 * From CGSBaseView. Override function to create container, |
|
147 */ |
|
148 void CreateContainerL(); |
|
149 |
|
150 protected: |
|
151 |
|
152 /** |
|
153 * C++ default constructor. |
|
154 */ |
|
155 CGSSensorPlugin(); |
|
156 |
|
157 /** |
|
158 * Symbian OS default constructor. |
|
159 */ |
|
160 void ConstructL(); |
|
161 |
|
162 private: |
|
163 |
|
164 /** |
|
165 * From CGSBaseView. Creates new container |
|
166 */ |
|
167 void NewContainerL(); |
|
168 |
|
169 /** |
|
170 * From CGSBaseView. Handles list box selection |
|
171 */ |
|
172 void HandleListBoxSelectionL(); |
|
173 |
|
174 /** |
|
175 * Called when plugin is not used anymore. Frees view UIDs this plugin has. |
|
176 */ |
|
177 void RemoveLocalViews(); |
|
178 |
|
179 /** |
|
180 * Creates local view. |
|
181 * |
|
182 * @param aLocalViewId Identifier of the local view to be created |
|
183 */ |
|
184 void CreateLocalViewL( TUid aLocalViewId ); |
|
185 |
|
186 /** |
|
187 * Selects and creates current view. Calls CreateLocalViewL |
|
188 */ |
|
189 void SelectLocalViewL(); |
|
190 |
|
191 /** |
|
192 * From CGSBaseView. Change sensors active status setting without |
|
193 * displaying the setting page |
|
194 */ |
|
195 void ChangeSensorActiveSettingL(); |
|
196 |
|
197 /** |
|
198 * Removes current label from MSK |
|
199 */ |
|
200 void RemoveCommandFromMSK(); |
|
201 |
|
202 /** |
|
203 * Adds new label for MSK |
|
204 * |
|
205 * @param aResourceId Text of the new label |
|
206 * @param aCommandId Command id of the MSK |
|
207 */ |
|
208 void SetMiddleSoftKeyLabelL( const TInt aResourceId, const TInt aCommandId ); |
|
209 |
|
210 /** |
|
211 * Retreives Cba from base classes if iCba is NULL |
|
212 */ |
|
213 CEikButtonGroupContainer* ButtonGroup(); |
|
214 |
|
215 /** |
|
216 * Checks the exit status and shows query, note or neither |
|
217 */ |
|
218 void CheckExitStatusL(); |
|
219 |
|
220 private: // Data |
|
221 |
|
222 /** |
|
223 * resource loader |
|
224 */ |
|
225 RConeResourceLoader iResourceLoader; |
|
226 |
|
227 /** |
|
228 * Pointer to model of this plug-in |
|
229 */ |
|
230 CGSSensorPluginModel* iModel; |
|
231 |
|
232 /** |
|
233 * Extended plugin array for sensor specific plugins |
|
234 */ |
|
235 CArrayPtrFlat<CGSPluginInterface>* iPluginArray; |
|
236 |
|
237 /** |
|
238 * Asynchronous loader for the GS plug-ins. |
|
239 */ |
|
240 CGSPluginLoader* iPluginLoader; |
|
241 |
|
242 /** |
|
243 * All the views below are owned by iAppUi |
|
244 */ |
|
245 CAknView* iTappingCtrlView; |
|
246 CAknView* iTurningCtrlView; |
|
247 }; |
|
248 |
|
249 #endif // GSSENSORPLUGIN_H |