|
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: |
|
15 * CImumUsernameAndPasswordDialog implementation file. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 // INCLUDE FILES |
|
22 #include <layoutmetadata.cdl.h> |
|
23 |
|
24 #include "ImumUsernameAndPasswordDialog.h" |
|
25 #include "ImumMtmLogging.h" |
|
26 |
|
27 // ================= MEMBER FUNCTIONS ======================= |
|
28 |
|
29 // C++ default constructor can NOT contain any code, that |
|
30 // might leave. |
|
31 // |
|
32 CImumUsernameAndPasswordDialog::CImumUsernameAndPasswordDialog( TTone aTone /*= ENoTone*/ ) |
|
33 : CAknMultiLineDataQueryDialog( aTone ) |
|
34 { |
|
35 IMUM_CONTEXT( CImumUsernameAndPasswordDialog::CImumUsernameAndPasswordDialog, 0, KImumMtmLog ); |
|
36 IMUM_IN(); |
|
37 IMUM_OUT(); |
|
38 |
|
39 } |
|
40 |
|
41 |
|
42 // Two-phased constructor. |
|
43 CImumUsernameAndPasswordDialog* CImumUsernameAndPasswordDialog::NewL( |
|
44 TDes& aUsername, TDes& aPassword ) |
|
45 { |
|
46 IMUM_STATIC_CONTEXT( CImumUsernameAndPasswordDialog::NewL, 0, mtm, KImumMtmLog ); |
|
47 IMUM_IN(); |
|
48 |
|
49 CImumUsernameAndPasswordDialog* dialog=new(ELeave) CImumUsernameAndPasswordDialog(); |
|
50 CleanupStack::PushL(dialog); |
|
51 dialog->SetDataL(aUsername, aPassword); |
|
52 CleanupStack::Pop(dialog); |
|
53 IMUM_OUT(); |
|
54 return dialog; |
|
55 } |
|
56 |
|
57 // Destructor |
|
58 CImumUsernameAndPasswordDialog::~CImumUsernameAndPasswordDialog() |
|
59 { |
|
60 IMUM_CONTEXT( CImumUsernameAndPasswordDialog::~CImumUsernameAndPasswordDialog, 0, KImumMtmLog ); |
|
61 IMUM_IN(); |
|
62 IMUM_OUT(); |
|
63 |
|
64 } |
|
65 |
|
66 void CImumUsernameAndPasswordDialog::SetInitialCurrentLine() |
|
67 { |
|
68 IMUM_CONTEXT( CImumUsernameAndPasswordDialog::SetInitialCurrentLine, 0, KImumMtmLog ); |
|
69 IMUM_IN(); |
|
70 |
|
71 CAknMultiLineDataQueryDialog::SetInitialCurrentLine(); |
|
72 |
|
73 // If the username contains data... |
|
74 if ( FirstData( TPtr( 0,0 ) ). Length() > 0 ) |
|
75 { |
|
76 // ...For portrait mode, multiline query is shown |
|
77 if ( !Layout_Meta_Data::IsLandscapeOrientation() ) |
|
78 { |
|
79 // In case the username is already set, switch the |
|
80 // focus to password line |
|
81 TRAP_IGNORE( TryChangeFocusToL( EMultilineSecondLine ) ); |
|
82 } |
|
83 // ...In landscape mode, username and password queries are |
|
84 // shown separately |
|
85 else |
|
86 { |
|
87 // Show the ok key |
|
88 TRAP_IGNORE( UpdateLeftSoftKeyL() ); |
|
89 } |
|
90 } |
|
91 IMUM_OUT(); |
|
92 } |
|
93 |
|
94 |
|
95 |
|
96 // End of File |
|
97 |
|
98 |
|
99 |