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