|
1 /* |
|
2 * Copyright (c) 2006 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: Dialogue handler for TOU |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "cvimpstuitermsofusedialoghandler.h" |
|
20 #include "cvimpstuitermsofusedlg.h" |
|
21 |
|
22 #include "cvimpstsettingsstore.h" |
|
23 #include <vimpstuires.rsg> |
|
24 #include <avkon.hrh> |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 // ======== MEMBER FUNCTIONS ======== |
|
31 |
|
32 // --------------------------------------------------------------------------- |
|
33 // CVIMPSTUiTermsOfUseDialogHandler::HandleTermsOfUseDialogLD |
|
34 // --------------------------------------------------------------------------- |
|
35 // |
|
36 TInt CVIMPSTUiTermsOfUseDialogHandler::HandleTermsOfUseDialogLD( |
|
37 MVIMPSTSettingsStore& aSettingsStore, |
|
38 const TDesC& /*aUserName*/, |
|
39 TInt& aServiceId, |
|
40 HBufC* aToUMsg/* = NULL*/) |
|
41 { |
|
42 // Show Terms of Use, return KErrCancel if user does not accept them, |
|
43 // otherwise continue |
|
44 if ( !DisplayTermsOfUseAndQueryLD(aToUMsg) ) |
|
45 { |
|
46 // User canceled ToU query, login cancelled |
|
47 // note is already shown inside DisplayTermsOfUseAndQueryL |
|
48 // method, just return KErrCancel |
|
49 //CleanupStack::PopAndDestroy(tmpSap); |
|
50 return KErrCancel; |
|
51 } |
|
52 else |
|
53 { |
|
54 TInt touOff =1; |
|
55 aSettingsStore.SetL(aServiceId, ETOUDlgOff, touOff ); |
|
56 } |
|
57 return KErrNone; |
|
58 } |
|
59 |
|
60 // ----------------------------------------------------------------------------- |
|
61 // CVIMPSTUiTermsOfUseDialogHandler::DisplayTermsOfUseAndQueryLD() |
|
62 // ----------------------------------------------------------------------------- |
|
63 // |
|
64 TBool CVIMPSTUiTermsOfUseDialogHandler::DisplayTermsOfUseAndQueryLD(HBufC* aToUMsg/* = NULL*/) |
|
65 { |
|
66 TInt retVal = EAknSoftkeyCancel; |
|
67 CVIMPSTUiTermsOfUseDlg* dlg = CVIMPSTUiTermsOfUseDlg::NewLC( ); |
|
68 dlg->SetToUMsgL(aToUMsg); |
|
69 retVal = dlg->RunDialogLD( R_CNUI_TERMS_OF_USE_DIALOG ); |
|
70 CleanupStack::Pop(dlg); |
|
71 if ( retVal == EAknSoftkeyOk || retVal == EAknSoftkeyYes) |
|
72 { |
|
73 return ETrue; |
|
74 } |
|
75 else |
|
76 { |
|
77 return EFalse; |
|
78 } |
|
79 } |
|
80 |
|
81 //End of File |