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