|
1 /* |
|
2 * Copyright (c) 2006-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 "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: Confirm Dialog implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 /** |
|
19 @file mpmconfirmdlgroaming.cpp |
|
20 Roaming Dialog implementation |
|
21 */ |
|
22 |
|
23 // INCLUDE FILES |
|
24 #include "mpmconfirmdlgroaming.h" |
|
25 #include "mpmserversession.h" |
|
26 #include "mpmconnmonevents.h" |
|
27 #include "mpmlogger.h" |
|
28 |
|
29 // ============================ MEMBER FUNCTIONS =============================== |
|
30 |
|
31 // ----------------------------------------------------------------------------- |
|
32 // CMPMConfirmDlgRoaming::NewL |
|
33 // ----------------------------------------------------------------------------- |
|
34 // |
|
35 CMPMConfirmDlgRoaming* CMPMConfirmDlgRoaming::NewL( |
|
36 CMPMServerSession& aSession, |
|
37 const TUint32 aSnapId, |
|
38 const TUint32 aIAP, |
|
39 const CMPMConfirmDlg::TDialogType aDialogType, |
|
40 const TBool aReconnect ) |
|
41 { |
|
42 CMPMConfirmDlgRoaming* self = new ( ELeave ) CMPMConfirmDlgRoaming( |
|
43 aSession, |
|
44 aSnapId, |
|
45 aIAP, |
|
46 aDialogType, |
|
47 aReconnect ); |
|
48 CleanupStack::PushL( self ); |
|
49 self->ConstructL(); |
|
50 CleanupStack::Pop( self ); |
|
51 return self; |
|
52 } |
|
53 |
|
54 |
|
55 // ----------------------------------------------------------------------------- |
|
56 // CMPMConfirmDlgRoaming::CMPMConfirmDlgRoaming |
|
57 // ----------------------------------------------------------------------------- |
|
58 // |
|
59 CMPMConfirmDlgRoaming::CMPMConfirmDlgRoaming( |
|
60 CMPMServerSession& aSession, |
|
61 const TUint32 aSnapId, |
|
62 const TUint32 aIAP, |
|
63 const CMPMConfirmDlg::TDialogType aDialogType, |
|
64 const TBool aReconnect ) |
|
65 : iSession( aSession), |
|
66 iSnapId( aSnapId ), |
|
67 iIAP( aIAP ), |
|
68 iDialogType( aDialogType ), |
|
69 iConfirmDlg( NULL ), |
|
70 iReconnect( aReconnect ) |
|
71 { |
|
72 } |
|
73 |
|
74 // ----------------------------------------------------------------------------- |
|
75 // CMPMConfirmDlgRoaming::ConstructL |
|
76 // ----------------------------------------------------------------------------- |
|
77 // |
|
78 void CMPMConfirmDlgRoaming::ConstructL() |
|
79 { |
|
80 MPMLOGSTRING2("CMPMConfirmDlgRoaming<0x%x>::ConstructL()", iSession.ConnectionId()) |
|
81 CArrayPtrFlat<CMPMDialogBase>* queue = ((CArrayPtrFlat<CMPMDialogBase>*)iSession.MyServer().RoamingQueue()); |
|
82 iConfirmDlg = CMPMConfirmDlg::NewL( *queue, |
|
83 *this, |
|
84 iSnapId, |
|
85 iIAP, |
|
86 iDialogType ); |
|
87 } |
|
88 |
|
89 |
|
90 // ----------------------------------------------------------------------------- |
|
91 // CMPMConfirmDlgRoaming::~CMPMConfirmDlgRoaming |
|
92 // ----------------------------------------------------------------------------- |
|
93 // |
|
94 CMPMConfirmDlgRoaming::~CMPMConfirmDlgRoaming() |
|
95 { |
|
96 MPMLOGSTRING2( "CMPMConfirmDlgRoaming<0x%x>::~CMPMConfirmDlgRoaming", |
|
97 iSession.ConnectionId() ) |
|
98 delete iConfirmDlg; |
|
99 } |
|
100 |
|
101 |
|
102 // ----------------------------------------------------------------------------- |
|
103 // CMPMConfirmDlgRoaming::ConfirmDlgResponse |
|
104 // ----------------------------------------------------------------------------- |
|
105 // |
|
106 void CMPMConfirmDlgRoaming::ConfirmDlgResponse( |
|
107 const TInt aError, |
|
108 const TMsgQueryLinkedResults aResult ) |
|
109 { |
|
110 MPMLOGSTRING4( "CMPMConfirmDlgRoaming<0x%x>::ConfirmDlgResponse\ |
|
111 error: %d result: %d", iSession.ConnectionId(), aError, aResult ) |
|
112 |
|
113 // Store results |
|
114 // |
|
115 iError = aError; |
|
116 iMsgQuery = aResult; |
|
117 |
|
118 HandleResponse( aError, aResult ); |
|
119 |
|
120 // We are done |
|
121 // |
|
122 iSession.SetConfirmDlgRoamingPtrNull(); |
|
123 delete this; |
|
124 } |
|
125 |
|
126 |
|
127 // ----------------------------------------------------------------------------- |
|
128 // CMPMConfirmDlgRoaming::ConfirmDlgResponse |
|
129 // ----------------------------------------------------------------------------- |
|
130 // |
|
131 TBool CMPMConfirmDlgRoaming::ConfirmDlgResponse( MMPMConfirmDlg* aDlg ) |
|
132 { |
|
133 TBool ret( EFalse ); |
|
134 CMPMConfirmDlgRoaming* dlg = (CMPMConfirmDlgRoaming*)aDlg; |
|
135 if ( dlg && iIAP == dlg->iIAP ) |
|
136 { |
|
137 ConfirmDlgResponse( dlg->iError, dlg->iMsgQuery ); |
|
138 ret = ETrue; |
|
139 } |
|
140 return ret; |
|
141 } |
|
142 |
|
143 |
|
144 // ----------------------------------------------------------------------------- |
|
145 // CMPMConfirmDlgRoaming::HandleResponse |
|
146 // ----------------------------------------------------------------------------- |
|
147 // |
|
148 void CMPMConfirmDlgRoaming::HandleResponse( const TInt aError, |
|
149 const TMsgQueryLinkedResults aResult ) |
|
150 { |
|
151 MPMLOGSTRING5( "CMPMConfirmDlgRoaming<0x%x>::HandleResponse: aError %d, aResult %d, dlg type %d", |
|
152 iSession.ConnectionId(), |
|
153 aError, |
|
154 aResult, |
|
155 iDialogType ) |
|
156 |
|
157 TInt error( KErrNone ); |
|
158 |
|
159 if( aError == KErrCancel ) |
|
160 { |
|
161 TRAP(error, iSession.RoamingConfirmationCompletedL( KErrNone, |
|
162 EMsgQueryCancelled, |
|
163 iReconnect ) ) |
|
164 } |
|
165 else |
|
166 { |
|
167 TRAP(error, iSession.RoamingConfirmationCompletedL( aError, |
|
168 aResult, |
|
169 iReconnect ) ) |
|
170 } |
|
171 if( error != KErrNone ) |
|
172 { |
|
173 MPMLOGSTRING2( "CMPMConfirmDlgRoaming<0x%x>::HandleResponse: error occurred %d", |
|
174 error ) |
|
175 } |
|
176 } |
|
177 |
|
178 // End of file |