|
1 /* |
|
2 * Copyright (c) 2008 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 session editor |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __LOCSUPLSESSION_EDITOR_H__ |
|
20 #define __LOCSUPLSESSION_EDITOR_H__ |
|
21 |
|
22 |
|
23 #include <AknForm.h> |
|
24 #include <ConeResLoader.h> |
|
25 |
|
26 #include "locsuplsettingssessionobserver.h" |
|
27 |
|
28 class CAknTitlePane; |
|
29 class CLocSUPLSettingsUiEngine; |
|
30 |
|
31 /** |
|
32 * A dialog that makes it possible to edit certain fields of a supl session. |
|
33 */ |
|
34 class CLocSUPLSessionEditor : |
|
35 public CAknForm, public MLocSUPLSettingsSessionObserver |
|
36 { |
|
37 public: // Constructors and destructor |
|
38 |
|
39 /** |
|
40 * Static Two phase constructor that instantiates the CLocSUPLSessionEditor |
|
41 * |
|
42 */ |
|
43 static CLocSUPLSessionEditor* NewL( |
|
44 CLocSUPLSettingsUiEngine& aEngine, |
|
45 TInt64 aSessionId |
|
46 ); |
|
47 |
|
48 /** |
|
49 * Static Two phase constructor that instantiates the CLocSUPLSessionEditor |
|
50 * |
|
51 */ |
|
52 static CLocSUPLSessionEditor* NewLC( |
|
53 CLocSUPLSettingsUiEngine& aEngine, |
|
54 TInt64 aSessionId |
|
55 ); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 ~CLocSUPLSessionEditor(); |
|
61 |
|
62 public: // From CAknDialog |
|
63 |
|
64 /** |
|
65 * DynInitMenuPaneL initializes the menu pane before it is displayed. |
|
66 * |
|
67 * @param aResourceId a resource ID indetifying the menu bar containing |
|
68 * the menu pane to be initialized. |
|
69 * @param aMenuPane the menu pane to initialize. |
|
70 */ |
|
71 void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); |
|
72 |
|
73 /** |
|
74 * Processes user commands. |
|
75 * |
|
76 * @param aCommandId id of the command to respond to |
|
77 */ |
|
78 void ProcessCommandL(TInt aCommandId); |
|
79 |
|
80 /* |
|
81 * Executes the Dialog |
|
82 */ |
|
83 TInt ExecuteLD(); |
|
84 |
|
85 public: // from MLocSUPLSettingsSessionObserver |
|
86 |
|
87 /* |
|
88 * Calls function to load the values into the editor fields |
|
89 */ |
|
90 void UpdateSessionL( TUpdateType aType ); |
|
91 |
|
92 /* |
|
93 * Returns the session id |
|
94 */ |
|
95 TInt64 SessionId( ); |
|
96 |
|
97 |
|
98 protected: // From CAknForm |
|
99 |
|
100 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
101 TEventCode aType ); |
|
102 |
|
103 /** |
|
104 * Handles a dialog button press for the specified dialog button. |
|
105 * |
|
106 * @param aButtonId |
|
107 * @return ETrue if OK to exit, EFalse to keep the dialog active |
|
108 */ |
|
109 TBool OkToExitL(TInt aButtonId); |
|
110 |
|
111 /** |
|
112 * SaveFormDataL deals with the occasion of a change from |
|
113 * edit->view mode and the user wishes to save the changes. |
|
114 * |
|
115 * @return ETrue if the editable state can be left, EFalse otherwise |
|
116 */ |
|
117 //TBool SaveFormDataL(); |
|
118 |
|
119 private: // From CEikDialog |
|
120 |
|
121 /** |
|
122 * PreLayoutDynInitL initialises the dialog's controls before the dialog |
|
123 * is sized and layed out. |
|
124 */ |
|
125 void PreLayoutDynInitL(); |
|
126 |
|
127 /** |
|
128 * PostLayoutDynInitL initialises the dialog's controls after the dialog |
|
129 * has been sized but before it has been activated. |
|
130 */ |
|
131 void PostLayoutDynInitL(); |
|
132 |
|
133 /** |
|
134 * Gets the Time String from Time(in seconds) |
|
135 */ |
|
136 void GetTimeStringL(HBufC*& aTimeString, TUint aSeconds); |
|
137 |
|
138 void LineChangedL(TInt aControlId ); |
|
139 |
|
140 private: |
|
141 |
|
142 /** Constructor |
|
143 * |
|
144 */ |
|
145 CLocSUPLSessionEditor( |
|
146 CLocSUPLSettingsUiEngine& aEngine, |
|
147 TInt64 aSessionId |
|
148 ); |
|
149 |
|
150 void ConstructL(); |
|
151 |
|
152 private: // new functions |
|
153 /** |
|
154 * Change title pane text |
|
155 */ |
|
156 void ChangeTitlePaneTextL( TDesC& aText ); |
|
157 |
|
158 /** |
|
159 * Load intial data values |
|
160 */ |
|
161 void LoadFormValuesFromDataL(); |
|
162 |
|
163 /* |
|
164 * it toggles value of popup field |
|
165 */ |
|
166 void TogglePopupFieldControlL( TInt aControlId ); |
|
167 |
|
168 /* |
|
169 * it changes the MSK caption |
|
170 */ |
|
171 void HandleMSKCaptionL(); |
|
172 |
|
173 /* |
|
174 * Confirmation query note for delete operation |
|
175 */ |
|
176 TInt DeleteConfirmationQueryL(); |
|
177 |
|
178 private: // Data |
|
179 |
|
180 //! The title pane that is dynamically updated |
|
181 CAknTitlePane* iTitlePane; |
|
182 |
|
183 //! The original title that the title pane displayed before modified |
|
184 HBufC* iOriginalTitle; |
|
185 |
|
186 /* |
|
187 * help context object |
|
188 */ |
|
189 TCoeHelpContext iHelpContext; |
|
190 |
|
191 /* |
|
192 * Reference to the SUPL Settings engine |
|
193 */ |
|
194 CLocSUPLSettingsUiEngine& iEngine; |
|
195 |
|
196 /** |
|
197 * SUPL Session unique Id. |
|
198 */ |
|
199 TInt64 iSessionId; |
|
200 |
|
201 /* |
|
202 * Reference to the SUPL Settings engine |
|
203 * Own: |
|
204 */ |
|
205 HBufC* iSessionName; |
|
206 }; |
|
207 |
|
208 #endif // __LOCSUPLSESSION_EDITOR_H__ |
|
209 |