|
1 /* |
|
2 * Copyright (c) 1997-2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __TXTMFMTX_H__ |
|
20 #define __TXTMFMTX_H__ |
|
21 |
|
22 #include <e32std.h> |
|
23 #include <txtfrmat.h> |
|
24 |
|
25 // Defines interface for getting/setting formatting attributes. |
|
26 |
|
27 |
|
28 |
|
29 class MFormatText |
|
30 /** |
|
31 Specifies the mixin protocol for getting and setting character and paragraph |
|
32 format attributes. |
|
33 |
|
34 It is inherited by classes which support character and paragraph formatting, |
|
35 e.g. CRichText and CGlobalText. Its purpose is to allow developers to apply |
|
36 and retrieve formatting without needing to know which type of editable text |
|
37 is involved. |
|
38 |
|
39 All functions defined in this class use a document position and a length. |
|
40 These values are only relevant to rich text. In general, they must be valid |
|
41 (i.e. the range must not extend beyond the bounds of the document), or a panic |
|
42 occurs. In global text, formatting is applied globally, so that the length |
|
43 and position values are ignored. |
|
44 @publishedAll |
|
45 @released |
|
46 */ |
|
47 { |
|
48 public: |
|
49 // |
|
50 // Paragraph format attributes |
|
51 |
|
52 |
|
53 /** Gets the effective paragraph formatting which applies to a range of paragraphs. |
|
54 Also gets a bit mask which indicates which values change over the region, |
|
55 and whose value is therefore indeterminate. |
|
56 |
|
57 @param aFormat On return, contains the effective paragraph formatting for |
|
58 the range of paragraphs. For global text, this is the paragraph formatting |
|
59 of the entire text object. |
|
60 @param aVaries On return, a bitmask indicating which paragraph format attributes |
|
61 vary over the range of characters selected. For global text, this mask contains |
|
62 a value of zero for every attribute because formatting is applied globally. |
|
63 @param aPos The document position of the start of the range. |
|
64 @param aLength The number of characters in the range. |
|
65 @param aMode The default, EAllAttributes means that values for all paragraph |
|
66 format attributes are written to aFormat. EFixedAttributes means that tabs, |
|
67 bullets and borders are not written to aFormat. */ |
|
68 virtual void GetParaFormatL(CParaFormat* aFormat,TParaFormatMask& aVaries,TInt aPos,TInt aLength, |
|
69 CParaFormat::TParaFormatGetMode aMode=CParaFormat::EAllAttributes)const=0; |
|
70 |
|
71 |
|
72 /** Applies paragraph formatting to a range of paragraphs. The attributes which |
|
73 are set in the mask are taken from aFormat and applied. The attributes which |
|
74 are not set in the mask are not applied. |
|
75 |
|
76 @param aFormat Contains the paragraph format attribute values to apply. |
|
77 @param aMask Specifies which paragraph format attributes should be applied. |
|
78 @param aPos The document position of the start of the range. |
|
79 @param aLength The number of characters in the range. */ |
|
80 virtual void ApplyParaFormatL(const CParaFormat* aFormat,const TParaFormatMask& aMask,TInt aPos,TInt aLength)=0; |
|
81 // |
|
82 // Character format attributes |
|
83 |
|
84 |
|
85 /** Gets the effective character formatting which applies to a range of characters. |
|
86 Also gets a bit mask which indicates which values change over the region, |
|
87 and whose value is therefore indeterminate. |
|
88 |
|
89 @param aFormat On return, contains the character format values for the range |
|
90 of characters. For global text, this is the character formatting of the entire |
|
91 text object. |
|
92 @param aVaries On return, indicates which character format attributes vary |
|
93 over the range and whose values are therefore indeterminate. For global text, |
|
94 this mask contains a value of zero for every attribute because formatting |
|
95 is applied globally. |
|
96 @param aPos The document position of the start of the range. |
|
97 @param aLength The number of characters in the range. */ |
|
98 virtual void GetCharFormat(TCharFormat& aFormat,TCharFormatMask& aVaries,TInt aPos,TInt aLength)const=0; |
|
99 |
|
100 |
|
101 /** Applies character formatting to a range of characters. The attributes which |
|
102 are set in the mask are taken from aFormat and applied. The attributes which |
|
103 are not set in the mask are not applied. |
|
104 |
|
105 @param aFormat Contains the character format attribute values to apply. |
|
106 @param aMask Bitmask specifying which character format attributes should be |
|
107 applied. |
|
108 @param aPos Document position from which to apply the new character formatting. |
|
109 |
|
110 @param aLength The number of characters to which the new formatting should |
|
111 be applied. */ |
|
112 virtual void ApplyCharFormatL(const TCharFormat& aFormat,const TCharFormatMask& aMask,TInt aPos,TInt aLength)=0; |
|
113 }; |
|
114 |
|
115 #endif |
|
116 |