|
1 /* |
|
2 * Copyright (c) 2008 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: Control step driver. |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include <E32std.h> |
|
20 #include <e32property.h> |
|
21 #include <StringLoader.h> |
|
22 #include <aknmessagequerydialog.h> |
|
23 #include <ImpsConnectionUiNg.rsg> |
|
24 |
|
25 #include "IMPSUIDDefs.h" |
|
26 #include "MIMPSSharedData.h" |
|
27 #include "ccnuiroamingcntrlstep.h" |
|
28 #include "cimpsresourcereader.h" |
|
29 |
|
30 // ================= MEMBER FUNCTIONS ======================= |
|
31 // Two-phased constructor. |
|
32 CCnUiRoamingCntrlStep* CCnUiRoamingCntrlStep::NewLC() |
|
33 { |
|
34 CCnUiRoamingCntrlStep* self = new ( ELeave ) CCnUiRoamingCntrlStep(); |
|
35 CleanupStack::PushL( self ); |
|
36 return self; |
|
37 } |
|
38 |
|
39 |
|
40 // Destructor |
|
41 CCnUiRoamingCntrlStep::~CCnUiRoamingCntrlStep() |
|
42 { |
|
43 } |
|
44 |
|
45 // C++ default constructor can NOT contain any code, that |
|
46 // might leave. |
|
47 // |
|
48 CCnUiRoamingCntrlStep::CCnUiRoamingCntrlStep() |
|
49 { |
|
50 } |
|
51 |
|
52 // ----------------------------------------------------------------------------- |
|
53 // CCnUiRoamingCntrlStep::RunStepL() |
|
54 // from MCnUiCntrlStep |
|
55 // ----------------------------------------------------------------------------- |
|
56 // |
|
57 TInt CCnUiRoamingCntrlStep::RunStepL() |
|
58 { |
|
59 // Show warning note |
|
60 TInt okToContinue = KErrNone; |
|
61 |
|
62 // Ask user if wishes to continue |
|
63 TInt commandId = ShowRoamingDlgL(); |
|
64 if ( commandId == EAknSoftkeyYes ) |
|
65 { |
|
66 // Set the property of dialog shown to True |
|
67 RProperty roaming; |
|
68 User::LeaveIfError( roaming.Set( KIMPSConnUiTemporaryUid, EIMPSSharedKeysRoamingDlgShown, ETrue ) ); |
|
69 okToContinue = KErrNone; |
|
70 } |
|
71 else |
|
72 { |
|
73 okToContinue = KErrCancel; |
|
74 } |
|
75 |
|
76 return okToContinue; |
|
77 } |
|
78 |
|
79 |
|
80 // ----------------------------------------------------------------------------- |
|
81 // CCnUiRoamingCntrlStep::ShowWAPQueryL |
|
82 // ----------------------------------------------------------------------------- |
|
83 // |
|
84 TInt CCnUiRoamingCntrlStep::ShowRoamingDlgL() |
|
85 { |
|
86 CAknMessageQueryDialog* msgQueryDlg = new( ELeave )CAknMessageQueryDialog( CAknMessageQueryDialog::ENoTone ); |
|
87 CleanupStack::PushL( msgQueryDlg ); |
|
88 |
|
89 msgQueryDlg->PrepareLC( R_MESSAGE_QUERY ); |
|
90 msgQueryDlg->ButtonGroupContainer().SetCommandSetL( R_AVKON_SOFTKEYS_YES_NO ); |
|
91 |
|
92 HBufC* resourceText = NULL; |
|
93 resourceText = StringLoader::LoadL( R_QTN_NOTE_ROAMING_ORANGE ); |
|
94 msgQueryDlg->SetMessageText( *resourceText ); |
|
95 |
|
96 resourceText = StringLoader::LoadL( R_QTN_NOTE_TITLE_ROAMING_ORANGE ); |
|
97 msgQueryDlg->SetHeaderText( *resourceText ); |
|
98 |
|
99 CleanupStack::Pop( msgQueryDlg ); |
|
100 |
|
101 TInt command = msgQueryDlg->RunLD(); |
|
102 return command; |
|
103 } |
|
104 |
|
105 |
|
106 // ----------------------------------------------------------------------------- |
|
107 // CCnUiRoamingCntrlStep::HandleCompleteL() |
|
108 // from MCnUiCntrlStep |
|
109 // ----------------------------------------------------------------------------- |
|
110 // |
|
111 TCnUiHandleCompleteStatus CCnUiRoamingCntrlStep::HandleCompleteL() |
|
112 { |
|
113 //nothing to complete |
|
114 return ECnUiStepContinueTeardown; |
|
115 } |
|
116 |
|
117 |
|
118 // ----------------------------------------------------------------------------- |
|
119 // CCnUiRoamingCntrlStep::UndoStepL() |
|
120 // from MCnUiCntrlStep |
|
121 // ----------------------------------------------------------------------------- |
|
122 // |
|
123 void CCnUiRoamingCntrlStep::UndoStepL() |
|
124 { |
|
125 //nothing to undo |
|
126 RProperty roaming; |
|
127 User::LeaveIfError( roaming.Set( KIMPSConnUiTemporaryUid, EIMPSSharedKeysRoamingDlgShown, EFalse ) ); |
|
128 } |
|
129 |
|
130 // End of File |
|
131 |
|
132 |