|
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: IMPS Presence login detail validator |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include <e32std.h> |
|
20 #include <aputils.h> |
|
21 #include <commdb.h> |
|
22 #include "IMPSPresenceLoginDetailValidator.h" |
|
23 #include "CnUiIMPSIdValidator.h" |
|
24 #include "IMPSCommonUiDebugPrint.h" |
|
25 |
|
26 // ================= MEMBER FUNCTIONS ======================= |
|
27 // ----------------------------------------------------------------------------- |
|
28 // IMPSPresenceLoginDetailValidator::ValidWVLoginIdL() |
|
29 // ----------------------------------------------------------------------------- |
|
30 // |
|
31 EXPORT_C TBool IMPSPresenceLoginDetailValidator::ValidWVLoginIdL( const TDesC& aWvId ) |
|
32 { |
|
33 IMPSCUI_DP( D_IMPSCUI_LIT( "IMPSPresenceLoginDetailValidator::ValidWVLoginIdL() [%S]" ), &aWvId ); |
|
34 return CnUiIMPSIdValidator::ValidLoginIdL( aWvId ); |
|
35 } |
|
36 |
|
37 |
|
38 // ----------------------------------------------------------------------------- |
|
39 // IMPSPresenceLoginDetailValidator::ValidWVLoginIAPL() |
|
40 // ----------------------------------------------------------------------------- |
|
41 // |
|
42 EXPORT_C TBool IMPSPresenceLoginDetailValidator::ValidWVLoginIAPL( TUint32 aIAP ) |
|
43 { |
|
44 IMPSCUI_DP( D_IMPSCUI_LIT( "IMPSPresenceLoginDetailValidator::ValidWVLoginIAPL() [%d]" ), aIAP ); |
|
45 |
|
46 CCommsDatabase* commsDb = CCommsDatabase::NewL( EDatabaseTypeIAP ); |
|
47 CleanupStack::PushL( commsDb ); |
|
48 CApUtils* apUtils = CApUtils::NewLC( *commsDb ); |
|
49 |
|
50 TBool isValid = EFalse; |
|
51 TBool exits = EFalse; |
|
52 |
|
53 //apUtils->IAPExistsL might leave if aIAP doesn't exist. |
|
54 //we want return this existence status as TBool, so a TRAP here. |
|
55 TRAPD( err, ( exits = apUtils->IAPExistsL( aIAP ) ) ) |
|
56 if ( ( err == KErrNone ) && exits ) |
|
57 { |
|
58 isValid = ETrue; |
|
59 } |
|
60 |
|
61 CleanupStack::PopAndDestroy( 2 ); // apUtils, commsDb |
|
62 return isValid; |
|
63 } |
|
64 |
|
65 |
|
66 // End of File |
|
67 |
|
68 |
|
69 |
|
70 |