How to add caption to a FEP-aware text editor

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): S60
Platform(s): Symbian
S60 5th Edition
Keywords: CEikEdwin MCoeCaptionRetrieverForFep GetCaptionForFep TCoeInputCapabilities InputCapabilities
Created: chenziteng (27 Sep 2009)
Last edited: hamishwillee (14 Sep 2012)



On S60 5th Edition Touch UI, if a text editor has caption then when the VKB is launched it can shows the caption before the text, for example in the Message Editor the VKB shows "Message:" for the message body. This article describes how to add caption to a text editor.


A new text editor class shall be created and implement the MCoeCaptionRetrieverForFep interface.

#ifndef __MYEDWIN_H__
#define __MYEDWIN_H__
#include <eikedwin.h> // CEikEdwin
class CMyEdwin : public CEikEdwin, public MCoeCaptionRetrieverForFep
public: // CEikEdwin
TCoeInputCapabilities InputCapabilities() const;
public: // MCoeCaptionRetrieverForFep
void GetCaptionForFep(TDes& aCaption) const;

The GetCaptionForFep() shall be overridden to provide the caption, and the InputCapabilities() shall be overridden to set the this pointer as the caption retriever.

#include "MyEdwin.h"
void CMyEdwin::GetCaptionForFep(TDes& aCaption) const
_LIT(KCaption, "Caption:");
aCaption = KCaption; // note: in a real world application you should check the capacity of aCaption to avoid "USER 11 Panic"
TCoeInputCapabilities CMyEdwin::InputCapabilities() const
TCoeInputCapabilities caps = CEikEdwin::InputCapabilities();
TCoeInputCapabilities caps2 = TCoeInputCapabilities(TCoeInputCapabilities::ENone, NULL, const_cast<CMyEdwin*>(this));
return caps;

Source Code

You can download the full example program here (the code has been verified on S60 5th Edition emulator):



VKB for editors without and with caption.

EdwinNoCaption.PNG CaptionedEdwin.PNG

This page was last modified on 14 September 2012, at 09:40.
41 page views in the last 30 days.