|
||
class MCoeFepAwareTextEditor;
Specifies a protocol for FEP-aware text editors.
TCoeInputCapabilities::FepAwareTextEditor() returns a pointer to an object of this class. A NULL return value indicates that the interface is not supported by any of the currently focused controls.
Inline editing means composing text directly in the target text editor control rather than in the FEP's edit window first. The target text editor must implement the MCoeFepAwareTextEditor interface in order to support inline text. The inline text may be differentiated from the surrounding text by the use of different formatting. These differences are removed when the inline text transaction is committed (causing the inline text to become a real part of the document). Cancelling the inline text transaction deletes the inline text and restores any previously selected text. A benefit of inline editing is that the user only has to concentrate on one area of the screen rather than two.
An inline editing transaction consists of the following sequence of function calls:
zero, one or more calls to MCoeFepAwareTextEditor::UpdateFepInlineTextL(const TDesC &,TInt)
a call to either MCoeFepAwareTextEditor::CommitFepInlineEditL(CCoeEnv &)
or MCoeFepAwareTextEditor::CancelFepInlineEdit()
Defined in MCoeFepAwareTextEditor
:
CancelFepInlineEdit()
Cancels the inline editing transaction.CommitFepInlineEditL(CCoeEnv &)
Commits the inline text to the document.DoCommitFepInlineEditL()
Private function called by MCoeFepAwareTextEditor::CommitFepInlineEditL(CCoeEnv ...DocumentLengthForFep()const
Returns the total number of characters in the text editor.DocumentMaximumLengthForFep()const
Returns the upper limit (if any) on the length of text that the text editor can ...Extension1()
Returns a pointer to an instance of the interface class MCoeFepAwareTextEditor_E...Extension1(TBool &)
This private function should be overridden by text editors which support the MCo...GetCursorSelectionForFep(TCursorSelection &)const
Gets the range of characters in the text editor which are selected.GetEditorContentForFep(TDes &,TInt,TInt)const
Copies a portion of the text editor's text content into a descriptor.GetFormatForFep(TCharFormat &,TInt)const
Gets the character formatting which applies to the document position specified.GetScreenCoordinatesForFepL(TPoint &,TInt &,TInt &,TInt)const
Gets the x,y screen coordinates for the left hand side of the baseline of the ch...MCoeFepAwareTextEditor_Reserved_2()
SetCursorSelectionForFepL(const TCursorSelection &)
Sets the range of characters in the text editor which should be selected.SetInlineEditingCursorVisibilityL(TBool)
Sets the visibility of the text cursor in the text editor.StartFepInlineEditL(const TDesC &,TInt,TBool,const MFormCustomDraw *,MFepInlineTextFormatRetriever &,MFepPointerEventHandlerDuringInlineEdit
&)
Starts a FEP inline editing transaction.UpdateFepInlineTextL(const TDesC &,TInt)
Updates the inline text.StartFepInlineEditL(const TDesC &,TInt,TBool,const MFormCustomDraw *,MFepInlineTextFormatRetriever &,MFepPointerEventHandlerDuringInlineEdit
&)
virtual void StartFepInlineEditL(const TDesC &aInitialInlineText, TInt aPositionOfInsertionPointInInlineText, TBool aCursorVisibility,
const MFormCustomDraw *aCustomDraw, MFepInlineTextFormatRetriever &aInlineTextFormatRetriever, MFepPointerEventHandlerDuringInlineEdit
&aPointerEventHandlerDuringInlineEdit)=0;
Starts a FEP inline editing transaction.
Inserts a descriptor containing the initial inline text into the text editor. The inline text should normally replace any selected text.
The final three parameters are instances of abstract classes, so that the caller of this function must create and instantiate classes deriving from them. These instances must remain in existence for the entire duration of the inline editing transaction.
Inline editing should not already be taking place when this function is called.
|
virtual void UpdateFepInlineTextL(const TDesC &aNewInlineText, TInt aPositionOfInsertionPointInInlineText)=0;
Updates the inline text.
Called when a character is added to or deleted from the inline text.
The descriptor aNewInlineText contains the entire new inline text string, not just the new text to be combined with the old inline text.
|
virtual void SetInlineEditingCursorVisibilityL(TBool aCursorVisibility)=0;
Sets the visibility of the text cursor in the text editor.
The cursor visibility is initialised using MCoeFepAwareTextEditor::StartFepInlineEditL(const TDesC &,TInt,TBool,const MFormCustomDraw *,MFepInlineTextFormatRetriever
&,MFepPointerEventHandlerDuringInlineEdit &)
. MCoeFepAwareTextEditor::SetInlineEditingCursorVisibilityL(TBool)
is provided for FEPs which need to change the visibility of the cursor during the inline editing transaction.
|
IMPORT_C void CommitFepInlineEditL(CCoeEnv &aConeEnvironment);
Commits the inline text to the document.
This function's implementation calls the text editor's implementation of MCoeFepAwareTextEditor::DoCommitFepInlineEditL()
then calls HandleCompletionOfTransactionL() for each FEP observer which has been added to the control environment's FEP observer
list (see CCoeEnv::AddFepObserverL(MCoeFepObserver &)
).
|
virtual void CancelFepInlineEdit()=0;
Cancels the inline editing transaction.
The edit window should be rolled back to the state it was in before the FEP transaction started, i.e. any inline text in the document which has not yet been committed should be removed. If the inline text has replaced existing text, (e.g. a selection) the replaced text should be reinstated.
virtual TInt DocumentLengthForFep() const=0;
Returns the total number of characters in the text editor.
|
virtual TInt DocumentMaximumLengthForFep() const=0;
Returns the upper limit (if any) on the length of text that the text editor can hold.
|
virtual void SetCursorSelectionForFepL(const TCursorSelection &aCursorSelection)=0;
Sets the range of characters in the text editor which should be selected.
|
virtual void GetCursorSelectionForFep(TCursorSelection &aCursorSelection) const=0;
Gets the range of characters in the text editor which are selected.
|
virtual void GetEditorContentForFep(TDes &aEditorContent, TInt aDocumentPosition, TInt aLengthToRetrieve) const=0;
Copies a portion of the text editor's text content into a descriptor.
|
virtual void GetFormatForFep(TCharFormat &aFormat, TInt aDocumentPosition) const=0;
Gets the character formatting which applies to the document position specified.
This function allows FEPs to find out the ambient formatting so that the FEP can choose a format for the inline text that will clearly differentiate it from the surrounding text.
|
virtual void GetScreenCoordinatesForFepL(TPoint &aLeftSideOfBaseLine, TInt &aHeight, TInt &aAscent, TInt aDocumentPosition)
const=0;
Gets the x,y screen coordinates for the left hand side of the baseline of the character located at a specified document position.
Also gets the height (ascent + descent) and ascent of the font of the character. This function could be used to position the FEP window as close as possible to the insertion point in the text editor.
|
IMPORT_C MCoeFepAwareTextEditor_Extension1* Extension1();
Returns a pointer to an instance of the interface class MCoeFepAwareTextEditor_Extension1
, or NULL, if the interface is not supported.
Calls the private virtual function of the same name.
|
private: virtual void DoCommitFepInlineEditL()=0;
Private function called by MCoeFepAwareTextEditor::CommitFepInlineEditL(CCoeEnv &)
.
Implementations should commit the inline text to the document. This ends the inline editing transaction and causes the inline text to become a part of the document.
private: IMPORT_C virtual MCoeFepAwareTextEditor_Extension1* Extension1(TBool &aSetToTrue);
This private function should be overridden by text editors which support the MCoeFepAwareTextEditor_Extension1
interface.
The implementation of this function should simply return a pointer to itself (this), and set aSetToTrue to ETrue. If not overridden,
the function returns NULL to indicate that the interface is not supported. Called by the public overload of MCoeFepAwareTextEditor::Extension1()
.
|
|
private: IMPORT_C virtual void MCoeFepAwareTextEditor_Reserved_2();