CNotepadApi Class Reference
class CNotepadApi : public CBase |
Public Member Functions |
---|
virtual | ~CNotepadApi() |
IMPORT_C void | AddContentL(const TDesC &) |
IMPORT_C void | CreateListDialogL(TInt) |
IMPORT_C void | CreateModelL(TInt) |
IMPORT_C void | CreateViewerDialogL(const TDesC &, const TDesC *, const TBool, TBool, TUint) |
IMPORT_C void | CreateViewerDialogL(RFile &, const TDesC *, const TBool, TBool, TUint) |
IMPORT_C void | CreateViewerDialogL(const TBool) |
IMPORT_C CEikDialog * | Dialog() |
IMPORT_C TInt | ExecFileViewerL(const TDesC &, const TDesC *, const TBool, TBool, TUint) |
IMPORT_C TInt | ExecFileViewerL(RFile &, const TDesC *, const TBool, TBool, TUint) |
IMPORT_C TInt | ExecReadOnlyTextViewerL(const TDesC &, const TDesC &, const TDesC &) |
IMPORT_C TInt | ExecTemplatesL() |
IMPORT_C HBufC * | ExecTextEditorL(TInt &, const TDesC &, const TDesC &, const TDesC &) |
IMPORT_C HBufC * | ExecTextViewerL(TInt &, const TDesC &, const TDesC &, const TDesC &) |
IMPORT_C TBool | ExistsMemoL(const TInt) |
IMPORT_C HBufC * | FetchMemoL(const TDesC *) |
IMPORT_C HBufC * | FetchTemplateL(const TDesC *) |
IMPORT_C CNotepadModel * | Model() |
IMPORT_C CNotepadApi * | NewL() |
IMPORT_C CNotepadApi * | NewLC() |
IMPORT_C TInt | NumberOfTemplates() |
IMPORT_C TBool | ProbeMemoL(const TInt) |
IMPORT_C void | SaveFileAsMemoL(const TDesC &) |
IMPORT_C void | SaveFileAsMemoL(RFile &) |
IMPORT_C void | SaveFileAsMemoL(const TDesC &, const TUint) |
IMPORT_C void | SaveFileAsMemoL(RFile &, const TUint) |
Detailed Description
APIs of Notepad library. CNotepadApi provides APIs for other modules.
Member Enumeration Documentation
Enum anonymous
Enumerator | Value | Description |
---|
ENpdDataEdited | 0 | |
ENpdDataDeleted | | |
ENpdDataErased | | |
Constructor & Destructor Documentation
~CNotepadApi ( )
IMPORT_C | ~CNotepadApi | ( | ) | [virtual] |
Destructor. Remove a resource file of NpdLib.
Member Function Documentation
AddContentL ( const TDesC & )
IMPORT_C void | AddContentL | ( | const TDesC & | aText | ) | [static] |
Parameter | Description | aText | memo text to save. |
CreateListDialogL ( TInt )
IMPORT_C void | CreateListDialogL | ( | TInt | aResId | ) | |
Create CNotepadListDialog.
Parameter | Description | aResId | resource id of type NOTEPAD_LIST_DIALOG. |
CreateModelL ( TInt )
IMPORT_C void | CreateModelL | ( | TInt | aResId | ) | |
Parameter | Description | aResId | resource id of type NOTEPAD_MODEL. |
CreateViewerDialogL ( const TDesC &, const TDesC *, const TBool, TBool, TUint )
Create CNotepadViewerDialog.
Parameter | Description | aFileName | filename to view. |
aTitle | title pane (if NULL, filename is used). |
aDoWait | create waiting dialog if ETrue. |
aGuessEncoding | guess encoding if ETrue (ignore aEncoding). |
aEncoding | encoding of the File (default ISO-8859-1. This is ignored if aGuessEncoding is ETrue). |
CreateViewerDialogL ( RFile &, const TDesC *, const TBool, TBool, TUint )
Create CNotepadViewerDialog.
Parameter | Description | aFile | file handle. |
aTitle | title pane (if NULL, filename is used). |
aDoWait | create waiting dialog if ETrue. |
aGuessEncoding | guess encoding if ETrue (ignore aEncoding). |
aEncoding | encoding of the File (default ISO-8859-1. This is ignored if aGuessEncoding is ETrue). |
CreateViewerDialogL ( const TBool )
IMPORT_C void | CreateViewerDialogL | ( | const TBool | aDoWait | ) | |
Create CNotepadViewerDialog.
Parameter | Description | aDoWait | create waiting dialog if ETrue. |
Dialog ( )
Return internal Dialog object. (Internal to NpdLib)
ExecFileViewerL ( const TDesC &, const TDesC *, const TBool, TBool, TUint )
Execute a file viewer dialog.
Parameter | Description | aFileName | text file to view. |
aTitle | TitlePane string (if NULL, Title will be FileName). |
aDoWait | Use wait dialog if ETrue. |
aGuessEncoding | guess encoding if ETrue (ignore aEncoding). |
aEncoding | encoding of the File (default ISO-8859-1. This is ignored if aGuessEncoding is ETrue). |
Returns: CEikDialog's exit status.
ExecFileViewerL ( RFile &, const TDesC *, const TBool, TBool, TUint )
Execute a file viewer dialog.
Parameter | Description | aFile | file handle. |
aTitle | TitlePane string (if NULL, Title will be FileName). |
aDoWait | Use wait dialog if ETrue. |
aGuessEncoding | guess encoding if ETrue (ignore aEncoding). |
aEncoding | encoding of the File (default ISO-8859-1. This is ignored if aGuessEncoding is ETrue). |
Returns: CEikDialog's exit status.
ExecReadOnlyTextViewerL ( const TDesC &, const TDesC &, const TDesC & )
Execute text viewer dialog for read only text
Parameter | Description | aText | the text to be viewed. |
aTitle | Title of the viewer dialog. If null, application default is used instead. |
aDeleteConfirmationText | Confirmation text shown if user chooses to delete the document |
Returns: KErrNone or one of the global error codes.
ExecTemplatesL ( )
IMPORT_C TInt | ExecTemplatesL | ( | ) | [static] |
Execute MCE's "List of templates".
Returns: CEikDialog's exit status.
ExecTextEditorL ( TInt &, const TDesC &, const TDesC &, const TDesC & )
Execute text editor dialog
Parameter | Description | aReturnStatus | KErrGeneral (-1) if document was deleted, KErrNone otherwise. |
aText | descriptor that holds the initial text. If null, editor starts empty |
aTitle | Title of the editor dialog. If null, application default is used instead. |
aDeleteConfirmationText | Confirmation text shown if user chooses to delete the document |
Returns: pointer to modified text.
ExecTextViewerL ( TInt &, const TDesC &, const TDesC &, const TDesC & )
Execute text viewer dialog for editable text
Parameter | Description | aReturnStatus | KErrGeneral (-1) if the text was deleted. KErrNone otherwise |
aText | the text to be viewed |
aTitle | Title of the viewer dialog. If null, application default is used instead. |
aDeleteConfirmationText | Confirmation text shown if user chooses to delete the document |
Returns: Pointer to modified text. Returns null if text was not edited..
ExistsMemoL ( const TInt )
IMPORT_C TBool | ExistsMemoL | ( | const TInt | aKey | ) | [static] |
Probe a memo (API for Pinboard).
Parameter | Description | aKey | a serial number of memo. |
Returns: ETrue if exists, EFalse otherwise.
FetchMemoL ( const TDesC * )
IMPORT_C HBufC * | FetchMemoL | ( | const TDesC * | aTitle = NULL | ) | [static] |
Fetch a memo.
No need for a pre-allocated buffer. Return NULL if the popup list is canceled or there is no memo. Caller owns the returned HBufC object.
Parameter | Description | aTitle | Optional title text. |
Returns: fetched string, (NULL if canceled or no memo).
FetchTemplateL ( const TDesC * )
IMPORT_C HBufC * | FetchTemplateL | ( | const TDesC * | aTitle = NULL | ) | [static] |
Fetch a template.
No need for a pre-allocated buffer. Return NULL if the popup list is canceled or there is no template. Caller owns the returned HBufC object.
Parameter | Description | aTitle | Optional title text. |
Returns: fetched string, (NULL if canceled or no templates).
Model ( )
IMPORT_C CNotepadModel * | Model | ( | ) | |
Return internal Model object. (Internal to NpdLib)
NewL ( )
Constructor. Add a resource file of NpdLib.
Returns: constructed CNotepadApi object.
NewLC ( )
Constructor, returned value is also kept on the CleanupStack. Add a resource file of NpdLib.
Returns: constructed CNotepadApi object.
NumberOfTemplates ( )
IMPORT_C TInt | NumberOfTemplates | ( | ) | [static] |
Get number of templates.
Return an error code (less than zero) if any trouble.
Returns: number of templates. returns error code (less than zero) if any trouble.
ProbeMemoL ( const TInt )
Probe a memo (API for Pinboard). This method is more efficient than ExistsMemoL when it is neccessary to probe many memos at a time.
Parameter | Description | aKey | a serial number of memo. |
Returns: ETrue if exists, EFalse otherwise.
SaveFileAsMemoL ( const TDesC & )
IMPORT_C void | SaveFileAsMemoL | ( | const TDesC & | aFileName | ) | [static] |
Save contents of a specified file as a memo.
Parameter | Description | aFileName | the name of a file to be saved. |
SaveFileAsMemoL ( RFile & )
IMPORT_C void | SaveFileAsMemoL | ( | RFile & | aFile | ) | [static] |
Save contents of a specified file as a memo.
Parameter | Description | aFile | the file handle. |
SaveFileAsMemoL ( const TDesC &, const TUint )
IMPORT_C void | SaveFileAsMemoL | ( | const TDesC & | aFileName, |
| const TUint | aEncoding |
| ) | [static] |
Save contents of a specified file as a memo.
Parameter | Description | aFileName | the name of a file to be saved. |
aEncoding | The character encoding used in the file. |
SaveFileAsMemoL ( RFile &, const TUint )
IMPORT_C void | SaveFileAsMemoL | ( | RFile & | aFile, |
| const TUint | aEncoding |
| ) | [static] |
Save contents of a specified file as a memo.
Parameter | Description | aFile | the file handle. |
aEncoding | The character encoding used in the file. |