|
1 /* |
|
2 * Copyright (c) 2006-2007 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: A class for creating phonebook2 field properties |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <Pbk2FieldPropertiesFactory.h> |
|
20 #include <CPbk2FieldPropertyArray.h> |
|
21 #include <f32file.h> |
|
22 |
|
23 // ======== MEMBER FUNCTIONS ======== |
|
24 |
|
25 // --------------------------------------------------------------------------- |
|
26 // CreateL |
|
27 // --------------------------------------------------------------------------- |
|
28 // |
|
29 EXPORT_C MPbk2FieldPropertyArray* Pbk2FieldPropertiesFactory::CreateL( |
|
30 const MVPbkFieldTypeList& aSupportedFieldTypeList, RFs* aRFs ) |
|
31 { |
|
32 RFs fs; |
|
33 RFs ownFs; |
|
34 if ( !aRFs ) |
|
35 { |
|
36 User::LeaveIfError( ownFs.Connect() ); |
|
37 CleanupClosePushL( ownFs ); |
|
38 fs = ownFs; |
|
39 } |
|
40 else |
|
41 { |
|
42 fs = *aRFs; |
|
43 } |
|
44 |
|
45 MPbk2FieldPropertyArray* properties = |
|
46 CPbk2FieldPropertyArray::NewL( aSupportedFieldTypeList, fs ); |
|
47 |
|
48 if ( ownFs.Handle() ) |
|
49 { |
|
50 CleanupStack::PopAndDestroy(); // ownFs |
|
51 } |
|
52 |
|
53 return properties; |
|
54 } |
|
55 |
|
56 |
|
57 // --------------------------------------------------------------------------- |
|
58 // CreateLC |
|
59 // --------------------------------------------------------------------------- |
|
60 // |
|
61 EXPORT_C MPbk2FieldPropertyArray* Pbk2FieldPropertiesFactory::CreateLC( |
|
62 const MVPbkFieldTypeList& aSupportedFieldTypeList, RFs* aRFs ) |
|
63 { |
|
64 MPbk2FieldPropertyArray* result = |
|
65 CreateL( aSupportedFieldTypeList, aRFs ); |
|
66 CleanupDeletePushL( result ); |
|
67 return result; |
|
68 } |