|
1 /* |
|
2 * Copyright (c) 2002 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: |
|
15 * Logs application "Settings" view class implementation |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __Logs_App_CLogsSettingsView_H__ |
|
21 #define __Logs_App_CLogsSettingsView_H__ |
|
22 |
|
23 // INCLUDES |
|
24 #include <ConeResLoader.h> |
|
25 #include <logcli.h> |
|
26 #include <gsplugininterface.h> |
|
27 #include <aknradiobuttonsettingpage.h> |
|
28 |
|
29 #include "CLogsBaseView.h" |
|
30 #include "MLogsObserver.h" |
|
31 |
|
32 #include "LogsEng.hrh" |
|
33 |
|
34 // CONSTANTS |
|
35 |
|
36 // MACROS |
|
37 |
|
38 // DATA TYPES |
|
39 |
|
40 // FUNCTION PROTOTYPES |
|
41 |
|
42 // FORWARD DECLARATIONS |
|
43 class CLogsSettingsControlContainer; |
|
44 class CLogsEngine; |
|
45 class MCoeForegroundObserver; |
|
46 class CAknQueryDialog; |
|
47 |
|
48 // CLASS DECLARATION |
|
49 |
|
50 /** |
|
51 * Logs application "Settings" view class implementation. |
|
52 * Several application settings can be modified in this view. |
|
53 */ |
|
54 class CLogsSettingsView : public CGSPluginInterface, |
|
55 public MLogsObserver, |
|
56 public MEikListBoxObserver, |
|
57 public MLogsKeyProcessor, |
|
58 public MCoeForegroundObserver |
|
59 { |
|
60 public: // interface |
|
61 |
|
62 |
|
63 /** |
|
64 * Creates new GS plugin having the given UID. |
|
65 * Uses Leave code KErrNotFound if implementation is not found. |
|
66 * |
|
67 * @param aImplementationUid Implementation UID of the plugin to be |
|
68 * created. |
|
69 * @param aInitParams Plugin's initialization parameters. Make sure you know |
|
70 * what the plugin expects as initialization parameters. This |
|
71 * should be an agreement between the plugin client and the |
|
72 * plugin. Parameter can be used for example as sharing a common |
|
73 * data model between multiple plugins. |
|
74 */ |
|
75 static CGSPluginInterface* NewPluginL( |
|
76 const TUid aImplementationUid, |
|
77 TAny* aInitParams); |
|
78 |
|
79 /** |
|
80 * Destructor. |
|
81 */ |
|
82 ~CLogsSettingsView(); |
|
83 |
|
84 |
|
85 private: |
|
86 /** |
|
87 * Constructor, second phase. |
|
88 */ |
|
89 void ConstructL(); |
|
90 |
|
91 /** |
|
92 * C++ constructor |
|
93 */ |
|
94 CLogsSettingsView(); |
|
95 |
|
96 /** |
|
97 * Framework calls to init menu items. |
|
98 * |
|
99 * @param aResourceId resource read |
|
100 * @param aMenuPane menu pane |
|
101 */ |
|
102 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
103 |
|
104 /** |
|
105 * Framework calls to init process commands |
|
106 * |
|
107 * @param aCommand |
|
108 */ |
|
109 void ProcessCommandL( TInt aCommand ); |
|
110 |
|
111 // from MLogsKeyProcessor |
|
112 TBool ProcessKeyEventL( const TKeyEvent& aKeyEvent, |
|
113 TEventCode aType ); |
|
114 /** |
|
115 * Overrides the baseclass handler |
|
116 * |
|
117 * @param aIndex The index of the item tapped |
|
118 */ |
|
119 void ProcessPointerEventL( TInt aIndex); |
|
120 |
|
121 //void FocusChangedL(); |
|
122 |
|
123 MAknTabObserver* TabObserver(); |
|
124 |
|
125 // from MEikListBoxObserver |
|
126 void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ); |
|
127 |
|
128 // from MLogsModelObserver |
|
129 void StateChangedL( MLogsStateHolder* aHolder ); |
|
130 |
|
131 private: // from CAknView |
|
132 /** |
|
133 * Returns the ID of the view. |
|
134 * @return view id |
|
135 */ |
|
136 TUid Id() const; |
|
137 |
|
138 /** |
|
139 * Called when the client rectangle of this view changes |
|
140 */ |
|
141 void HandleClientRectChange(); |
|
142 |
|
143 /** |
|
144 * Called by the framework when this view is activated. |
|
145 * |
|
146 * @param aPrevViewId This is ID for previous view. |
|
147 * @param aCustomMessageId ID of the custom message. Not used. |
|
148 * @param aCustomMessage custom message. Not used. |
|
149 */ |
|
150 void DoActivateL( const TVwsViewId& aPrevViewId, |
|
151 TUid aCustomMessageId, |
|
152 const TDesC8& aCustomMessage ); |
|
153 |
|
154 /** |
|
155 * Called by the framework when this view is deactivated. |
|
156 */ |
|
157 void DoDeactivate(); |
|
158 |
|
159 /* |
|
160 * Show note dialog |
|
161 * @param aResourceId, note to show. |
|
162 */ |
|
163 void ShowNoteL( TInt aResourceID ); |
|
164 |
|
165 |
|
166 /** |
|
167 * Is call active |
|
168 * @return ETrue if call is active, else return EFalse |
|
169 */ |
|
170 // TBool CallIsActiveL(); |
|
171 |
|
172 private: // From MCoeForegroundObserver. |
|
173 |
|
174 /** |
|
175 * Called by the framework when this view gains foreground |
|
176 */ |
|
177 void HandleGainingForeground(); |
|
178 |
|
179 /** |
|
180 * Called by the framework when this view loses foreground |
|
181 */ |
|
182 void HandleLosingForeground(); |
|
183 |
|
184 private: // Command handlers (use "Cmd" prefix) |
|
185 |
|
186 /** |
|
187 * Manage setting log length possible changes. |
|
188 */ |
|
189 void CmdLogLengthL(); |
|
190 |
|
191 //Below: "Show Call Duration" moved General Settings application, not in use any more in Logs |
|
192 /** |
|
193 * Makes the change in to the "Call Duration" and handles the |
|
194 * rules, which have been given |
|
195 * |
|
196 * @param aDurationItem The selected item |
|
197 */ |
|
198 // void MakeCallDurationChangeL( TBool aChange ); |
|
199 |
|
200 /** |
|
201 * Manage setting show call duration possible changes. |
|
202 */ |
|
203 // void CmdShowCallDurationPhoneL(); |
|
204 |
|
205 |
|
206 /** |
|
207 * Makes opposite selection to "Call Duration" |
|
208 */ |
|
209 // void MakeCallDurationOppositeL(); |
|
210 |
|
211 public: |
|
212 /** |
|
213 * Log age getter |
|
214 * |
|
215 * @return log age |
|
216 */ |
|
217 TLogAge LogAge() const; |
|
218 |
|
219 /** |
|
220 * Logs Engine getter |
|
221 * |
|
222 * @return Logs engine |
|
223 */ |
|
224 CLogsEngine* Engine(); |
|
225 |
|
226 private: // from CGSPluginInterface |
|
227 |
|
228 /** |
|
229 * Provides caption of this plugin. This should be the |
|
230 * localized name of the Logs settings view to be shown in parent view |
|
231 * (i.e. GS applications view) |
|
232 * |
|
233 * @param aCaption pointer to Caption variable |
|
234 */ |
|
235 void GetCaptionL( TDes& aCaption ) const; |
|
236 |
|
237 /** |
|
238 * Provides the plugin provider category. See |
|
239 * TGSPluginProviderCategory. PluginProviderCategory can be used for |
|
240 * sorting plugins. |
|
241 * |
|
242 * Default value is EGSPluginProvider3rdParty. Override this function |
|
243 * to change the category. |
|
244 * |
|
245 * @return Plugin provider category ID defined by |
|
246 * TGSPluginProviderCategory |
|
247 */ |
|
248 TInt PluginProviderCategory() const; |
|
249 |
|
250 /** |
|
251 * Creates a new icon of desired type. Override this to provide custom |
|
252 * icons. Othervise default icon is used. Ownership of the created icon |
|
253 * is transferred to the caller. |
|
254 * |
|
255 * Icon type UIDs (use these defined constants): |
|
256 * KGSIconTypeLbxItem - ListBox item icon. |
|
257 * KGSIconTypeTab - Tab icon. |
|
258 * |
|
259 * @param aIconType UID Icon type UID of the icon to be created. |
|
260 * @return Pointer of the icon. NOTE: Ownership of this icon is |
|
261 * transferred to the caller. |
|
262 */ |
|
263 virtual CGulIcon* CreateIconL( const TUid aIconType ); |
|
264 |
|
265 virtual TAny* CustomOperationL( TAny* aParam1, TAny* aParam2 ); |
|
266 |
|
267 private: // from MEikCommandObserver |
|
268 /** |
|
269 * Handles the view specific commands. |
|
270 * |
|
271 * @param aCommandId This is an id for command. |
|
272 * Most of the commands are forwarded to LogAppUI. |
|
273 */ |
|
274 void HandleCommandL(TInt aCommand); |
|
275 |
|
276 |
|
277 private: // operations |
|
278 |
|
279 /** |
|
280 * Makes view's one line with the given information |
|
281 * |
|
282 * @param aItems Array where to put the line information |
|
283 * @param aResourceText The resource index of text to be shown |
|
284 */ |
|
285 void MakeSettingLineL( CDesCArrayFlat* aItems, TInt aResourceText ); |
|
286 |
|
287 /** |
|
288 * User log length selection "No log" query. |
|
289 * |
|
290 * @return The ETrue value indicates that log lenght "No log" |
|
291 * should be activated. |
|
292 */ |
|
293 TBool NoLogQueryL(); |
|
294 |
|
295 void SetForGS( TBool aForGS ); |
|
296 |
|
297 private: // data |
|
298 /// Own: This view's control container |
|
299 CLogsSettingsControlContainer* iContainer; |
|
300 CAknRadioButtonSettingPage* iDialog; |
|
301 CAknQueryDialog* iNoLogQueryDlg; |
|
302 CDesCArrayFlat* iSettingItems; |
|
303 |
|
304 /// Own: config info |
|
305 TLogConfig iConfig; |
|
306 CLogsEngine* iEngine; |
|
307 TVwsViewId iPrevViewId; |
|
308 CEikonEnv* iEikEnv; // Local eikonenv |
|
309 TInt iResourceFileOffset; // Offset for eikon env. |
|
310 TBool iForGs; |
|
311 TLogsState iState; |
|
312 |
|
313 TInt iLastMaxEventAge; |
|
314 }; |
|
315 |
|
316 #endif // __Logs_App_CLogsSettingsView_H__ |
|
317 |
|
318 |
|
319 // End of File |
|
320 |