epoc32/include/fepitfr.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/fepitfr.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/fepitfr.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,100 @@
     1.4 -fepitfr.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 +// the class for inline-text format retrieval - in its own header file to prevent low-level 
    1.19 +// components dependent on this class from gaining unnecessary (and undesirable) dependencies 
    1.20 +// on high-level components
    1.21 +// 
    1.22 +//
    1.23 +
    1.24 +#ifndef __FEPITFR_H__
    1.25 +#define __FEPITFR_H__
    1.26 +
    1.27 +#include <e32std.h>
    1.28 +
    1.29 +class TCharFormat;
    1.30 +
    1.31 +
    1.32 +/** Specifies the mixin protocol for finding out the formatting to apply to inline 
    1.33 +text. 
    1.34 +
    1.35 +This class should be overridden by front end processors which support inline editing.
    1.36 +
    1.37 +An instance of a class which implements this protocol should be passed to 
    1.38 +MCoeFepAwareTextEditor::StartFepInlineEditL(). 
    1.39 +
    1.40 +@publishedAll 
    1.41 +@released */
    1.42 +class MFepInlineTextFormatRetriever // to be overridden by inline-editing front-end processors
    1.43 +	{
    1.44 +public:
    1.45 +	/** Gets the character formatting to apply to the inline text. 
    1.46 +	
    1.47 +	This function may be used to differentiate the formatting of the inline text 
    1.48 +	from the surrounding text. The first parameter should be set to contain the 
    1.49 +	character formatting values to use.
    1.50 +	
    1.51 +	MCoeFepAwareTextEditor provides a member function for finding out the character 
    1.52 +	formatting of the surrounding text - GetFormatForFep(). This can be called 
    1.53 +	inside the implementation of this function to make any necessary adjustments 
    1.54 +	to the format of the inline text to ensure that it is different from the surrounding 
    1.55 +	text.
    1.56 +	
    1.57 +	The second and third parameters enable different parts of the inline text 
    1.58 +	to have different formatting. 
    1.59 +	
    1.60 +	All implementations of this function need to set the aNumberOfCharactersWithSameFormat 
    1.61 +	parameter. If all of the inline text uses the same formatting then aNumberOfCharactersWithSameFormat 
    1.62 +	should be set to the length of the inline text and the aPositionOfCharacter 
    1.63 +	parameter can be ignored.
    1.64 +	
    1.65 +	When the inline text does not all use the same formatting, the second parameter 
    1.66 +	should be set to the number of characters starting at aPositionOfCharacter 
    1.67 +	which have the same formatting: see the following example.
    1.68 +	
    1.69 +	Example
    1.70 +	
    1.71 +	If the inline text is 7 characters long, the first 4 characters are in format 
    1.72 +	A, the next 2 characters are in format B, and the remaining character is in 
    1.73 +	format C.
    1.74 +	
    1.75 +	When the FEP framework (which knows that the inline text is 7 characters long) 
    1.76 +	needs to find out the format of the inline text, it calls GetFormatOfFepInlineText() 
    1.77 +	passing zero into aPositionOfCharacter (to signify the start of the inline 
    1.78 +	text). 
    1.79 +	
    1.80 +	As the first 4 characters are all in format A, the function should set aFormat 
    1.81 +	to A and it should set aNumberOfCharactersWithSameFormat to 4. As the FEP 
    1.82 +	framework has only been told the format of the first 4 characters, it calls 
    1.83 +	GetFormatOfFepInlineText() again passing 4 into aPositionOfCharacter. As the 
    1.84 +	2 characters starting at position 4 are all in format B, the function should 
    1.85 +	set aFormat to B and it should set aNumberOfCharactersWithSameFormat to 2. 
    1.86 +	The FEP framework still does not know the format of the 7th character so it 
    1.87 +	calls GetFormatOfFepInlineText() a third time passing 6 into aPositionOfCharacter. 
    1.88 +	As the character at position 6 is in format C, the function should set aFormat 
    1.89 +	to C and it should set aNumberOfCharactersWithSameFormat to 1. The FEP framework 
    1.90 +	now knows the format of all of the inline text.
    1.91 +	
    1.92 +	@param aFormat On return, contains the formatting to apply to the inline text 
    1.93 +	(or to a portion of it).
    1.94 +	@param aNumberOfCharactersWithSameFormat On return, contains the number of 
    1.95 +	characters in the inline text (starting at aPositionOfCharacter) which have 
    1.96 +	the same formatting.
    1.97 +	@param aPositionOfCharacter Start position within the inline text. */
    1.98 +	virtual void GetFormatOfFepInlineText(TCharFormat& aFormat, TInt& aNumberOfCharactersWithSameFormat, TInt aPositionOfCharacter) const=0;
    1.99 +private: // reserved. do not override!
   1.100 +	IMPORT_C virtual void MFepInlineTextFormatRetriever_Reserved_1();
   1.101 +	IMPORT_C virtual void MFepInlineTextFormatRetriever_Reserved_2();
   1.102 +	};
   1.103 +
   1.104 +#endif	// __FEPITFR_H__