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