CNotepadApi
Article Metadata
If you want to give your users the ability to enter bigger amount of text then you can use CNotepadApi.
NB! The editor of this class has Find menu item under Options. If you don't have ReadDeviceData and WriteDeviceData capabilities set, then your app will panic with KERN-EXEC 0 when selecting this menu item.
Linking and header required:
link against: NpdLib.lib
header required: #include <npdapi.h>
TInt aReturnStatus=0;
HBufC *buf=NULL;
TRAPD(err,buf=CNotepadApi::ExecTextEditorL(aReturnStatus,iText,_L("Edit Text"),_L("Delete txt?")));
if(aReturnStatus==3007 || aReturnStatus==KErrNone)
iText.Copy(*buf);
delete buf;
buf = NULL;
Following is the code to fetch template using CNotepadeApi
CNotepadApi * pNotePad = CNotepadApi:: NewLC ();
HBufC* pTemplate = NULL;
pTemplate = pNotePad->FetchTemplateL();
if(pTemplate)
{
//copy pTemplate into a buffer and can use in your application.
}
delete pTemplate;
CleanupStack::PopAndDestroy(pNotePad);


Hi, can You explain expression:
What means 3007 ? Maybe some const exists for this ...
Den123
I've just noticed that although there is support for CNotepadApi since OS 6.1 there is only documentation on OS 9.x implementation of the class.
For instance, I've just looked at the header npdapi.h for OS 7 (2.1) and there is no CNotepadApi::ExecTextEditorL function ...
Can you please give a code example on how to load a text editor, notepad style dialog for different OS versions (earlier than 3rd edition).
m00gl3