|
1 /* |
|
2 * Copyright (c) 2005-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: Phonebook 2 contact address tools. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef PBK2ADDRESSTOOLS_H |
|
19 #define PBK2ADDRESSTOOLS_H |
|
20 |
|
21 #include "TPbk2ContactEditorParams.h" |
|
22 #include <Pbk2FieldProperty.hrh> |
|
23 #include <VPbkFieldType.hrh> |
|
24 #include <e32hashtab.h> |
|
25 |
|
26 class MVPbkStoreContact; |
|
27 |
|
28 class Pbk2AddressTools |
|
29 { |
|
30 public: |
|
31 /** |
|
32 * Maps UI contol type to feld group |
|
33 * |
|
34 * @param aCtrlType Type of control ( TPbk2FieldCtrlTypeExt ) |
|
35 * @return Suitable gruup id ( TPbk2FieldGroupId ) |
|
36 */ |
|
37 IMPORT_C static TPbk2FieldGroupId MapCtrlTypeToAddress( |
|
38 TInt aCtrlType ); |
|
39 |
|
40 /** |
|
41 * Maps UI view type to feld group |
|
42 * |
|
43 * @param aViewType Type of view |
|
44 * @return Suitable gruup id |
|
45 */ |
|
46 IMPORT_C static TPbk2FieldGroupId MapViewTypeToAddress( |
|
47 TPbk2ContactEditorParams::TActiveView aViewType ); |
|
48 |
|
49 /** |
|
50 * Maps feld group to field ordering |
|
51 * |
|
52 * @param aGroupAddress field group |
|
53 * @return Suitable field ordering |
|
54 */ |
|
55 IMPORT_C static TInt MapAddressToOrdering( |
|
56 TPbk2FieldGroupId aGroupAddress ); |
|
57 |
|
58 /** |
|
59 * Maps feld group to field ordering |
|
60 * |
|
61 * @param aGroupAddress field group |
|
62 * @return Suitable field ordering |
|
63 */ |
|
64 IMPORT_C static TPbk2ContactEditorParams::TActiveView MapCtrlTypeToViewType( |
|
65 TInt aCtrlType ); |
|
66 |
|
67 /** |
|
68 * Maps feld group to field type parameter |
|
69 * |
|
70 * @param aGroupAddress field group |
|
71 * @return Suitable field type parameter |
|
72 */ |
|
73 IMPORT_C static TVPbkFieldTypeParameter MapAddressToVersitParam( |
|
74 TPbk2FieldGroupId aGroupId ); |
|
75 |
|
76 /** |
|
77 * Creates map field type parameters to text data from these fields |
|
78 * |
|
79 * @param aContact contact |
|
80 * @param aAddressGroup field group |
|
81 * @param aFieldsMap return parameter, allocated and put on CleanapStack |
|
82 * |
|
83 */ |
|
84 IMPORT_C static void GetAddressFieldsLC( |
|
85 MVPbkStoreContact& aContact, |
|
86 TPbk2FieldGroupId aAddressGroup, |
|
87 RHashMap<TInt, TPtrC>& aFieldsMap ); |
|
88 |
|
89 /** |
|
90 * Creates address preview text from QTN_PHOB_ADDRESS_PREVIEW |
|
91 * or QTN_PHOB_CONTACT_EDITOR_DEFINE if suitable fields are empty |
|
92 * |
|
93 * @param aContact contact |
|
94 * @param aAddressGroup field group |
|
95 * @param aFieldsMap return parameter, allocated and put on CleanapStack |
|
96 * |
|
97 */ |
|
98 IMPORT_C static void GetAddressPreviewLC( |
|
99 MVPbkStoreContact& aContact, |
|
100 TPbk2FieldGroupId aAddressGroup, |
|
101 RBuf& aText ); |
|
102 |
|
103 /** |
|
104 * Creates address preview text from qtn_phob_commlauncher_onelinepreview |
|
105 * or QTN_PHOB_POPUP_INCOMPLETE_ADDRESS if suitable fields are empty |
|
106 * |
|
107 * @param aContact contact |
|
108 * @param aAddressGroup field group |
|
109 * @param aFieldsMap return parameter, allocated and put on CleanapStack |
|
110 * |
|
111 */ |
|
112 IMPORT_C static void GetAddressShortPreviewLC( |
|
113 MVPbkStoreContact& aContact, |
|
114 TPbk2FieldGroupId aAddressGroup, |
|
115 RBuf& aText ); |
|
116 }; |
|
117 |
|
118 #endif // PBK2ADDRESSTOOLS_H |
|
119 |
|
120 // End of File |