|
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 field property. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPBK2FIELDPROPERTY_H |
|
20 #define CPBK2FIELDPROPERTY_H |
|
21 |
|
22 // INCLUDE FILES |
|
23 #include <e32base.h> |
|
24 #include <MPbk2FieldProperty.h> |
|
25 #include <MPbk2FieldProperty2.h> |
|
26 #include <TPbk2IconId.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class TResourceReader; |
|
30 class MVPbkFieldTypeList; |
|
31 class CPbk2FieldOrderingManager; |
|
32 class CPbk2FieldPropertyArray; |
|
33 |
|
34 /** |
|
35 * Phonebook 2 field property. |
|
36 * Field property for a Phonebook 2 field type. |
|
37 * Field property contains data for contact field presentation |
|
38 * in the UI. |
|
39 */ |
|
40 NONSHARABLE_CLASS(CPbk2FieldProperty) : public CBase, |
|
41 public MPbk2FieldProperty, |
|
42 public MPbk2FieldProperty2 |
|
43 { |
|
44 friend class CPbk2FieldPropertyArray; |
|
45 public: // Construction and destruction |
|
46 |
|
47 /** |
|
48 * Creates a new instance of this class. |
|
49 * |
|
50 * @param aReader Resource reader pointed to a |
|
51 * PHONEBOOK2_FIELD_PROPERTY |
|
52 * structure. |
|
53 * @param aSupportedFieldTypeList List of supported field types. |
|
54 * @param aFieldOrderingManager Field ordering manager. |
|
55 * @return A new instance of this class. |
|
56 */ |
|
57 static CPbk2FieldProperty* NewLC( |
|
58 TResourceReader& aReader, |
|
59 const MVPbkFieldTypeList& aSupportedFieldTypeList, |
|
60 CPbk2FieldOrderingManager& aFieldOrderingManager ); |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 */ |
|
65 ~CPbk2FieldProperty(); |
|
66 |
|
67 public: // Interface |
|
68 |
|
69 /** |
|
70 * @return ETrue if the property was mapped to the field type |
|
71 */ |
|
72 TBool IsSupported() const; |
|
73 |
|
74 public: // From MPbk2FieldProperty |
|
75 TBool IsSame( |
|
76 const MPbk2FieldProperty& aOther ) const; |
|
77 const MVPbkFieldType& FieldType() const; |
|
78 TPbk2FieldMultiplicity Multiplicity() const; |
|
79 TInt MaxLength() const; |
|
80 TPbk2FieldEditMode EditMode() const; |
|
81 TPbk2FieldDefaultCase DefaultCase() const; |
|
82 const TPbk2IconId& IconId() const; |
|
83 TPbk2FieldCtrlType CtrlType() const; |
|
84 TUint Flags() const; |
|
85 TInt OrderingItem() const; |
|
86 TInt AddItemOrdering() const; |
|
87 const TDesC& AddItemText() const; |
|
88 TPbk2FieldLocation Location() const; |
|
89 TPbk2FieldGroupId GroupId() const; |
|
90 const TDesC& DefaultLabel() const; |
|
91 TAny* FieldPropertyExtension( TUid aExtensionUid ); |
|
92 |
|
93 public: // From MPbk2FieldProperty2 |
|
94 const TDesC& XSpName() const; |
|
95 |
|
96 private: // Implementation |
|
97 CPbk2FieldProperty(); |
|
98 void ConstructL( |
|
99 TResourceReader& aReader, |
|
100 const MVPbkFieldTypeList& aSupportedFieldTypeList, |
|
101 CPbk2FieldOrderingManager& aFieldOrderingManager ); |
|
102 |
|
103 private: // Data |
|
104 /// Ref: Field type |
|
105 const MVPbkFieldType* iFieldType; |
|
106 /// Own: Assorted flags for the field type |
|
107 TUint iFlags; // LONG flags |
|
108 /// Own: Entry add item label text |
|
109 HBufC* iAddItemText; // LTEXT addItemText |
|
110 /// Own: Default label for the field |
|
111 HBufC* iDefaultLabel; // LTEXT defaultLabel |
|
112 /// Own: Maximum length in characters |
|
113 TInt16 iMaxLength; // WORD maxLength |
|
114 /// Own: Allowed multiplicity (one/many) |
|
115 TInt8 iMultiplicity; // BYTE multiplicity |
|
116 /// Own: Default editing mode |
|
117 TInt8 iEditMode; // BYTE editMode |
|
118 /// Own: Default character case |
|
119 TInt8 iDefaultCase; // BYTE defaultCase |
|
120 /// Own: Index of an icon |
|
121 TPbk2IconId iIconId; // STRUCT iconId |
|
122 /// Own: Editor UI control type |
|
123 TInt8 iCtrlType; // BYTE ctrlType |
|
124 /// Own: Entry item group item ordering |
|
125 TInt8 iOrderingItem; // BYTE orderingItem |
|
126 /// Own: Entry add item ordering |
|
127 TInt8 iAddItemOrdering; // BYTE addItemOrdering |
|
128 /// Own; The group id of this field |
|
129 TInt8 iGroupId; // BYTE groupId |
|
130 /// Own: Entry item location (none/home/work) |
|
131 TInt8 iLocation; // BYTE location |
|
132 /// Own: external service provider name |
|
133 HBufC* iXSpName; |
|
134 }; |
|
135 |
|
136 #endif // CPBK2FIELDPROPERTY_H |
|
137 |
|
138 // End of File |