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