1.1 --- a/epoc32/include/txtmfmtx.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/txtmfmtx.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,112 @@
1.4 -txtmfmtx.h
1.5 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// 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
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +#ifndef __TXTMFMTX_H__
1.21 +#define __TXTMFMTX_H__
1.22 +
1.23 +#include <e32std.h>
1.24 +#include <txtfrmat.h>
1.25 +
1.26 +// Defines interface for getting/setting formatting attributes.
1.27 +
1.28 +
1.29 +
1.30 +class MFormatText
1.31 +/**
1.32 +Specifies the mixin protocol for getting and setting character and paragraph
1.33 +format attributes.
1.34 +
1.35 +It is inherited by classes which support character and paragraph formatting,
1.36 +e.g. CRichText and CGlobalText. Its purpose is to allow developers to apply
1.37 +and retrieve formatting without needing to know which type of editable text
1.38 +is involved.
1.39 +
1.40 +All functions defined in this class use a document position and a length.
1.41 +These values are only relevant to rich text. In general, they must be valid
1.42 +(i.e. the range must not extend beyond the bounds of the document), or a panic
1.43 +occurs. In global text, formatting is applied globally, so that the length
1.44 +and position values are ignored.
1.45 +@publishedAll
1.46 +@released
1.47 +*/
1.48 + {
1.49 +public:
1.50 + //
1.51 + // Paragraph format attributes
1.52 +
1.53 +
1.54 + /** Gets the effective paragraph formatting which applies to a range of paragraphs.
1.55 + Also gets a bit mask which indicates which values change over the region,
1.56 + and whose value is therefore indeterminate.
1.57 +
1.58 + @param aFormat On return, contains the effective paragraph formatting for
1.59 + the range of paragraphs. For global text, this is the paragraph formatting
1.60 + of the entire text object.
1.61 + @param aVaries On return, a bitmask indicating which paragraph format attributes
1.62 + vary over the range of characters selected. For global text, this mask contains
1.63 + a value of zero for every attribute because formatting is applied globally.
1.64 + @param aPos The document position of the start of the range.
1.65 + @param aLength The number of characters in the range.
1.66 + @param aMode The default, EAllAttributes means that values for all paragraph
1.67 + format attributes are written to aFormat. EFixedAttributes means that tabs,
1.68 + bullets and borders are not written to aFormat. */
1.69 + virtual void GetParaFormatL(CParaFormat* aFormat,TParaFormatMask& aVaries,TInt aPos,TInt aLength,
1.70 + CParaFormat::TParaFormatGetMode aMode=CParaFormat::EAllAttributes)const=0;
1.71 +
1.72 +
1.73 + /** Applies paragraph formatting to a range of paragraphs. The attributes which
1.74 + are set in the mask are taken from aFormat and applied. The attributes which
1.75 + are not set in the mask are not applied.
1.76 +
1.77 + @param aFormat Contains the paragraph format attribute values to apply.
1.78 + @param aMask Specifies which paragraph format attributes should be applied.
1.79 + @param aPos The document position of the start of the range.
1.80 + @param aLength The number of characters in the range. */
1.81 + virtual void ApplyParaFormatL(const CParaFormat* aFormat,const TParaFormatMask& aMask,TInt aPos,TInt aLength)=0;
1.82 + //
1.83 + // Character format attributes
1.84 +
1.85 +
1.86 + /** Gets the effective character formatting which applies to a range of characters.
1.87 + Also gets a bit mask which indicates which values change over the region,
1.88 + and whose value is therefore indeterminate.
1.89 +
1.90 + @param aFormat On return, contains the character format values for the range
1.91 + of characters. For global text, this is the character formatting of the entire
1.92 + text object.
1.93 + @param aVaries On return, indicates which character format attributes vary
1.94 + over the range and whose values are therefore indeterminate. For global text,
1.95 + this mask contains a value of zero for every attribute because formatting
1.96 + is applied globally.
1.97 + @param aPos The document position of the start of the range.
1.98 + @param aLength The number of characters in the range. */
1.99 + virtual void GetCharFormat(TCharFormat& aFormat,TCharFormatMask& aVaries,TInt aPos,TInt aLength)const=0;
1.100 +
1.101 +
1.102 + /** Applies character formatting to a range of characters. The attributes which
1.103 + are set in the mask are taken from aFormat and applied. The attributes which
1.104 + are not set in the mask are not applied.
1.105 +
1.106 + @param aFormat Contains the character format attribute values to apply.
1.107 + @param aMask Bitmask specifying which character format attributes should be
1.108 + applied.
1.109 + @param aPos Document position from which to apply the new character formatting.
1.110 +
1.111 + @param aLength The number of characters to which the new formatting should
1.112 + be applied. */
1.113 + virtual void ApplyCharFormatL(const TCharFormat& aFormat,const TCharFormatMask& aMask,TInt aPos,TInt aLength)=0;
1.114 + };
1.115 +
1.116 +#endif