|
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: Specialization of CFsRichTextObject for text storing |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_FSRICHTEXTTEXT_H |
|
20 #define C_FSRICHTEXTTEXT_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <gdi.h> |
|
24 |
|
25 #include "fsrichtextobject.h" |
|
26 #include <biditext.h> |
|
27 |
|
28 class CFsRichTextText : public CBase, public MFsRichTextObject |
|
29 { |
|
30 public: |
|
31 /** |
|
32 * NewL(); |
|
33 * |
|
34 * |
|
35 */ |
|
36 static CFsRichTextText* NewL(); |
|
37 |
|
38 /** |
|
39 * NewL( |
|
40 * const TDesC& aText ); |
|
41 * |
|
42 * @param aText |
|
43 */ |
|
44 static CFsRichTextText* NewL( |
|
45 const TDesC& aText ); |
|
46 |
|
47 /** |
|
48 * NewL( |
|
49 * const TDesC& aText, |
|
50 * const TInt aTextStyleId ); |
|
51 * |
|
52 * @param aText |
|
53 * @param aTextStyleId |
|
54 */ |
|
55 static CFsRichTextText* NewL( |
|
56 const TDesC& aText, |
|
57 const TInt aTextStyleId ); |
|
58 |
|
59 /** |
|
60 * ~CFsRichTextText(); |
|
61 * |
|
62 * |
|
63 */ |
|
64 ~CFsRichTextText(); |
|
65 |
|
66 public: |
|
67 /** |
|
68 * GetText() const; |
|
69 * |
|
70 * |
|
71 */ |
|
72 TDesC& GetText() const; |
|
73 |
|
74 /** |
|
75 * SetTextL( const TDesC& aText ); |
|
76 * |
|
77 * @param aText |
|
78 */ |
|
79 void SetTextL( const TDesC& aText ); |
|
80 |
|
81 /** |
|
82 * GetStyleId() const; |
|
83 * |
|
84 * |
|
85 */ |
|
86 TInt GetStyleId() const; |
|
87 |
|
88 /** |
|
89 * SetStyleId( const TInt aTextStyleId ); |
|
90 * |
|
91 * @param aTextStyleId |
|
92 */ |
|
93 void SetStyleId( const TInt aTextStyleId ); |
|
94 |
|
95 /** |
|
96 * SetTextColor(TRgb aColor); |
|
97 * |
|
98 * @param aColor |
|
99 */ |
|
100 void SetTextColor(TRgb aColor); |
|
101 |
|
102 /** |
|
103 * GetTextColor() const; |
|
104 * |
|
105 * |
|
106 */ |
|
107 TRgb GetTextColor() const; |
|
108 |
|
109 /** |
|
110 * SetTextDirection(TInt aTypeOfHotSpot); |
|
111 * |
|
112 * @param aTypeOfHotSpot |
|
113 */ |
|
114 void SetTextDirection(TBidiText::TDirectionality aTextDirection); |
|
115 |
|
116 /** |
|
117 * GetTextDirection() const; |
|
118 * |
|
119 * |
|
120 */ |
|
121 TBidiText::TDirectionality GetTextDirection() const; |
|
122 private: |
|
123 /** |
|
124 * ConstructL(); |
|
125 * |
|
126 * |
|
127 */ |
|
128 void ConstructL(); |
|
129 |
|
130 /** |
|
131 * ConstructL( const TDesC& aText ); |
|
132 * |
|
133 * @param aText |
|
134 */ |
|
135 void ConstructL( const TDesC& aText ); |
|
136 |
|
137 /** |
|
138 * CFsRichTextText(); |
|
139 * |
|
140 * |
|
141 */ |
|
142 CFsRichTextText(); |
|
143 |
|
144 /** |
|
145 * CFsRichTextText( const TInt aTextStyle ); |
|
146 * |
|
147 * @param aTextStyle |
|
148 */ |
|
149 CFsRichTextText( const TInt aTextStyle ); |
|
150 |
|
151 private: |
|
152 HBufC* iText; |
|
153 |
|
154 TInt iStyle; |
|
155 |
|
156 TRgb iColor; |
|
157 |
|
158 TBidiText::TDirectionality iTextDirection; |
|
159 }; |
|
160 |
|
161 #endif // C_FSRICHTEXTTEXT_H |
|
162 |