CNotepadApi Class Reference

class CNotepadApi : public CBase

APIs of Notepad library. CNotepadApi provides APIs for other modules.

NpdLib.lib

Inherits from

Public Member Functions
~CNotepadApi()
IMPORT_C voidAddContentL(const TDesC &)
IMPORT_C voidCreateListDialogL(TInt)
IMPORT_C voidCreateModelL(TInt)
IMPORT_C voidCreateViewerDialogL(const TDesC &, const TDesC *, const TBool, TBool, TUint)
IMPORT_C voidCreateViewerDialogL(RFile &, const TDesC *, const TBool, TBool, TUint)
IMPORT_C voidCreateViewerDialogL(const TBool)
IMPORT_C CEikDialog *Dialog()
IMPORT_C TIntExecFileViewerL(const TDesC &, const TDesC *, const TBool, TBool, TUint)
IMPORT_C TIntExecFileViewerL(RFile &, const TDesC *, const TBool, TBool, TUint)
IMPORT_C TIntExecReadOnlyTextViewerL(const TDesC &, const TDesC &, const TDesC &)
IMPORT_C TIntExecTemplatesL()
IMPORT_C HBufC *ExecTextEditorL(TInt &, const TDesC &, const TDesC &, const TDesC &)
IMPORT_C HBufC *ExecTextViewerL(TInt &, const TDesC &, const TDesC &, const TDesC &)
IMPORT_C TBoolExistsMemoL(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 TIntNumberOfTemplates()
IMPORT_C TBoolProbeMemoL(const TInt)
IMPORT_C voidSaveFileAsMemoL(const TDesC &)
IMPORT_C voidSaveFileAsMemoL(RFile &)
IMPORT_C voidSaveFileAsMemoL(const TDesC &, const TUint)
IMPORT_C voidSaveFileAsMemoL(RFile &, const TUint)
Private Member Functions
CNotepadApi()
IMPORT_C voidCNotepadApi_Reserved()
IMPORT_C voidCNotepadApi_Reserved_Static()
IMPORT_C voidCreateTextEditorDialogL(HBufC **, TInt &, const TDesC &, const TDesC &, const TDesC &)
IMPORT_C voidCreateTextViewerDialogL(HBufC **, TInt &, TBool, const TDesC &, const TDesC &, const TDesC &)
HBufC *DoPopupListL(const TDesC *, TInt, TInt, TInt)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enumanonymous { ENpdDataEdited = 0, ENpdDataDeleted, ENpdDataErased }
Private Attributes
CEikDialog *iDialog
CCoeEnv *iEnv
CNotepadModel *iModel
RConeResourceLoaderiResourceLoader

Constructor & Destructor Documentation

CNotepadApi()

CNotepadApi()[private]

private c++ constructor.

~CNotepadApi()

IMPORT_C~CNotepadApi()[virtual]

Destructor. Remove a resource file of NpdLib.

Member Functions Documentation

AddContentL(const TDesC &)

IMPORT_C voidAddContentL(const TDesC &aText)[static]

Save text as a memo.

Parameters

const TDesC & aTextmemo text to save.

CNotepadApi_Reserved()

IMPORT_C voidCNotepadApi_Reserved()[private, virtual]

Reserved API entry.

CNotepadApi_Reserved_Static()

IMPORT_C voidCNotepadApi_Reserved_Static()[private, static]

Reserved API entry.

CreateListDialogL(TInt)

IMPORT_C voidCreateListDialogL(TIntaResId)

Parameters

TInt aResIdresource id of type NOTEPAD_LIST_DIALOG.

CreateModelL(TInt)

IMPORT_C voidCreateModelL(TIntaResId)

Create CNotepadModel.

Parameters

TInt aResIdresource id of type NOTEPAD_MODEL.

CreateTextEditorDialogL(HBufC **, TInt &, const TDesC &, const TDesC &, const TDesC &)

IMPORT_C voidCreateTextEditorDialogL(HBufC **aContentPointer,
TInt &aReturnStatus,
const TDesC &aText =  KNullDesC ,
const TDesC &aTitle =  KNullDesC ,
const TDesC &aDeleteConfirmationText =  KNullDesC
)[private]

Creates text editor dialog

Parameters

HBufC ** aContentPointer
TInt & aReturnStatusKErrGeneral (-1) if document was deleted, KErrNone otherwise.
const TDesC & aText =  KNullDesC descriptor that holds the initial text. If null, editor starts empty
const TDesC & aTitle =  KNullDesC Title of the editor dialog. If null, application default is used instead.
const TDesC & aDeleteConfirmationText =  KNullDesC Confirmation text shown if user chooses to delete the document

CreateTextViewerDialogL(HBufC **, TInt &, TBool, const TDesC &, const TDesC &, const TDesC &)

IMPORT_C voidCreateTextViewerDialogL(HBufC **aContentPointer,
TInt &aReturnStatus,
TBoolaReadOnly,
const TDesC &aText,
const TDesC &aTitle =  KNullDesC ,
const TDesC &aDeleteConfirmationText =  KNullDesC
)[private]

Creates text viewer dialog for editable text

Parameters

HBufC ** aContentPointer
TInt & aReturnStatusKErrGeneral (-1) if the text was deleted. KErrNone otherwise
TBool aReadOnlyindicates whether text is readonly or editable
const TDesC & aTextthe text to be viewed
const TDesC & aTitle =  KNullDesC Title of the viewer dialog. If null, application default is used instead.
const TDesC & aDeleteConfirmationText =  KNullDesC Confirmation text shown if user chooses to delete the document

CreateViewerDialogL(const TDesC &, const TDesC *, const TBool, TBool, TUint)

IMPORT_C voidCreateViewerDialogL(const TDesC &aFileName,
const TDesC *aTitle,
const TBoolaDoWait,
TBoolaGuessEncoding = EFalse,
TUintaEncoding =  KCharacterSetIdentifierIso88591
)

Parameters

const TDesC & aFileNamefilename to view.
const TDesC * aTitletitle pane (if NULL, filename is used).
const TBool aDoWaitcreate waiting dialog if ETrue.
TBool aGuessEncoding = EFalseguess encoding if ETrue (ignore aEncoding).
TUint aEncoding =  KCharacterSetIdentifierIso88591 encoding of the File (default ISO-8859-1. This is ignored if aGuessEncoding is ETrue).

CreateViewerDialogL(RFile &, const TDesC *, const TBool, TBool, TUint)

IMPORT_C voidCreateViewerDialogL(RFile &aFile,
const TDesC *aTitle,
const TBoolaDoWait,
TBoolaGuessEncoding = EFalse,
TUintaEncoding =  KCharacterSetIdentifierIso88591
)

Parameters

RFile & aFilefile handle.
const TDesC * aTitletitle pane (if NULL, filename is used).
const TBool aDoWaitcreate waiting dialog if ETrue.
TBool aGuessEncoding = EFalseguess encoding if ETrue (ignore aEncoding).
TUint aEncoding =  KCharacterSetIdentifierIso88591 encoding of the File (default ISO-8859-1. This is ignored if aGuessEncoding is ETrue).

CreateViewerDialogL(const TBool)

IMPORT_C voidCreateViewerDialogL(const TBoolaDoWait)

Parameters

const TBool aDoWaitcreate waiting dialog if ETrue.

Dialog()

IMPORT_C CEikDialog *Dialog()

Return internal Dialog object. (Internal to NpdLib)

DoPopupListL(const TDesC *, TInt, TInt, TInt)

HBufC *DoPopupListL(const TDesC *aTitle,
TIntaModelResId,
TIntaPromptResId,
TIntaEmptyTextResId = 0
)[private]

Show PopupList.

Parameters

const TDesC * aTitletitle of popup list.
TInt aModelResIdresource id of type NOTEPAD_MODEL.
TInt aPromptResIdresource id of prompt text, which is used when aTitle is NULL.
TInt aEmptyTextResId = 0resource id of empty text.

ExecFileViewerL(const TDesC &, const TDesC *, const TBool, TBool, TUint)

IMPORT_C TIntExecFileViewerL(const TDesC &aFileName,
const TDesC *aTitle = NULL,
const TBoolaDoWait = ETrue,
TBoolaGuessEncoding = EFalse,
TUintaEncoding =  KCharacterSetIdentifierIso88591
)[static]

Execute a file viewer dialog.

Parameters

const TDesC & aFileNametext file to view.
const TDesC * aTitle = NULLTitlePane string (if NULL, Title will be FileName).
const TBool aDoWait = ETrueUse wait dialog if ETrue.
TBool aGuessEncoding = EFalseguess encoding if ETrue (ignore aEncoding).
TUint aEncoding =  KCharacterSetIdentifierIso88591 encoding of the File (default ISO-8859-1. This is ignored if aGuessEncoding is ETrue).

ExecFileViewerL(RFile &, const TDesC *, const TBool, TBool, TUint)

IMPORT_C TIntExecFileViewerL(RFile &aFile,
const TDesC *aTitle = NULL,
const TBoolaDoWait = ETrue,
TBoolaGuessEncoding = EFalse,
TUintaEncoding =  KCharacterSetIdentifierIso88591
)[static]

Execute a file viewer dialog.

Parameters

RFile & aFilefile handle.
const TDesC * aTitle = NULLTitlePane string (if NULL, Title will be FileName).
const TBool aDoWait = ETrueUse wait dialog if ETrue.
TBool aGuessEncoding = EFalseguess encoding if ETrue (ignore aEncoding).
TUint aEncoding =  KCharacterSetIdentifierIso88591 encoding of the File (default ISO-8859-1. This is ignored if aGuessEncoding is ETrue).

ExecReadOnlyTextViewerL(const TDesC &, const TDesC &, const TDesC &)

IMPORT_C TIntExecReadOnlyTextViewerL(const TDesC &aText,
const TDesC &aTitle =  KNullDesC ,
const TDesC &aDeleteConfirmationText =  KNullDesC
)[static]

Execute text viewer dialog for read only text

Parameters

const TDesC & aTextthe text to be viewed.
const TDesC & aTitle =  KNullDesC Title of the viewer dialog. If null, application default is used instead.
const TDesC & aDeleteConfirmationText =  KNullDesC Confirmation text shown if user chooses to delete the document

ExecTemplatesL()

IMPORT_C TIntExecTemplatesL()[static]

Execute MCE's "List of templates".

ExecTextEditorL(TInt &, const TDesC &, const TDesC &, const TDesC &)

IMPORT_C HBufC *ExecTextEditorL(TInt &aReturnStatus,
const TDesC &aText =  KNullDesC ,
const TDesC &aTitle =  KNullDesC ,
const TDesC &aDeleteConfirmationText =  KNullDesC
)[static]

Execute text editor dialog

Parameters

TInt & aReturnStatusKErrGeneral (-1) if document was deleted, KErrNone otherwise.
const TDesC & aText =  KNullDesC descriptor that holds the initial text. If null, editor starts empty
const TDesC & aTitle =  KNullDesC Title of the editor dialog. If null, application default is used instead.
const TDesC & aDeleteConfirmationText =  KNullDesC Confirmation text shown if user chooses to delete the document

ExecTextViewerL(TInt &, const TDesC &, const TDesC &, const TDesC &)

IMPORT_C HBufC *ExecTextViewerL(TInt &aReturnStatus,
const TDesC &aText,
const TDesC &aTitle =  KNullDesC ,
const TDesC &aDeleteConfirmationText =  KNullDesC
)[static]

Execute text viewer dialog for editable text

Parameters

TInt & aReturnStatusKErrGeneral (-1) if the text was deleted. KErrNone otherwise
const TDesC & aTextthe text to be viewed
const TDesC & aTitle =  KNullDesC Title of the viewer dialog. If null, application default is used instead.
const TDesC & aDeleteConfirmationText =  KNullDesC Confirmation text shown if user chooses to delete the document

ExistsMemoL(const TInt)

IMPORT_C TBoolExistsMemoL(const TIntaKey)[static]

Probe a memo (API for Pinboard).

Parameters

const TInt aKeya serial number of memo.

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.

Parameters

const TDesC * aTitle = NULLOptional title text.

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.

Parameters

const TDesC * aTitle = NULLOptional title text.

Model()

IMPORT_C CNotepadModel *Model()

Return internal Model object. (Internal to NpdLib)

NewL()

IMPORT_C CNotepadApi *NewL()[static]

Constructor. Add a resource file of NpdLib.

NewLC()

IMPORT_C CNotepadApi *NewLC()[static]

Constructor, returned value is also kept on the CleanupStack. Add a resource file of NpdLib.

NumberOfTemplates()

IMPORT_C TIntNumberOfTemplates()[static]

Get number of templates.

Return an error code (less than zero) if any trouble.

ProbeMemoL(const TInt)

IMPORT_C TBoolProbeMemoL(const TIntaKey)

Probe a memo (API for Pinboard). This method is more efficient than ExistsMemoL when it is neccessary to probe many memos at a time.

Parameters

const TInt aKeya serial number of memo.

SaveFileAsMemoL(const TDesC &)

IMPORT_C voidSaveFileAsMemoL(const TDesC &aFileName)[static]

Save contents of a specified file as a memo.

Parameters

const TDesC & aFileNamethe name of a file to be saved.

SaveFileAsMemoL(RFile &)

IMPORT_C voidSaveFileAsMemoL(RFile &aFile)[static]

Save contents of a specified file as a memo.

Parameters

RFile & aFilethe file handle.

SaveFileAsMemoL(const TDesC &, const TUint)

IMPORT_C voidSaveFileAsMemoL(const TDesC &aFileName,
const TUintaEncoding
)[static]

Save contents of a specified file as a memo.

Parameters

const TDesC & aFileNamethe name of a file to be saved.
const TUint aEncodingThe character encoding used in the file.

SaveFileAsMemoL(RFile &, const TUint)

IMPORT_C voidSaveFileAsMemoL(RFile &aFile,
const TUintaEncoding
)[static]

Save contents of a specified file as a memo.

Parameters

RFile & aFilethe file handle.
const TUint aEncodingThe character encoding used in the file.

Member Enumerations Documentation

Enum anonymous

Enumerators

ENpdDataEdited = 0
ENpdDataDeleted
ENpdDataErased

Member Data Documentation

CEikDialog * iDialog

CEikDialog *iDialog[private]

CCoeEnv * iEnv

CCoeEnv *iEnv[private]

CNotepadModel * iModel

CNotepadModel *iModel[private]

RConeResourceLoader iResourceLoader

RConeResourceLoaderiResourceLoader[private]