epoc32/include/fepitfr.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
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
// the class for inline-text format retrieval - in its own header file to prevent low-level 
williamr@2
    15
// components dependent on this class from gaining unnecessary (and undesirable) dependencies 
williamr@2
    16
// on high-level components
williamr@2
    17
// 
williamr@2
    18
//
williamr@2
    19
williamr@2
    20
#ifndef __FEPITFR_H__
williamr@2
    21
#define __FEPITFR_H__
williamr@2
    22
williamr@2
    23
#include <e32std.h>
williamr@2
    24
williamr@2
    25
class TCharFormat;
williamr@2
    26
williamr@2
    27
williamr@2
    28
/** Specifies the mixin protocol for finding out the formatting to apply to inline 
williamr@2
    29
text. 
williamr@2
    30
williamr@2
    31
This class should be overridden by front end processors which support inline editing.
williamr@2
    32
williamr@2
    33
An instance of a class which implements this protocol should be passed to 
williamr@2
    34
MCoeFepAwareTextEditor::StartFepInlineEditL(). 
williamr@2
    35
williamr@2
    36
@publishedAll 
williamr@2
    37
@released */
williamr@2
    38
class MFepInlineTextFormatRetriever // to be overridden by inline-editing front-end processors
williamr@2
    39
	{
williamr@2
    40
public:
williamr@2
    41
	/** Gets the character formatting to apply to the inline text. 
williamr@2
    42
	
williamr@2
    43
	This function may be used to differentiate the formatting of the inline text 
williamr@2
    44
	from the surrounding text. The first parameter should be set to contain the 
williamr@2
    45
	character formatting values to use.
williamr@2
    46
	
williamr@2
    47
	MCoeFepAwareTextEditor provides a member function for finding out the character 
williamr@2
    48
	formatting of the surrounding text - GetFormatForFep(). This can be called 
williamr@2
    49
	inside the implementation of this function to make any necessary adjustments 
williamr@2
    50
	to the format of the inline text to ensure that it is different from the surrounding 
williamr@2
    51
	text.
williamr@2
    52
	
williamr@2
    53
	The second and third parameters enable different parts of the inline text 
williamr@2
    54
	to have different formatting. 
williamr@2
    55
	
williamr@2
    56
	All implementations of this function need to set the aNumberOfCharactersWithSameFormat 
williamr@2
    57
	parameter. If all of the inline text uses the same formatting then aNumberOfCharactersWithSameFormat 
williamr@2
    58
	should be set to the length of the inline text and the aPositionOfCharacter 
williamr@2
    59
	parameter can be ignored.
williamr@2
    60
	
williamr@2
    61
	When the inline text does not all use the same formatting, the second parameter 
williamr@2
    62
	should be set to the number of characters starting at aPositionOfCharacter 
williamr@2
    63
	which have the same formatting: see the following example.
williamr@2
    64
	
williamr@2
    65
	Example
williamr@2
    66
	
williamr@2
    67
	If the inline text is 7 characters long, the first 4 characters are in format 
williamr@2
    68
	A, the next 2 characters are in format B, and the remaining character is in 
williamr@2
    69
	format C.
williamr@2
    70
	
williamr@2
    71
	When the FEP framework (which knows that the inline text is 7 characters long) 
williamr@2
    72
	needs to find out the format of the inline text, it calls GetFormatOfFepInlineText() 
williamr@2
    73
	passing zero into aPositionOfCharacter (to signify the start of the inline 
williamr@2
    74
	text). 
williamr@2
    75
	
williamr@2
    76
	As the first 4 characters are all in format A, the function should set aFormat 
williamr@2
    77
	to A and it should set aNumberOfCharactersWithSameFormat to 4. As the FEP 
williamr@2
    78
	framework has only been told the format of the first 4 characters, it calls 
williamr@2
    79
	GetFormatOfFepInlineText() again passing 4 into aPositionOfCharacter. As the 
williamr@2
    80
	2 characters starting at position 4 are all in format B, the function should 
williamr@2
    81
	set aFormat to B and it should set aNumberOfCharactersWithSameFormat to 2. 
williamr@2
    82
	The FEP framework still does not know the format of the 7th character so it 
williamr@2
    83
	calls GetFormatOfFepInlineText() a third time passing 6 into aPositionOfCharacter. 
williamr@2
    84
	As the character at position 6 is in format C, the function should set aFormat 
williamr@2
    85
	to C and it should set aNumberOfCharactersWithSameFormat to 1. The FEP framework 
williamr@2
    86
	now knows the format of all of the inline text.
williamr@2
    87
	
williamr@2
    88
	@param aFormat On return, contains the formatting to apply to the inline text 
williamr@2
    89
	(or to a portion of it).
williamr@2
    90
	@param aNumberOfCharactersWithSameFormat On return, contains the number of 
williamr@2
    91
	characters in the inline text (starting at aPositionOfCharacter) which have 
williamr@2
    92
	the same formatting.
williamr@2
    93
	@param aPositionOfCharacter Start position within the inline text. */
williamr@2
    94
	virtual void GetFormatOfFepInlineText(TCharFormat& aFormat, TInt& aNumberOfCharactersWithSameFormat, TInt aPositionOfCharacter) const=0;
williamr@2
    95
private: // reserved. do not override!
williamr@2
    96
	IMPORT_C virtual void MFepInlineTextFormatRetriever_Reserved_1();
williamr@2
    97
	IMPORT_C virtual void MFepInlineTextFormatRetriever_Reserved_2();
williamr@2
    98
	};
williamr@2
    99
williamr@2
   100
#endif	// __FEPITFR_H__