|
1 /* |
|
2 * Copyright (c) 2001-2009 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 the License "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: Implementation of authentication query dialog class of Pap Notifier |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <papnotifdlgui.rsg> |
|
22 #include "papnotifdlgplugin.h" |
|
23 #include "papauthdialog.h" |
|
24 |
|
25 |
|
26 // ============================ MEMBER FUNCTIONS =============================== |
|
27 |
|
28 // ----------------------------------------------------------------------------- |
|
29 // CPapAuthDialog::CPapAuthDialog |
|
30 // ----------------------------------------------------------------------------- |
|
31 // |
|
32 CPapAuthDialog::CPapAuthDialog( CPapNotifDialogPlugin* aPlugin ) |
|
33 : CAknMultiLineDataQueryDialog( ENoTone ), |
|
34 iPlugin( aPlugin ) |
|
35 { |
|
36 } |
|
37 |
|
38 |
|
39 // ----------------------------------------------------------------------------- |
|
40 // CPapAuthDialog::NewL |
|
41 // ----------------------------------------------------------------------------- |
|
42 // |
|
43 CPapAuthDialog* CPapAuthDialog::NewL( TDes& aUsername, TDes& aPassword, |
|
44 CPapNotifDialogPlugin* aPlugin ) |
|
45 { |
|
46 CPapAuthDialog* self = new( ELeave ) CPapAuthDialog( aPlugin ); |
|
47 CleanupStack::PushL( self ); |
|
48 if ( aUsername.Length() ) |
|
49 { |
|
50 self->SetDataL( aUsername, aPassword ); |
|
51 } |
|
52 |
|
53 CleanupStack::Pop( self ); |
|
54 return self; |
|
55 } |
|
56 |
|
57 |
|
58 // ----------------------------------------------------------------------------- |
|
59 // CPapAuthDialog::ConstructL |
|
60 // ----------------------------------------------------------------------------- |
|
61 // |
|
62 void CPapAuthDialog::ConstructL() |
|
63 { |
|
64 #if defined( _DEBUG ) || defined( DEBUG ) |
|
65 RDebug::Print(_L("CPapAuthDialog::ConstructL") ); |
|
66 #endif |
|
67 } |
|
68 |
|
69 |
|
70 // ----------------------------------------------------------------------------- |
|
71 // CPapAuthDialog::~CPapAuthDialog |
|
72 // ----------------------------------------------------------------------------- |
|
73 // |
|
74 CPapAuthDialog::~CPapAuthDialog() |
|
75 { |
|
76 } |
|
77 |
|
78 |
|
79 // ----------------------------------------------------------------------------- |
|
80 // CPapAuthDialog::OkToExitL |
|
81 // ----------------------------------------------------------------------------- |
|
82 // |
|
83 TBool CPapAuthDialog::OkToExitL( TInt aButtonId ) |
|
84 { |
|
85 if ( CAknMultiLineDataQueryDialog::OkToExitL( aButtonId ) ) |
|
86 { |
|
87 if ( aButtonId == EAknSoftkeyOk ) |
|
88 { |
|
89 #if defined( _DEBUG ) || defined( DEBUG ) |
|
90 RDebug::Print(_L("CPapAuthDialog::OkToExitL, softkey OK") ); |
|
91 #endif |
|
92 |
|
93 // save the user entries to be sent back to eapol |
|
94 CAknMultilineQueryControl* firstControl = FirstControl(); |
|
95 firstControl->GetText( iPlugin->Username() ); |
|
96 |
|
97 CAknMultilineQueryControl* secondControl = SecondControl(); |
|
98 secondControl->GetText( iPlugin->Password() ); |
|
99 |
|
100 iPlugin->SetAuthDlgDismissed(); |
|
101 iPlugin->CompleteL( KErrNone ); |
|
102 return( ETrue ); |
|
103 } |
|
104 else |
|
105 { |
|
106 #if defined( _DEBUG ) || defined( DEBUG ) |
|
107 RDebug::Print(_L("CPapAuthDialog::OkToExitL, softkey Cancel") ); |
|
108 #endif |
|
109 |
|
110 iPlugin->SetAuthDlgDismissed(); |
|
111 iPlugin->CompleteL( KErrCancel ); |
|
112 return( ETrue ); |
|
113 } |
|
114 } |
|
115 |
|
116 return( EFalse ); |
|
117 } |
|
118 |
|
119 |
|
120 // ----------------------------------------------------------------------------- |
|
121 // CPapAuthDialog::HandleResourceChange |
|
122 // ----------------------------------------------------------------------------- |
|
123 // |
|
124 void CPapAuthDialog::HandleResourceChange( TInt aType ) |
|
125 { |
|
126 CAknMultiLineDataQueryDialog::HandleResourceChange( aType ); |
|
127 |
|
128 if ( aType == KAknsMessageSkinChange ) |
|
129 { |
|
130 } |
|
131 } |
|
132 |
|
133 |
|
134 // End of File |