Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
How to add caption to a FEP-aware text editor
S60 5th Edition
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.
#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.
void CMyEdwin::GetCaptionForFep(TDes& aCaption) const
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));
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.