|
1 /* |
|
2 * Copyright (c) 2005 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: Implementation of CEasyWpaDlgNotif |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "EasyWpaDlgNotif.h" |
|
21 #include "WepWpaQueryDlg.h" |
|
22 #include "ConnUiUtilsNotif.h" |
|
23 |
|
24 #include <ConnUiUtilsNotif.rsg> |
|
25 #include <StringLoader.h> |
|
26 |
|
27 |
|
28 // ================= MEMBER FUNCTIONS ======================= |
|
29 |
|
30 // --------------------------------------------------------- |
|
31 // CEasyWpaDlgNotif::TNotifierInfo CEasyWpaDlgNotif::RegisterL() |
|
32 // --------------------------------------------------------- |
|
33 // |
|
34 CEasyWpaDlgNotif::TNotifierInfo CEasyWpaDlgNotif::RegisterL() |
|
35 { |
|
36 iInfo.iUid = KUidEasyWpaDlg; |
|
37 iInfo.iPriority = ENotifierPriorityHigh; |
|
38 iInfo.iChannel = KUidEasyWpaDlg; |
|
39 |
|
40 return iInfo; |
|
41 } |
|
42 |
|
43 // --------------------------------------------------------- |
|
44 // void CEasyWpaDlgNotif::StartL |
|
45 // --------------------------------------------------------- |
|
46 // |
|
47 void CEasyWpaDlgNotif::StartL( const TDesC8& /*aBuffer*/, |
|
48 TInt aReplySlot, |
|
49 const RMessagePtr2& aMessage ) |
|
50 { |
|
51 iReplySlot = aReplySlot; |
|
52 iMessage = aMessage; |
|
53 iCancelled = EFalse; |
|
54 |
|
55 aMessage.ReadL( aReplySlot, iKey ); |
|
56 |
|
57 HBufC* msg = CCoeEnv::Static()->AllocReadResourceLC( |
|
58 R_EASY_WPA_QUERY_TEXT ); |
|
59 iDialog = new ( ELeave ) CWepWpaQueryDlg( iKey(), this, EDialogWpa, iHex ); |
|
60 iDialog->SetPromptL( *msg ); |
|
61 iDialog->SetMaxLength( KEasyWpaQueryMaxLength ); |
|
62 iDialog->ExecuteLD( R_EASY_WEP_WPA_DLG ); |
|
63 CleanupStack::PopAndDestroy( msg ); |
|
64 } |
|
65 |
|
66 // --------------------------------------------------------- |
|
67 // void CEasyWpaDlgNotif::Cancel() |
|
68 // --------------------------------------------------------- |
|
69 // |
|
70 void CEasyWpaDlgNotif::Cancel() |
|
71 { |
|
72 if ( !iCancelled ) |
|
73 { |
|
74 iCancelled = ETrue; |
|
75 if ( !iMessage.IsNull() ) |
|
76 { |
|
77 iMessage.Complete( KErrCancel ); |
|
78 } |
|
79 |
|
80 delete iDialog; |
|
81 iDialog = NULL; |
|
82 } |
|
83 } |
|
84 |
|
85 |
|
86 // --------------------------------------------------------- |
|
87 // void CEasyWpaDlgNotif::CompleteL( TInt aStatus ) |
|
88 // --------------------------------------------------------- |
|
89 // |
|
90 void CEasyWpaDlgNotif::CompleteL( TInt aStatus ) |
|
91 { |
|
92 iCancelled = ETrue; |
|
93 if ( !iMessage.IsNull() ) |
|
94 { |
|
95 if ( aStatus == KErrNone ) |
|
96 { |
|
97 iMessage.WriteL( iReplySlot, iKey ); |
|
98 } |
|
99 |
|
100 iMessage.Complete( aStatus ); |
|
101 } |
|
102 Cancel(); // Temporary solution |
|
103 } |
|
104 |
|
105 |
|
106 // --------------------------------------------------------- |
|
107 // CEasyWpaDlgNotif* CEasyWpaDlgNotif::NewL() |
|
108 // --------------------------------------------------------- |
|
109 // |
|
110 CEasyWpaDlgNotif* CEasyWpaDlgNotif::NewL( |
|
111 const TBool aResourceFileResponsible ) |
|
112 { |
|
113 CEasyWpaDlgNotif* self = new ( ELeave ) CEasyWpaDlgNotif(); |
|
114 CleanupStack::PushL( self ); |
|
115 self->ConstructL( KResourceFileName, aResourceFileResponsible ); |
|
116 CleanupStack::Pop(); |
|
117 |
|
118 return self; |
|
119 } |
|
120 |
|
121 // End of File |