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