williamr@2
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
4 |
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
#ifndef __TXTRICH_H__
|
williamr@2
|
17 |
#define __TXTRICH_H__
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#include <e32std.h>
|
williamr@2
|
20 |
#include <e32base.h>
|
williamr@2
|
21 |
#include <txtglobl.h>
|
williamr@2
|
22 |
#include <txtstyle.h>
|
williamr@2
|
23 |
#include <mparser.h>
|
williamr@2
|
24 |
#include <medobsrv.h>
|
williamr@2
|
25 |
|
williamr@2
|
26 |
|
williamr@2
|
27 |
// forward references
|
williamr@2
|
28 |
class CRichTextIndex;
|
williamr@2
|
29 |
class CStreamStore;
|
williamr@2
|
30 |
class CStoreMap;
|
williamr@2
|
31 |
class MPictureFactory;
|
williamr@2
|
32 |
class MRichTextStoreResolver;
|
williamr@2
|
33 |
class TCharFormatX;
|
williamr@2
|
34 |
class TCharFormatXMask;
|
williamr@2
|
35 |
class CParserData;
|
williamr@2
|
36 |
|
williamr@2
|
37 |
|
williamr@2
|
38 |
/**
|
williamr@2
|
39 |
UIDs
|
williamr@2
|
40 |
@internalComponent
|
williamr@2
|
41 |
*/
|
williamr@2
|
42 |
const TUid KRichTextStyleDataUid = { 268450335 };
|
williamr@2
|
43 |
const TUid KClipboardUidTypeRichText = { 268450336 };
|
williamr@2
|
44 |
const TUid KClipboardUidTypeRichTextWithStyles = { 268450337 };
|
williamr@2
|
45 |
const TUid KRichTextMarkupDataUid = { 268435558 };
|
williamr@2
|
46 |
|
williamr@2
|
47 |
|
williamr@2
|
48 |
class CRichText : public CGlobalText
|
williamr@2
|
49 |
/**
|
williamr@2
|
50 |
Text with rich formatting.
|
williamr@2
|
51 |
|
williamr@2
|
52 |
In rich text, each paragraph can have a different paragraph format, and each
|
williamr@2
|
53 |
character can have a different character format.
|
williamr@2
|
54 |
|
williamr@2
|
55 |
All formatting in a rich text object is based on a global character and
|
williamr@2
|
56 |
paragraph format layer, and a chain of layers on which they may be based. In
|
williamr@2
|
57 |
case of conflict, upper layers override lower layers. These two format layers
|
williamr@2
|
58 |
are specified on construction, and are not owned by the text object. Additional
|
williamr@2
|
59 |
formatting may then be added to any portion of the text. This is called specific
|
williamr@2
|
60 |
formatting and in case of conflict, it overrides the formatting in the global
|
williamr@2
|
61 |
layers. Specific formatting is owned by the text object. So, the effective
|
williamr@2
|
62 |
formatting of a rich text object may be composed of specific formatting and
|
williamr@2
|
63 |
formatting specified in a chain of format layers.
|
williamr@2
|
64 |
|
williamr@2
|
65 |
Rich text supports styles. A style is a named set of paragraph and character
|
williamr@2
|
66 |
format attributes. Styles are stored in a list which is passed to the rich
|
williamr@2
|
67 |
text object on construction, or which is assigned to the object after
|
williamr@2
|
68 |
construction. Styles can be appended to and removed from the list and existing
|
williamr@2
|
69 |
styles can be modified. Only paragraph styles are supported. This means that
|
williamr@2
|
70 |
styles are applied to entire paragraphs, although both character and paragraph
|
williamr@2
|
71 |
format attributes may be set in the style.
|
williamr@2
|
72 |
|
williamr@2
|
73 |
Rich text also supports object embedding. Embedded objects are represented
|
williamr@2
|
74 |
in rich text by CPicture-derived objects. A rich text object which supports
|
williamr@2
|
75 |
the display of pictures needs to be supplied with a picture factory.
|
williamr@2
|
76 |
|
williamr@2
|
77 |
@see CParagraphStyle
|
williamr@2
|
78 |
@publishedAll
|
williamr@2
|
79 |
@released
|
williamr@2
|
80 |
*/
|
williamr@2
|
81 |
{
|
williamr@2
|
82 |
public:
|
williamr@2
|
83 |
|
williamr@2
|
84 |
/** Number of paragraphs in the object. */
|
williamr@2
|
85 |
enum TParaType
|
williamr@2
|
86 |
{
|
williamr@2
|
87 |
/** The text object will contain a single paragraph. */
|
williamr@2
|
88 |
ESinglePara,
|
williamr@2
|
89 |
/** The text object will contain multiple paragraphs. */
|
williamr@2
|
90 |
EMultiPara
|
williamr@2
|
91 |
};
|
williamr@2
|
92 |
public:
|
williamr@2
|
93 |
// Create new rich text component whose sole content is an end-of-document character.
|
williamr@2
|
94 |
IMPORT_C static CRichText* NewL(const CParaFormatLayer* aGlobalParaLayer, const CCharFormatLayer* aGlobalCharLayer,
|
williamr@2
|
95 |
TDocumentStorage aStorage = ESegmentedStorage,
|
williamr@2
|
96 |
TInt aDefaultTextGranularity = EDefaultTextGranularity,
|
williamr@2
|
97 |
TParaType aParaType = EMultiPara);
|
williamr@2
|
98 |
// Create new rich text component, supporting STYLES, whose sole content is an end-of-document character.
|
williamr@2
|
99 |
IMPORT_C static CRichText* NewL(const CParaFormatLayer* aGlobalParaLayer, const CCharFormatLayer* aGlobalCharLayer,
|
williamr@2
|
100 |
const CStyleList& aStyleList,
|
williamr@2
|
101 |
TDocumentStorage aStorage = ESegmentedStorage,
|
williamr@2
|
102 |
TInt aDefaultTextGranularity = EDefaultTextGranularity,
|
williamr@2
|
103 |
TParaType aParaType = EMultiPara);
|
williamr@2
|
104 |
// Restore into new rich text, using the specified global layers.
|
williamr@2
|
105 |
IMPORT_C static CRichText* NewL(const CStreamStore& aStore, TStreamId aStreamId,
|
williamr@2
|
106 |
const CParaFormatLayer* aGlobalParaLayer, const CCharFormatLayer* aGlobalCharLayer,
|
williamr@2
|
107 |
MTextFieldFactory* aFieldFactory = NULL,
|
williamr@2
|
108 |
TDocumentStorage aStorage = ESegmentedStorage);
|
williamr@2
|
109 |
// Restore into new rich text, using the specified layers, store & picture factory.
|
williamr@2
|
110 |
IMPORT_C static CRichText* NewL(const CStreamStore& aStore, TStreamId aStreamId,
|
williamr@2
|
111 |
const CParaFormatLayer* aGlobalParaLayer, const CCharFormatLayer * aGlobalCharLayer,
|
williamr@2
|
112 |
MPictureFactory* aPictureFactory, MRichTextStoreResolver* aStoreResolver,
|
williamr@2
|
113 |
MTextFieldFactory* aFieldFactory = NULL,
|
williamr@2
|
114 |
TDocumentStorage aStorage = ESegmentedStorage);
|
williamr@2
|
115 |
IMPORT_C virtual ~CRichText();
|
williamr@2
|
116 |
//
|
williamr@2
|
117 |
// Default persist functions - Deferred loading of pictures
|
williamr@2
|
118 |
IMPORT_C void RestoreWithStyleListL(const CStreamStore& aStore, TStreamId aStreamId, const CStyleList& aExternalStyleList);
|
williamr@2
|
119 |
//
|
williamr@2
|
120 |
IMPORT_C virtual void StoreComponentsL(CStreamStore& aStore, CStoreMap& aMap) const;
|
williamr@2
|
121 |
IMPORT_C virtual void RestoreComponentsL(const CStreamStore& aStore);
|
williamr@2
|
122 |
IMPORT_C virtual void ExternalizeL(RWriteStream& aStream) const;
|
williamr@2
|
123 |
IMPORT_C virtual void InternalizeL(RReadStream& aStream);
|
williamr@2
|
124 |
//
|
williamr@2
|
125 |
// Custom persist functions
|
williamr@2
|
126 |
IMPORT_C void ExternalizeStyleDataL(RWriteStream& aStream) const;
|
williamr@2
|
127 |
IMPORT_C void InternalizeStyleDataL(RReadStream& aStream);
|
williamr@2
|
128 |
//
|
williamr@2
|
129 |
IMPORT_C void StoreMarkupComponentsL(CStreamStore& aStore, CStoreMap& aMap) const;
|
williamr@2
|
130 |
IMPORT_C void ExternalizeMarkupDataL(RWriteStream& aStream) const;
|
williamr@2
|
131 |
IMPORT_C void InternalizeMarkupDataL(RReadStream& aStream);
|
williamr@2
|
132 |
//
|
williamr@2
|
133 |
// Utility persist functions
|
williamr@2
|
134 |
IMPORT_C void SetPictureFactory(MPictureFactory* aPictureFactory, MRichTextStoreResolver* aStoreResolver);
|
williamr@2
|
135 |
inline MPictureFactory* PictureFactory() const;
|
williamr@2
|
136 |
inline MRichTextStoreResolver* StoreResolver() const;
|
williamr@2
|
137 |
IMPORT_C TPictureHeader PictureHeader(TInt aPos) const;
|
williamr@2
|
138 |
IMPORT_C void DropPictureOwnership(TInt aPos); // delete picture character. Forget but don't delete picture.
|
williamr@2
|
139 |
IMPORT_C void DetachFromStoreL(CPicture::TDetach aDegree);
|
williamr@2
|
140 |
IMPORT_C void DetachFromStoreL(CPicture::TDetach aDegree, TInt aPos, TInt aLength);
|
williamr@2
|
141 |
IMPORT_C TBool HasMarkupData() const;
|
williamr@2
|
142 |
//
|
williamr@2
|
143 |
// Copy/Paste
|
williamr@2
|
144 |
IMPORT_C virtual void CopyToStoreL(CStreamStore& aStore, CStreamDictionary& aDictionary, TInt aPos, TInt aLength) const;
|
williamr@2
|
145 |
IMPORT_C virtual TInt PasteFromStoreL(const CStreamStore& aStore, const CStreamDictionary& aDictionary, TInt aPos);
|
williamr@2
|
146 |
IMPORT_C TInt PasteFromStoreL(const CStreamStore& aStore, const CStreamDictionary& aDictionary, TInt aPos, CParagraphStyle::TStylePasteMode aStylePasteMode);
|
williamr@2
|
147 |
//
|
williamr@2
|
148 |
// Content modifier functions
|
williamr@2
|
149 |
IMPORT_C virtual void Reset();
|
williamr@2
|
150 |
IMPORT_C virtual void InsertL(TInt aPos, const TChar& aChar); // Insert a single character.
|
williamr@2
|
151 |
IMPORT_C virtual void InsertL(TInt aPos, const TDesC& aBuf);
|
williamr@2
|
152 |
IMPORT_C void InsertL(TInt aPos, const TPictureHeader& aHeader); // Insert a picture header.
|
williamr@2
|
153 |
//
|
williamr@2
|
154 |
// aPos is the position of the character being deleted, *not* the current cursor position!
|
williamr@2
|
155 |
IMPORT_C virtual TBool DeleteL(TInt aPos, TInt aLength); // Call this for a delete-forward.
|
williamr@2
|
156 |
//
|
williamr@2
|
157 |
// Leave-safe delete for removing content from *within* a single paragraph only
|
williamr@2
|
158 |
IMPORT_C void DeleteFromParagraph(TInt aPos, TInt aLength);
|
williamr@2
|
159 |
//
|
williamr@2
|
160 |
// Leave-safe delete for removing *entire* paragraphs
|
williamr@2
|
161 |
IMPORT_C void DeleteParagraph(TInt aPos, TInt aLength);
|
williamr@2
|
162 |
//
|
williamr@2
|
163 |
// Special behaviour format modifier functions.
|
williamr@2
|
164 |
// Call this when applying a character format to a zero length selection, eg, turning bold on.
|
williamr@2
|
165 |
IMPORT_C void SetInsertCharFormatL(const TCharFormat& aFormat, const TCharFormatMask& aMask, TInt aPos);
|
williamr@2
|
166 |
//
|
williamr@2
|
167 |
// Call this on every cursor movement, page up/down etc...
|
williamr@2
|
168 |
IMPORT_C void CancelInsertCharFormat();
|
williamr@2
|
169 |
//
|
williamr@2
|
170 |
// Delete content, but preserve phrase format if aPos is at a phrase boundary.
|
williamr@2
|
171 |
// aPos is the position of the character being deleted, *not* the current cursor position!
|
williamr@2
|
172 |
IMPORT_C TBool DelSetInsertCharFormatL(TInt aPos, TInt aLength);
|
williamr@2
|
173 |
//
|
williamr@2
|
174 |
// MLaydoc implementation
|
williamr@2
|
175 |
IMPORT_C virtual void GetParagraphFormatL(CParaFormat* aFormat, TInt aPos) const;
|
williamr@2
|
176 |
IMPORT_C virtual void GetChars(TPtrC& aView, TCharFormat& aFormat, TInt aPos) const;
|
williamr@2
|
177 |
IMPORT_C virtual TInt GetPictureSizeInTwips(TSize& aSize, TInt aPos) const;
|
williamr@2
|
178 |
IMPORT_C virtual CPicture* PictureHandleL(TInt aPos, MLayDoc::TForcePictureLoad aForceLoad = MLayDoc::EForceLoadTrue) const;
|
williamr@2
|
179 |
//
|
williamr@2
|
180 |
// MFormatText implementation
|
williamr@2
|
181 |
// Used only by dialog writers, since they are not interested in the text, but require knowledge
|
williamr@2
|
182 |
// of attributes whose values change across the specified range.
|
williamr@2
|
183 |
IMPORT_C virtual void GetParaFormatL(CParaFormat* aFormat, TParaFormatMask& aVaries, TInt aPos, TInt aLength,
|
williamr@2
|
184 |
CParaFormat::TParaFormatGetMode aMode = CParaFormat::EAllAttributes) const;
|
williamr@2
|
185 |
IMPORT_C virtual void ApplyParaFormatL(const CParaFormat* aFormat, const TParaFormatMask& aMask, TInt aPos, TInt aLength);
|
williamr@2
|
186 |
IMPORT_C virtual void GetCharFormat(TCharFormat& aFormat, TCharFormatMask& aVaries, TInt aPos, TInt aLength) const;
|
williamr@2
|
187 |
IMPORT_C virtual void ApplyCharFormatL(const TCharFormat& aFormat, const TCharFormatMask& aMask, TInt aPos, TInt aLength);
|
williamr@2
|
188 |
//
|
williamr@2
|
189 |
//
|
williamr@2
|
190 |
IMPORT_C void GetSpecificCharFormat(TCharFormat& aFormat, TCharFormatMask& aMask, TInt aPos) const;
|
williamr@2
|
191 |
IMPORT_C void GetSpecificCharFormatRight(TCharFormat& aFormat, TCharFormatMask& aMask, TInt aPos) const;
|
williamr@2
|
192 |
IMPORT_C void GetSpecificParagraphFormatL(CParaFormat* aFormat, TParaFormatMask& aMask, TInt aPos) const;
|
williamr@2
|
193 |
//
|
williamr@2
|
194 |
// Paragraph style implementation
|
williamr@2
|
195 |
IMPORT_C void ApplyParagraphStyleL(const CParagraphStyle& aStyle, TInt aPos, TInt aLength, CParagraphStyle::TApplyParaStyleMode aMode);
|
williamr@2
|
196 |
inline void NotifyStyleDeletedL(const CParagraphStyle* aStyle);
|
williamr@2
|
197 |
IMPORT_C void NotifyStyleChangedL(const CParagraphStyle* aTo, const CParagraphStyle* aFrom);
|
williamr@2
|
198 |
IMPORT_C const CParaFormatLayer* ParagraphStyle(TBool& aStyleChangesOverRange, TInt aPos, TInt aLength) const;
|
williamr@2
|
199 |
//
|
williamr@2
|
200 |
// StyleList implementation
|
williamr@2
|
201 |
inline TBool StyleListPresent() const;
|
williamr@2
|
202 |
inline CStyleList* StyleList() const;
|
williamr@2
|
203 |
inline TInt StyleCount() const;
|
williamr@2
|
204 |
|
williamr@2
|
205 |
inline void SetStyleListExternallyOwned(TBool aExternallyOwned);
|
williamr@2
|
206 |
IMPORT_C void SetStyleListExternallyOwned(const CStyleList& aStyleList);
|
williamr@2
|
207 |
inline TBool StyleListExternallyOwned() const;
|
williamr@2
|
208 |
//
|
williamr@2
|
209 |
// Utility functions
|
williamr@2
|
210 |
IMPORT_C void RemoveSpecificParaFormatL(TInt aPos, TInt aLength);
|
williamr@2
|
211 |
IMPORT_C void RemoveSpecificCharFormatL(TInt aPos, TInt aLength);
|
williamr@2
|
212 |
IMPORT_C TInt PictureCount() const;
|
williamr@2
|
213 |
IMPORT_C virtual TInt ParagraphCount() const;
|
williamr@2
|
214 |
IMPORT_C virtual TInt CharPosOfParagraph(TInt& aLength, TInt aParaOffset) const;
|
williamr@2
|
215 |
IMPORT_C virtual TInt ParagraphNumberForPos(TInt& aPos) const;
|
williamr@2
|
216 |
IMPORT_C virtual TEtextComponentInfo ComponentInfo() const;
|
williamr@2
|
217 |
//
|
williamr@2
|
218 |
// Text field implementation
|
williamr@2
|
219 |
IMPORT_C virtual void UpdateFieldL(TInt aPos); // updates the field at aPos
|
williamr@2
|
220 |
// finds number of fields in range. Includes the field containing aPos, if applicable
|
williamr@2
|
221 |
// aInfo is set to the first field in the range (if any are found)
|
williamr@2
|
222 |
//
|
williamr@2
|
223 |
// Speciality functions
|
williamr@2
|
224 |
IMPORT_C void AppendTakingSolePictureOwnershipL(const CRichText& aSource);
|
williamr@2
|
225 |
IMPORT_C void AppendParagraphL(TInt aReplicas = 1);
|
williamr@2
|
226 |
IMPORT_C virtual void SetHasChanged(TBool aHasChanged);
|
williamr@2
|
227 |
|
williamr@2
|
228 |
IMPORT_C void ExtendedInterface(TAny*& aInterface, TUid aInterfaceId); // from CEditableText
|
williamr@2
|
229 |
|
williamr@2
|
230 |
// non-exported public functions
|
williamr@2
|
231 |
void ApplyExtendedCharFormatL(const TCharFormatX& aFormat, const TCharFormatXMask& aMask, TInt aPos, TInt aLength);
|
williamr@2
|
232 |
void GetExtendedCharFormat(TCharFormatX& aFormat, TCharFormatXMask& aVaries, TInt aPos, TInt aLength) const;
|
williamr@2
|
233 |
void GetTextAndExtendedFormat(TPtrC& aText, TCharFormatX& aFormat, TInt aPos) const;
|
williamr@2
|
234 |
|
williamr@2
|
235 |
private:
|
williamr@2
|
236 |
CRichText(const CRichText& aRichText);
|
williamr@2
|
237 |
CRichText& operator=(const CRichText& aRichText);
|
williamr@2
|
238 |
void KillStyleList();
|
williamr@2
|
239 |
void KillIndex();
|
williamr@2
|
240 |
TBool CreateEmptyMarkupComponentL();
|
williamr@2
|
241 |
void CreateAndGenerateMarkupComponentL();
|
williamr@2
|
242 |
void GenerateMarkupL();
|
williamr@2
|
243 |
void CompletePastePlainTextL(TInt aPos,TInt aCharacterCount);
|
williamr@2
|
244 |
TInt DoPasteRtFromStoreL(const CStreamStore& aStore, const CStreamDictionary& aDictionary, TInt aPos, CParagraphStyle::TStylePasteMode aStylePasteMode);
|
williamr@2
|
245 |
TBool IndexPresent() const;
|
williamr@2
|
246 |
inline void SetParaTypeIsSingle(TBool aBool);
|
williamr@2
|
247 |
inline TBool ParaTypeIsSingle() const;
|
williamr@2
|
248 |
void SetExtendedInsertCharFormatL(const TCharFormatX& aFormat, const TCharFormatXMask& aMask, TInt aPos);
|
williamr@2
|
249 |
void GetSpecificCharFormatLeftRight(TCharFormat& aFormat,
|
williamr@2
|
250 |
TCharFormatMask& aMask, TInt aPos, TBool aLeft) const;
|
williamr@2
|
251 |
void DoApplyExtendedCharFormatL(const TCharFormatX& aFormat,const TCharFormatXMask& aMask,TInt aPos,TInt aLength);
|
williamr@2
|
252 |
|
williamr@2
|
253 |
protected:
|
williamr@2
|
254 |
IMPORT_C CRichText(const CParaFormatLayer* aGlobalParaLayer, const CCharFormatLayer* aGlobalCharLayer,
|
williamr@2
|
255 |
CStyleList* aStyleList = NULL);
|
williamr@2
|
256 |
// New constructL's - to be merged post 057
|
williamr@2
|
257 |
IMPORT_C void ConstructL(TDocumentStorage aStorage, TInt aDefaultTextGranularity, TParaType aParaType);
|
williamr@2
|
258 |
IMPORT_C void ConstructL(const CStreamStore& aStore, TStreamId aStreamId, MPictureFactory* aFactory, MRichTextStoreResolver* aStoreResolver,
|
williamr@2
|
259 |
MTextFieldFactory* aFieldFactory=NULL,
|
williamr@2
|
260 |
TDocumentStorage aStorage = ESegmentedStorage);
|
williamr@2
|
261 |
//
|
williamr@2
|
262 |
void InternalizeL(RReadStream& aStream, const CStyleList* aExternalStyleList);
|
williamr@2
|
263 |
IMPORT_C void DoExternalizeStyleDataL(RWriteStream& aStream) const;
|
williamr@2
|
264 |
IMPORT_C void DoInternalizeStyleDataL(RReadStream& aStream);
|
williamr@2
|
265 |
void DoInternalizeStyleDataL(RReadStream& aStream, const CStyleList* aExternalStyleList);
|
williamr@2
|
266 |
IMPORT_C void DoExternalizeMarkupDataL(RWriteStream& aStream) const;
|
williamr@2
|
267 |
IMPORT_C void DoInternalizeMarkupDataL(RReadStream& aStream);
|
williamr@2
|
268 |
void StoreStylesL(CStreamStore& aStore,CStoreMap& aMap) const;
|
williamr@2
|
269 |
void RestoreStylesL(const CStreamStore& aStore, TStreamId aId, const CParaFormatLayer* aParaFormatLayer, const CCharFormatLayer* aCharFormatLayer);
|
williamr@2
|
270 |
void StoreMarkupL(CStreamStore& aStore,CStoreMap& aMap)const;
|
williamr@2
|
271 |
//
|
williamr@2
|
272 |
IMPORT_C void RtInsertL(TInt aPos,const TDesC& aBuf);
|
williamr@2
|
273 |
//
|
williamr@2
|
274 |
TStreamId DoCopyToStoreL(CStreamStore& aStore, TInt aPos, TInt aLength, TStreamId aGlobalTextId, TBool aCopyStyles) const;
|
williamr@2
|
275 |
IMPORT_C void CopyComponentsL(CStreamStore& aStore, CStoreMap& aMap, TInt aPos,TInt aLength, TStreamId aGlobalTextId) const;
|
williamr@2
|
276 |
IMPORT_C void CopyToStreamL(RWriteStream& aStream, TInt aPos, TInt aLength, TStreamId aGlobalTextId) const;
|
williamr@2
|
277 |
IMPORT_C void CopyToStreamL(RWriteStream& aStream, TInt aPos, TInt aLength) const;
|
williamr@2
|
278 |
void CopyToStreamL(RWriteStream& aStream, TInt aPos, TInt aLength, TStreamId aGlobalTextId, TBool aCopyStyles) const;
|
williamr@2
|
279 |
TInt PasteRichTextFromStoreL(const CStreamStore& aStore, const CStreamDictionary& aDictionary, TStreamId& anId, TInt aPos, CParagraphStyle::TStylePasteMode aStylePasteMode);
|
williamr@2
|
280 |
void CompletePasteRichTextFromStoreL(const CStreamStore& aStore, TStreamId& aRichTextStreamId, TInt aPos, CParagraphStyle::TStylePasteMode aStylePasteMode);
|
williamr@2
|
281 |
TInt PastePlainTextFromStoreL(const CStreamStore& aStore, TStreamId& anId, TInt aPos);
|
williamr@2
|
282 |
//
|
williamr@2
|
283 |
// Append
|
williamr@2
|
284 |
void PrepareAppendMarkupL(const CRichText& aSource);
|
williamr@2
|
285 |
void DoAppendTakingSolePictureOwnershipL(const CRichText& aSource);
|
williamr@2
|
286 |
public:
|
williamr@2
|
287 |
IMPORT_C static void ActivateParserL(MParser* aParser); // Switch on a particular parser
|
williamr@2
|
288 |
IMPORT_C static void DeactivateParser(MParser* aParser); // Switch off a particular parser
|
williamr@2
|
289 |
IMPORT_C static void ActivateDefaultParserL(MParser* aParser); // Switch on a default parser
|
williamr@2
|
290 |
IMPORT_C static void DeactivateParserDefaults(); // Switch off default set (if any)
|
williamr@2
|
291 |
// and delete EText TLS
|
williamr@2
|
292 |
|
williamr@2
|
293 |
IMPORT_C void SetEditObserver(MEditObserver* aEditObserver);
|
williamr@2
|
294 |
IMPORT_C TBool ParseText(TInt& aStartOfTags, TInt& aLength, TBool aForceScanAllText);
|
williamr@2
|
295 |
IMPORT_C TBool CursorOverTag(TInt aPos, MParser*& aParser, TInt& aTagStart, TInt& aLength) const;
|
williamr@2
|
296 |
// Next tag (forwards), any or specific parser
|
williamr@2
|
297 |
IMPORT_C TInt PositionOfNextTag(TInt aPos) const;
|
williamr@2
|
298 |
IMPORT_C TInt PositionOfNextTag(TInt aPos, const MParser* aParser) const;
|
williamr@2
|
299 |
// Prev tag (backwards), any or specific parser
|
williamr@2
|
300 |
IMPORT_C TInt PositionOfPrevTag(TInt aPos) const;
|
williamr@2
|
301 |
IMPORT_C TInt PositionOfPrevTag(TInt aPos, const MParser* aParser) const;
|
williamr@2
|
302 |
|
williamr@2
|
303 |
private:
|
williamr@2
|
304 |
static void CreateParserETextTLSL();
|
williamr@2
|
305 |
TBool DoCursorOverTag(TInt aPos, MParser*& aParser, TInt& aTagStart, TInt& aLength) const;
|
williamr@2
|
306 |
void OverrideFormatForParsersIfApplicable(TPtrC& aText, TCharFormatX& aFormat, TInt aStartPos) const;
|
williamr@2
|
307 |
void CallEditObserver(TInt aStart, TInt aExtent) const;
|
williamr@2
|
308 |
|
williamr@2
|
309 |
protected:
|
williamr@2
|
310 |
enum {EDelimiterCharacterLength = 1};
|
williamr@2
|
311 |
private:
|
williamr@2
|
312 |
TSwizzle<CStyleList> iStyleList;
|
williamr@2
|
313 |
TSwizzle<CRichTextIndex> iIndex;
|
williamr@2
|
314 |
TUint32 iFlags;
|
williamr@2
|
315 |
MPictureFactory* iPictureFactory;
|
williamr@2
|
316 |
MRichTextStoreResolver* iStoreResolver;
|
williamr@2
|
317 |
|
williamr@2
|
318 |
CParserData* iParserData;
|
williamr@2
|
319 |
|
williamr@2
|
320 |
void* iReserved_3;
|
williamr@2
|
321 |
|
williamr@2
|
322 |
__DECLARE_TEST; // Index consistency check with document length.
|
williamr@2
|
323 |
};
|
williamr@2
|
324 |
|
williamr@2
|
325 |
|
williamr@2
|
326 |
#include <txtrich.inl>
|
williamr@2
|
327 |
|
williamr@2
|
328 |
|
williamr@2
|
329 |
#endif
|