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: a single field with property |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CVIMPSTFIELDPROPERTY_H |
|
20 #define CVIMPSTFIELDPROPERTY_H |
|
21 |
|
22 // INCLUDE FILES |
|
23 #include <e32base.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class TResourceReader; |
|
27 class MVPbkFieldTypeList; |
|
28 class CVIMPSTFieldPropertyArray; |
|
29 class MVPbkStoreContactField; |
|
30 class MVPbkFieldType; |
|
31 class MVPbkBaseContactField; |
|
32 |
|
33 //class MVPbkContactFieldData; |
|
34 /** |
|
35 * details view field property. |
|
36 * Field property for a im details field type. |
|
37 * Field property contains data for contact field presentation |
|
38 * in the UI. |
|
39 * @since s60 v5.0 |
|
40 */ |
|
41 class CVIMPSTFieldProperty : public CBase |
|
42 { |
|
43 friend class CVIMPSTFieldPropertyArray; |
|
44 |
|
45 public: // Construction and destruction |
|
46 |
|
47 /** |
|
48 * Creates a new instance of this class. |
|
49 * |
|
50 * @param aFieldId field id |
|
51 * @param aIconId icon id |
|
52 * @param aMaxLength max lable length |
|
53 * @param aDefaultLabel default label |
|
54 * @return A new instance of this class. |
|
55 * @since s60 v5.0 |
|
56 */ |
|
57 static CVIMPSTFieldProperty* NewLC(TInt aFieldId, TInt aIconId, TInt aMaxLength, const TDesC& aDefaultLabel ); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 * @since s60 v5.0 |
|
62 */ |
|
63 ~CVIMPSTFieldProperty(); |
|
64 |
|
65 public: // Interface |
|
66 |
|
67 |
|
68 /** |
|
69 * set the MVPbkStoreContactField |
|
70 * @param aField, to set |
|
71 * @since s60 v5.0 |
|
72 */ |
|
73 void SetStoredFieldL(MVPbkStoreContactField& aField ) ; |
|
74 |
|
75 public: // From MPbk2FieldProperty |
|
76 |
|
77 |
|
78 /** |
|
79 * @return icon id |
|
80 * @since s60 v5.0 |
|
81 */ |
|
82 TInt IconId() ; |
|
83 |
|
84 /** |
|
85 * @return default label if exist other wise field label |
|
86 * @since s60 v5.0 |
|
87 */ |
|
88 const TDesC& DefaultLabelL() ; |
|
89 |
|
90 /** |
|
91 * @return field id |
|
92 * @since s60 v5.0 |
|
93 */ |
|
94 TInt FieldId() ; |
|
95 |
|
96 /** |
|
97 * @return field data |
|
98 * @since s60 v5.0 |
|
99 */ |
|
100 const TDesC& FieldDataL(); |
|
101 |
|
102 /** |
|
103 * Set the field data |
|
104 * @param aText, to set |
|
105 * @since s60 v5.0 |
|
106 */ |
|
107 void SetFieldTextL(const TDesC& aText ); |
|
108 |
|
109 private: // Implementation |
|
110 /** |
|
111 * default constructor |
|
112 * @param aFieldId field id |
|
113 * @param aIconId icon id |
|
114 * @param aMaxLength max lable length |
|
115 * @param aDefaultLabel default label |
|
116 * @since s60 v5.0 |
|
117 */ |
|
118 CVIMPSTFieldProperty(TInt aFieldId, TInt aIconId, TInt aMaxLength ); |
|
119 |
|
120 /** |
|
121 * provide two phase contructions |
|
122 * @param aReader Resource reader pointed to a |
|
123 * VIMPST_FIELD_PROPERTY |
|
124 * structure. |
|
125 * @param aSupportedFieldTypeList List of supported field types. |
|
126 * @since s60 v5.0 |
|
127 */ |
|
128 void ConstructL(const TDesC& aDefaultLabel); |
|
129 |
|
130 private: // Data |
|
131 // owns : field id |
|
132 TInt iFieldId; |
|
133 /// Own: Index of an icon |
|
134 TInt iIconId; // STRUCT iconId |
|
135 // owns : max lable length |
|
136 TInt iMaxLength; |
|
137 // Own: Default label for the field |
|
138 HBufC* iDefaultLabel; // LTEXT defaultLabel |
|
139 // owns : virtual pbk field |
|
140 MVPbkStoreContactField* iField; |
|
141 /// Own: field data |
|
142 HBufC* iFieldData; |
|
143 |
|
144 }; |
|
145 |
|
146 #endif // CVIMPSTFIELDPROPERTY_H |
|
147 |
|
148 // End of File |
|