Does anybody know how to access templates from a SMS application? I have a SMS application, that sends or receives SMS. But I want to access the standard templates to send SMS as it is done in any S60 phone.
The template messages are stored in "c:\system\Data\Template.n0x" file.
I think the templates are stored in Symbian's proprietary format. There are no public APIs to access them. Try and see if you can read these templates.
Templates can be opened and then inserted into the message body. This feature is supported in almost all the phone. I found out the way to do it. Putting the info for those who dont know how to do it.
Use CNpdApi class for this. Its not documented in any public SDKs but the header file is available in \epoc32\include. Check out the APIs in this class.
The following piece of code will store the template text into a buffer which can be set into the edwin control for message body. Â Â Â Â Â Â Â Â TBuf<160> messageText; Â Â Â Â _LIT(KText,"Templates");Â Â Â Â Â Â Â Â Â Â Â Â Â TBufC<16> buf1(KText);Â Â Â Â Â Â Â Â Â Â Â Â Â iBuf= CNotepadApi::FetchTemplateL(&buf1);
iBuf is a member variable of type HBufC* iBuf;
Call to CNotepadApi::FetchTemplate will launch the list of avilable templates in a list and when a particular template is selected, it returns the template text into a buffer.
Forum posts: 235
I think the templates are stored in Symbian's proprietary format. There are no public APIs to access them. Try and see if you can read these templates.
Vink
Forum posts: 14
Use CNpdApi class for this. Its not documented in any public SDKs but the header file is available in \epoc32\include. Check out the APIs in this class.
The following piece of code will store the template text into a buffer which can be set into the edwin control for message body.
        TBuf<160> messageText;
    _LIT(KText,"Templates");     Â
       TBufC<16> buf1(KText);     Â
       iBuf= CNotepadApi::FetchTemplateL(&buf1);
iBuf is a member variable of type HBufC* iBuf;
Call to CNotepadApi::FetchTemplate will launch the list of avilable templates in a list and when a particular template is selected, it returns the template text into a buffer.
Cheers,
OJ