|
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: Tree item data derived class able to store plain text. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_FSTREEPLAINONELINEITEMDATA_H |
|
20 #define C_FSTREEPLAINONELINEITEMDATA_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 #include "fstreeitemdata.h" |
|
28 |
|
29 const TFsTreeItemDataType KFsTreePlainOneLineItemDataType = 1; |
|
30 |
|
31 class CAlfTexture; |
|
32 |
|
33 NONSHARABLE_CLASS( CFsTreePlainOneLineItemData ): public CBase, |
|
34 public MFsTreeItemData |
|
35 { |
|
36 public: |
|
37 |
|
38 /** |
|
39 * Two-phased constructor |
|
40 * |
|
41 * @param aText Reference to the descriptor that the data will be copied |
|
42 * from. |
|
43 */ |
|
44 IMPORT_C static CFsTreePlainOneLineItemData* NewL( ); |
|
45 |
|
46 /** |
|
47 * C++ destructor |
|
48 */ |
|
49 virtual ~CFsTreePlainOneLineItemData(); |
|
50 |
|
51 public: |
|
52 |
|
53 /** |
|
54 * Returns item's data. |
|
55 */ |
|
56 virtual TDesC& Data( ) const; |
|
57 |
|
58 /** |
|
59 * Copies data from the descriptor given as a parameter. |
|
60 * |
|
61 * @param aData Reference to the descriptor that the data will be copied |
|
62 * from. |
|
63 */ |
|
64 virtual void SetDataL( const TDesC& aData ); |
|
65 |
|
66 /** |
|
67 * Returns length (not size) of the data descriptor. |
|
68 * |
|
69 * @return The length of the descriptor holding data. |
|
70 */ |
|
71 virtual TUint DataLength() const; |
|
72 |
|
73 /** |
|
74 * |
|
75 */ |
|
76 virtual TBool IsIconSet() const; |
|
77 |
|
78 /** |
|
79 * |
|
80 */ |
|
81 virtual const CAlfTexture& Icon () const; |
|
82 |
|
83 /** |
|
84 * |
|
85 */ |
|
86 virtual void SetIcon ( CAlfTexture& aIcon ); |
|
87 |
|
88 /** |
|
89 * Returns type id of the separator's data class. |
|
90 */ |
|
91 virtual TFsTreeItemDataType Type() const; |
|
92 |
|
93 protected: |
|
94 |
|
95 /** |
|
96 * C++ constructor |
|
97 */ |
|
98 CFsTreePlainOneLineItemData( ); |
|
99 |
|
100 /** |
|
101 * Second phase constructor |
|
102 * |
|
103 * @param aText Reference to the descriptor that the data will be copied |
|
104 * from. |
|
105 */ |
|
106 void ConstructL( ); |
|
107 |
|
108 protected: //Data |
|
109 |
|
110 /** |
|
111 * Descriptor holding data. |
|
112 * Own. |
|
113 */ |
|
114 HBufC* iData; |
|
115 |
|
116 /** |
|
117 * |
|
118 */ |
|
119 CAlfTexture* iIcon; |
|
120 |
|
121 }; |
|
122 |
|
123 |
|
124 #endif // C_FSTREEPLAINONELINEITEMDATA_H |