|
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 the License "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: Provides utility functions |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef C_SEARCHFIELDS_H |
|
22 #define C_SEARCHFIELDS_H |
|
23 |
|
24 //searchfields.h - defines mapping for contacts UIDs. |
|
25 #include <VPbkEng.rsg> |
|
26 #include <CVPbkFieldTypeRefsList.h> //Used to specify search fields |
|
27 #include <CVPbkContactManager.h> |
|
28 #include <cntdef.h> |
|
29 |
|
30 #include "contactservice.h" |
|
31 |
|
32 class CContactService; |
|
33 |
|
34 #define SIZEOFTABLE 79 |
|
35 |
|
36 const TInt KInvalidFieldID = -1; |
|
37 |
|
38 //Structure to define the fields in the mapping table |
|
39 typedef struct UIDMapping |
|
40 { |
|
41 TInt iFieldId; |
|
42 TPtrC8 iFieldValue; |
|
43 }MAPPING_TABLE; |
|
44 |
|
45 //Mapping Table for different contact fields in contact model. |
|
46 extern MAPPING_TABLE mappingTable[SIZEOFTABLE]; |
|
47 |
|
48 class CSearchFields:public CBase |
|
49 { |
|
50 public:// Construction and Destruction |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 * @return CSearchFields* |
|
55 */ |
|
56 IMPORT_C static CSearchFields* NewL(CContactService* aContactService); |
|
57 static CSearchFields* NewL(); |
|
58 /** |
|
59 * Destructor - virtual and class not intended |
|
60 * for derivation, so not exported |
|
61 */ |
|
62 |
|
63 public:// General Functions - Exported |
|
64 IMPORT_C void AppendL(TDesC8& aFieldName); |
|
65 |
|
66 //Functions for internal use |
|
67 |
|
68 //Gets the RefField List |
|
69 CVPbkFieldTypeRefsList* GetFieldListL(); |
|
70 |
|
71 //Gets the FieldKeyValue for the FieldId specified |
|
72 IMPORT_C static TPtrC8 GetFieldKeyFromId( TInt aFieldId ); |
|
73 |
|
74 //Gets the FieldId for the FieldKeyValue specified |
|
75 IMPORT_C static TInt GetIdFromFieldKey(TDesC8& aFieldValue); |
|
76 |
|
77 //Gets the FieldId from Index |
|
78 static TInt GetIdfromIndex(TInt index); |
|
79 |
|
80 //Gets the size of the table |
|
81 static TInt GetSizeofTable(); |
|
82 |
|
83 //Destructor |
|
84 ~CSearchFields(); |
|
85 |
|
86 private: |
|
87 void ConstructL(CContactService* aContactService); |
|
88 private: |
|
89 //Pointer to contact service class |
|
90 CContactService* iContactService; |
|
91 |
|
92 //FieldType Ref List |
|
93 CVPbkFieldTypeRefsList* iFieldList; |
|
94 }; |
|
95 |
|
96 #endif //CONTACTMAPPINGTABLE_H |