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 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 )
Private Member Functions
CNotepadApi ()
IMPORT_C void CNotepadApi_Reserved ()
IMPORT_C void CNotepadApi_Reserved_Static ()
IMPORT_C void CreateTextEditorDialogL ( HBufC **, TInt &, const TDesC &, const TDesC &, const TDesC &)
IMPORT_C void CreateTextViewerDialogL ( 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
enum anonymous { ENpdDataEdited  = 0, ENpdDataDeleted , ENpdDataErased }
Private Attributes
CEikDialog * iDialog
CCoeEnv * iEnv
CNotepadModel * iModel
RConeResourceLoader iResourceLoader

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 void AddContentL ( const TDesC & aText ) [static]

Save text as a memo.

Parameters

const TDesC & aText memo text to save.

CNotepadApi_Reserved()

IMPORT_C void CNotepadApi_Reserved ( ) [private, virtual]

Reserved API entry.

CNotepadApi_Reserved_Static()

IMPORT_C void CNotepadApi_Reserved_Static ( ) [private, static]

Reserved API entry.

CreateListDialogL(TInt)

IMPORT_C void CreateListDialogL ( TInt aResId )

Parameters

TInt aResId resource id of type NOTEPAD_LIST_DIALOG.

CreateModelL(TInt)

IMPORT_C void CreateModelL ( TInt aResId )

Parameters

TInt aResId resource id of type NOTEPAD_MODEL.

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

IMPORT_C void CreateTextEditorDialogL ( 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 & aReturnStatus KErrGeneral (-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 void CreateTextViewerDialogL ( HBufC ** aContentPointer,
TInt & aReturnStatus,
TBool aReadOnly,
const TDesC & aText,
const TDesC & aTitle =  KNullDesC ,
const TDesC & aDeleteConfirmationText =  KNullDesC
) [private]

Creates text viewer dialog for editable text

Parameters

HBufC ** aContentPointer
TInt & aReturnStatus KErrGeneral (-1) if the text was deleted. KErrNone otherwise
TBool aReadOnly indicates whether text is readonly or editable
const TDesC & aText the 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 void CreateViewerDialogL ( const TDesC & aFileName,
const TDesC * aTitle,
const TBool aDoWait,
TBool aGuessEncoding = EFalse,
TUint aEncoding =  KCharacterSetIdentifierIso88591
)

Parameters

const TDesC & aFileName filename to view.
const TDesC * aTitle title pane (if NULL, filename is used).
const TBool aDoWait create waiting dialog if ETrue.
TBool aGuessEncoding = EFalse guess 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 void CreateViewerDialogL ( RFile & aFile,
const TDesC * aTitle,
const TBool aDoWait,
TBool aGuessEncoding = EFalse,
TUint aEncoding =  KCharacterSetIdentifierIso88591
)

Parameters

RFile & aFile file handle.
const TDesC * aTitle title pane (if NULL, filename is used).
const TBool aDoWait create waiting dialog if ETrue.
TBool aGuessEncoding = EFalse guess 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 void CreateViewerDialogL ( const TBool aDoWait )

Parameters

const TBool aDoWait create 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,
TInt aModelResId,
TInt aPromptResId,
TInt aEmptyTextResId = 0
) [private]

Show PopupList.

Parameters

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

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

IMPORT_C TInt ExecFileViewerL ( const TDesC & aFileName,
const TDesC * aTitle = NULL,
const TBool aDoWait = ETrue,
TBool aGuessEncoding = EFalse,
TUint aEncoding =  KCharacterSetIdentifierIso88591
) [static]

Execute a file viewer dialog.

Parameters

const TDesC & aFileName text file to view.
const TDesC * aTitle = NULL TitlePane string (if NULL, Title will be FileName).
const TBool aDoWait = ETrue Use wait dialog if ETrue.
TBool aGuessEncoding = EFalse guess 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 TInt ExecFileViewerL ( RFile & aFile,
const TDesC * aTitle = NULL,
const TBool aDoWait = ETrue,
TBool aGuessEncoding = EFalse,
TUint aEncoding =  KCharacterSetIdentifierIso88591
) [static]

Execute a file viewer dialog.

Parameters

RFile & aFile file handle.
const TDesC * aTitle = NULL TitlePane string (if NULL, Title will be FileName).
const TBool aDoWait = ETrue Use wait dialog if ETrue.
TBool aGuessEncoding = EFalse guess 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 TInt ExecReadOnlyTextViewerL ( const TDesC & aText,
const TDesC & aTitle =  KNullDesC ,
const TDesC & aDeleteConfirmationText =  KNullDesC
) [static]

Execute text viewer dialog for read only text

Parameters

const TDesC & aText the 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 TInt ExecTemplatesL ( ) [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 & aReturnStatus KErrGeneral (-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 & aReturnStatus KErrGeneral (-1) if the text was deleted. KErrNone otherwise
const TDesC & aText the 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 TBool ExistsMemoL ( const TInt aKey ) [static]

Probe a memo (API for Pinboard).

Parameters

const TInt aKey a 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 = NULL Optional 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 = NULL Optional 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 TInt NumberOfTemplates ( ) [static]

Get number of templates.

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

ProbeMemoL(const TInt)

IMPORT_C TBool ProbeMemoL ( const TInt aKey )

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 aKey a serial number of memo.

SaveFileAsMemoL(const TDesC &)

IMPORT_C void SaveFileAsMemoL ( const TDesC & aFileName ) [static]

Save contents of a specified file as a memo.

Parameters

const TDesC & 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.

Parameters

RFile & 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.

Parameters

const TDesC & aFileName the name of a file to be saved.
const TUint 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.

Parameters

RFile & aFile the file handle.
const TUint aEncoding The 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

RConeResourceLoader iResourceLoader [private]