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