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