|
1 /* |
|
2 * Copyright (c) 2008 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: Address selection parameters. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef TFSCADDRESSSELECTPARAMS_H |
|
20 #define TFSCADDRESSSELECTPARAMS_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <barsread.h> |
|
25 #include <VPbkFieldType.hrh> |
|
26 #include <RVPbkContactFieldDefaultPriorities.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class MVPbkStoreContact; |
|
30 class MVPbkStoreContactField; |
|
31 class MPbk2ContactNameFormatter; |
|
32 class CVPbkContactManager; |
|
33 class CFscFieldPropertyArray; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * Address selection parameters. |
|
39 * Responsible for carrying the parameters to the address select class. |
|
40 */ |
|
41 class TFscAddressSelectParams |
|
42 { |
|
43 public: |
|
44 // Construction |
|
45 |
|
46 /** |
|
47 * Constructor. |
|
48 * |
|
49 * @param aContact Contact from where to select |
|
50 * an address. |
|
51 * @param aContactManager Virtual Phonebook contact manager. |
|
52 * @param aNameFormatter Name formatter. |
|
53 * @param aFieldPropertyArray Phonebook 2 field property array. |
|
54 * @param aReader Resource reader pointed to |
|
55 * FSC_ADDRESS_SELECT structure. |
|
56 * @param aTitleResId Resource id for title text. |
|
57 * Default = 0. If default, the memory |
|
58 * entry name is used as a title. |
|
59 */ |
|
60 TFscAddressSelectParams(MVPbkStoreContact& aContact, |
|
61 const CVPbkContactManager& aContactManager, |
|
62 MPbk2ContactNameFormatter& aNameFormatter, |
|
63 const CFscFieldPropertyArray& aFieldPropertyArray, |
|
64 TResourceReader& aReader, TInt aTitleResId = 0); |
|
65 |
|
66 public: |
|
67 // Interface |
|
68 |
|
69 /** |
|
70 * Sets the focused field of the contact. If focused field |
|
71 * is a non-empty address field it is returned directly by |
|
72 * ExecuteLD. Defaults to NULL. |
|
73 * |
|
74 * @param aFocusedField The focused field to set. |
|
75 */ |
|
76 void SetFocusedField(const MVPbkStoreContactField* aFocusedField); |
|
77 |
|
78 /** |
|
79 * Sets the default to be used in address select. The |
|
80 * defaults in the array should be in priority order. |
|
81 * If the priorities array is not set, no defaults are used. |
|
82 * Focused field overrides default address if both are |
|
83 * available. |
|
84 * |
|
85 * @param aDefaultPriorities An array of default properties in |
|
86 * priority order. |
|
87 */ |
|
88 void SetDefaultPriorities( |
|
89 const RVPbkContactFieldDefaultPriorities& aDefaultPriorities); |
|
90 |
|
91 /** |
|
92 * Set to ETrue to use default address of the contact directly. |
|
93 * Focused field overrides default address if both are |
|
94 * available. Default value for this parameter is EFalse. |
|
95 * |
|
96 * @param aUseDefaultDirectly Defines should the default address |
|
97 * be used directly. |
|
98 */ |
|
99 void SetUseDefaultDirectly( TBool aUseDefaultDirectly ); |
|
100 |
|
101 public: |
|
102 // Data |
|
103 /// Ref: Contact where to select an address from |
|
104 MVPbkStoreContact& iContact; |
|
105 /// Ref: Virtual Phonebook contact manager |
|
106 const CVPbkContactManager& iContactManager; |
|
107 /// Ref: Contact name formatter. |
|
108 MPbk2ContactNameFormatter& iNameFormatter; |
|
109 /// Ref: Phonebook 2 field property array. |
|
110 const CFscFieldPropertyArray& iFieldPropertyArray; |
|
111 /// Ref: Resource reader. |
|
112 TResourceReader& iResReader; |
|
113 /// Own: Title resource id |
|
114 TInt iTitleResId; |
|
115 /// Ref: Focused field of the contact. |
|
116 const MVPbkStoreContactField* iFocusedField; |
|
117 /// Ref: Prioritized array of defaults to use. |
|
118 const RVPbkContactFieldDefaultPriorities* iDefaultPriorities; |
|
119 /// Own: Indicates should the default address be used directly |
|
120 TBool iUseDefaultDirectly; |
|
121 /// Own: Indicates whether to include contact name in custom prompt. |
|
122 /// Custom prompt refers to iTitleResId. |
|
123 TBool iIncludeContactNameInPrompt; |
|
124 /// Own: Indicates are the warnings suppressed |
|
125 TBool iSuppressWarnings; |
|
126 |
|
127 private: |
|
128 // Friends |
|
129 friend class CFscAddressSelect; |
|
130 }; |
|
131 |
|
132 #endif // TFSCADDRESSSELECTPARAMS_H |
|
133 // End of File |