|
1 /* |
|
2 * Copyright (c) 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: A data class for the MultiLine item. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_FSMULTILINEITEMDATA_H |
|
20 #define C_FSMULTILINEITEMDATA_H |
|
21 |
|
22 #include <e32base.h> |
|
23 //<cmail> removed __FS_ALFRED_SUPPORT flag |
|
24 //#include <fsconfig.h> |
|
25 //</cmail> removed __FS_ALFRED_SUPPORT flag |
|
26 |
|
27 |
|
28 #include "fstreeitemdata.h" |
|
29 |
|
30 class CAlfTexture; |
|
31 |
|
32 const TFsTreeItemDataType KFsMultiLineItemDataType = 5; |
|
33 |
|
34 /** |
|
35 * CFsMultiLineItemData is a data class for a Multiline(1-4) item. |
|
36 * |
|
37 * This class is a concrete implementation for the MFsTreeItemData data |
|
38 * interface. |
|
39 * |
|
40 * @code |
|
41 * |
|
42 * @endcode |
|
43 * |
|
44 * @lib |
|
45 */ |
|
46 NONSHARABLE_CLASS( CFsMultiLineItemData ): public CBase, |
|
47 public MFsTreeItemData |
|
48 { |
|
49 public: |
|
50 |
|
51 /** |
|
52 * Two-phased constructor |
|
53 * |
|
54 * @param aText Reference to the descriptor that the data will be copied |
|
55 * from. |
|
56 */ |
|
57 IMPORT_C static CFsMultiLineItemData* NewL( ); |
|
58 |
|
59 /** |
|
60 * C++ destructor |
|
61 */ |
|
62 virtual ~CFsMultiLineItemData(); |
|
63 |
|
64 public: |
|
65 |
|
66 /** |
|
67 * The function sets text to the specified line. |
|
68 * |
|
69 * @param aText Text to be set to a line. |
|
70 * @param aLineNumber Line number (0..3). |
|
71 */ |
|
72 virtual void SetLineTextL( const TDesC& aText, TInt aLineNumber ); |
|
73 |
|
74 /** |
|
75 * The function return a text associated with a specified line. |
|
76 * |
|
77 * @param aLineNumber Line number (0..3). |
|
78 * |
|
79 * @retun Text associated with the given line.First line's text in case |
|
80 * given line number is out of range. |
|
81 */ |
|
82 virtual TDesC& LineText( TInt aLineNumber ) const; |
|
83 |
|
84 /** |
|
85 * The function sets icon to a specified line. |
|
86 * |
|
87 * @param aIcon Pointer to an icon. Not own. |
|
88 * @param aLineNumber Line number (0..3). In case of 0 the icon is a priority |
|
89 * icon. Checkbox icons are set by a seperate function. |
|
90 */ |
|
91 virtual void SetLineIcon ( CAlfTexture* aIcon, TInt aLineNumber ); |
|
92 |
|
93 /** |
|
94 * The function returns an icon associated with a specified line. |
|
95 * |
|
96 * @param aLineNumber Number of a line the icon is associated with. |
|
97 * |
|
98 * @return Icon associated with the given line.First icon in case given |
|
99 * line number is out of range. |
|
100 */ |
|
101 virtual const CAlfTexture* LineIcon ( TInt aLineNumber ) const; |
|
102 |
|
103 /** |
|
104 * The function sets icon for a checkbox. |
|
105 * |
|
106 * @param aCheckedIcon An icon for a checked state. Not own. |
|
107 * @param aUncheckedIcon An icon for an unchecked state. Not own. |
|
108 */ |
|
109 virtual void SetCheckBoxIcons( CAlfTexture* aCheckedIcon, CAlfTexture* aUncheckedIcon ); |
|
110 |
|
111 /** |
|
112 * The function returns an icon for a checked checkbox's state. |
|
113 * |
|
114 * @return An icon for a checked state. |
|
115 */ |
|
116 virtual const CAlfTexture* CheckBoxCheckedIcon() const; |
|
117 |
|
118 |
|
119 /** |
|
120 * The function returns an icon for an unchecked checkbox's state. |
|
121 * |
|
122 * @return An icon for an unchecked state. |
|
123 */ |
|
124 virtual const CAlfTexture* CheckBoxUncheckedIcon() const; |
|
125 |
|
126 public: //from MFsTreeItemData. |
|
127 |
|
128 /** |
|
129 * From MFsTreeItemData. |
|
130 * |
|
131 * Type of the data item. |
|
132 * |
|
133 * @return Item's type identifier. |
|
134 */ |
|
135 virtual TFsTreeItemDataType Type() const; |
|
136 |
|
137 protected: |
|
138 |
|
139 /** |
|
140 * The function copies the text from a given source to destination. |
|
141 */ |
|
142 virtual void SetTextL( HBufC*& aDest, const TDesC& aSrcText ); |
|
143 |
|
144 protected: |
|
145 |
|
146 /** |
|
147 * C++ constructor |
|
148 */ |
|
149 CFsMultiLineItemData( ); |
|
150 |
|
151 /** |
|
152 * Second phase constructor |
|
153 * |
|
154 */ |
|
155 void ConstructL( ); |
|
156 |
|
157 protected: //Data |
|
158 |
|
159 ///////////////////////////first line/////////////////////////// |
|
160 /** |
|
161 * Descriptor holding first line's text. |
|
162 * Own. |
|
163 */ |
|
164 HBufC* iFirstLineText; |
|
165 |
|
166 /** |
|
167 * Pointer holding first line's icon - priority icon. |
|
168 * Not own. |
|
169 */ |
|
170 CAlfTexture* iFirstLineIcon; |
|
171 |
|
172 /** |
|
173 * Pointer holding first line's checked icon. |
|
174 * Not own. |
|
175 */ |
|
176 CAlfTexture* iFirstLineCheckedIcon; |
|
177 |
|
178 /** |
|
179 * Pointer holding first line's unchecked icon. |
|
180 * Not own. |
|
181 */ |
|
182 CAlfTexture* iFirstLineUncheckedIcon; |
|
183 |
|
184 ///////////////////////////second line/////////////////////////// |
|
185 /** |
|
186 * Descriptor holding second line's text. |
|
187 * Own. |
|
188 */ |
|
189 HBufC* iSecondLineText; |
|
190 |
|
191 /** |
|
192 * Pointer holding second line's icon. |
|
193 * Not own. |
|
194 */ |
|
195 CAlfTexture* iSecondLineIcon; |
|
196 |
|
197 ///////////////////////////third line/////////////////////////// |
|
198 /** |
|
199 * Descriptor holding third line's text. |
|
200 * Own. |
|
201 */ |
|
202 HBufC* iThirdLineText; |
|
203 |
|
204 /** |
|
205 * Pointer holding third line's icon. |
|
206 * Not own. |
|
207 */ |
|
208 CAlfTexture* iThirdLineIcon; |
|
209 |
|
210 ///////////////////////////fourth line/////////////////////////// |
|
211 /** |
|
212 * Descriptor holding fourth line's text. |
|
213 * Own. |
|
214 */ |
|
215 HBufC* iFourthLineText; |
|
216 |
|
217 /** |
|
218 * Pointer holding fourth line's icon. |
|
219 * Not own. |
|
220 */ |
|
221 CAlfTexture* iFourthLineIcon; |
|
222 |
|
223 }; |
|
224 |
|
225 #endif //C_FSMULTILINEITEMDATA_H |