|
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: Username and password multiline dataquery. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CCNOUIUSERNAMEANDPWDQUERY_H |
|
19 #define CCNOUIUSERNAMEANDPWDQUERY_H |
|
20 |
|
21 |
|
22 // INCLUDES |
|
23 #include <aknquerydialog.h> |
|
24 #include "MCnUiUiFacade.h" |
|
25 |
|
26 |
|
27 // Class declarations |
|
28 class CBrowserLauncher; |
|
29 class MIMPSSharedData; |
|
30 |
|
31 /** |
|
32 * Username and password multi line data query. |
|
33 * |
|
34 * Username and password multi line data query. |
|
35 * Focuses right query line depending from original |
|
36 * username and password and also the query mode. |
|
37 * |
|
38 * @lib IMPSConnectionUi.lib |
|
39 * @since 2.1 |
|
40 */ |
|
41 NONSHARABLE_CLASS( CCnOUiUsernameAndPwdQuery ) : public CAknMultiLineDataQueryDialog |
|
42 { |
|
43 private: // Enumerations |
|
44 |
|
45 /** |
|
46 * Enumerations for initial line focus. |
|
47 */ |
|
48 enum TInitialFocus |
|
49 { |
|
50 EFirstLine, |
|
51 ESecondLine |
|
52 }; |
|
53 |
|
54 |
|
55 public: //Symbian OS constructor |
|
56 |
|
57 /** |
|
58 * Creates username and password multi line data query. |
|
59 * Handles line focus as desired. |
|
60 * |
|
61 * @since 2.1 |
|
62 * @param aUserName The username to edit. |
|
63 * @param aPwd The password to edit. |
|
64 * @param aMode How to determine initially focused line etc behaviour. |
|
65 * @param aDomainSelectionQueryVariation Is domain selection query variation on or off. |
|
66 * @param aUiFacade Ui facade to use to show error notes. |
|
67 */ |
|
68 static CCnOUiUsernameAndPwdQuery* NewL( TDes& aUserName, |
|
69 TDes& aPwd, |
|
70 TCnUiLoginDataQueryMode aMode, |
|
71 TBool aDomainSelectionQueryVariation, |
|
72 MCnUiUiFacade& aUiFacade ); |
|
73 |
|
74 |
|
75 protected: // Constructors and destructor |
|
76 |
|
77 /** |
|
78 * C++ default constructor. |
|
79 */ |
|
80 CCnOUiUsernameAndPwdQuery( TInitialFocus aInitialFocus, |
|
81 MCnUiUiFacade& aUiFacade, |
|
82 TBool aDomainSelectionQueryVariation, |
|
83 TBool aCursorToBeginning = EFalse ); |
|
84 |
|
85 /** |
|
86 * ConstructL |
|
87 */ |
|
88 void ConstructL(); |
|
89 |
|
90 /** |
|
91 * Destructor. |
|
92 */ |
|
93 virtual ~CCnOUiUsernameAndPwdQuery(); |
|
94 |
|
95 |
|
96 protected: // Functions from CEikDialog |
|
97 |
|
98 /** |
|
99 * From CEikdialog. |
|
100 * This is called during initialisation and it sets initially |
|
101 * focused line by calling DoSetInitialCurrentLineL(). |
|
102 * @see DoSetInitialCurrentLineL |
|
103 * |
|
104 * @since 2.1 |
|
105 */ |
|
106 void SetInitialCurrentLine(); |
|
107 |
|
108 /** |
|
109 * From CEikdialog. |
|
110 * |
|
111 * This function is called by the EIKON framework |
|
112 * if the user activates a button in the button panel. |
|
113 * It is not called if the Cancel button is activated, |
|
114 * unless the EEikDialogFlagNotifyEsc flag is set. |
|
115 * @param aButtonId The ID of the button that was activated |
|
116 * @return Should return ETrue if the dialog should exit, |
|
117 * and EFalse if it should not. |
|
118 */ |
|
119 TBool OkToExitL( TInt aButtonId ); |
|
120 |
|
121 /** |
|
122 * From CAknQueryDialog. |
|
123 * If the query text is ok (retrieved form query control) then display the |
|
124 * left soft key, otherwise hide it. |
|
125 */ |
|
126 void UpdateLeftSoftKeyL(); |
|
127 |
|
128 /** |
|
129 * From CAknDialog. |
|
130 * Processes commands for menu options |
|
131 */ |
|
132 void ProcessCommandL( TInt aCommandId ); |
|
133 |
|
134 /** |
|
135 * From CAknDialog. |
|
136 * Called after the user presses Options and Before the menu is actually displayed |
|
137 */ |
|
138 void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
139 |
|
140 /** |
|
141 * From CEikdialog. |
|
142 * @param aControlId the control which is to be focused. |
|
143 * @since 3.0 |
|
144 */ |
|
145 void TryChangeFocusToL( TInt aControlId ); |
|
146 |
|
147 /** |
|
148 * From CEikdialog. |
|
149 * @param aType type of the event |
|
150 * @since 3.0 |
|
151 */ |
|
152 void HandleResourceChange( TInt aType ); |
|
153 |
|
154 /** |
|
155 * From CAknMultiLineDataQueryDialog. |
|
156 * Called by OfferkeyEventL(), gives a change to dismiss the query even with |
|
157 * keys different than Enter of Ok. |
|
158 * @since S60 v3.1 |
|
159 * @param aKeyEvent Key event which will be checked. |
|
160 * @return Should the query be dismissed. |
|
161 */ |
|
162 TBool NeedToDismissQueryL( const TKeyEvent& aKeyEvent ); |
|
163 |
|
164 private: // New functions |
|
165 |
|
166 /** |
|
167 * Detects which line focus initially. |
|
168 * This utility fuction is used by NewL() |
|
169 * @see DoSetInitialCurrentLineL |
|
170 * |
|
171 * @since 2.1 |
|
172 * @param aFirstLine The first editor text. |
|
173 * @param aSecondLine The second editor text. |
|
174 * @return Enumeration of the line to initially to focus. |
|
175 */ |
|
176 static TInitialFocus DetectLineToFocus( const TDesC& aFirstLine, |
|
177 const TDesC& aSecondLine ); |
|
178 |
|
179 /** |
|
180 * Does the actual initial focusing. |
|
181 * Focusing is determined from iInitialFocus member. |
|
182 * |
|
183 * @since 2.1 |
|
184 */ |
|
185 void DoSetInitialCurrentLineL(); |
|
186 |
|
187 /** |
|
188 * Reads integer resource value from resources |
|
189 * @param aResourceId resource id which is read |
|
190 * @return value of wanted integer resource flag |
|
191 */ |
|
192 TInt IntResourceValueL( TInt aResourceId ); |
|
193 |
|
194 /** |
|
195 * Opens correct resource file. |
|
196 * !!! Two items left to cleanup stack. !!! |
|
197 * @param aResourceFile Contains opened file on return |
|
198 * @since 3.1 |
|
199 */ |
|
200 void OpenResourceFileLC( RResourceFile& aResourceFile ); |
|
201 |
|
202 /** |
|
203 * Checks if the data entered by user is sufficient to login |
|
204 * @ return Is it ok to Sign on i.e. user has entered the credentials |
|
205 */ |
|
206 TBool CanSignOnL(); |
|
207 |
|
208 /** |
|
209 * Opens a web browser |
|
210 * @param a URL to be opened. |
|
211 */ |
|
212 void OpenWebBrowserL( const TDesC& aUrl ); |
|
213 |
|
214 /** |
|
215 * Shows terms and conditions query dialog |
|
216 * @return User agrees or refuses Terms and conditions |
|
217 */ |
|
218 TInt ShowTAndCDlgL(); |
|
219 |
|
220 private: // data |
|
221 |
|
222 ///< The initial focus, owned. |
|
223 TInitialFocus iInitialFocus; |
|
224 |
|
225 ///< Defines that the cursor is in the beginning of the |
|
226 ///< initially focused field. Owned. |
|
227 TBool iCursorToBeginning; |
|
228 |
|
229 ///< UI facade, not owned |
|
230 MCnUiUiFacade& iUiFacade; |
|
231 |
|
232 // Is Domain selection query variation on or off. |
|
233 TBool iDomainSelectionQueryVariation; |
|
234 |
|
235 // Should dialog be exited, used in OkToExitL |
|
236 TBool iForcedExit; |
|
237 |
|
238 // Browser launcher |
|
239 CBrowserLauncher* iBrLauncher; |
|
240 |
|
241 |
|
242 // file handle used by resource file reading routine |
|
243 RFs iRFs; |
|
244 |
|
245 //owns |
|
246 MIMPSSharedData* iSharedData; |
|
247 }; |
|
248 |
|
249 #endif // CCNOUIUSERNAMEANDPWDQUERY_H |
|
250 |
|
251 |
|
252 // End of File |
|
253 |