CNotepadApi Class Reference

#include <app/NpdApi.h>

Link against: NpdLib.lib

class CNotepadApi : public CBase

Inherits from

  • CNotepadApi
    Public Member Enumerations
    enumanonymous { ENpdDataEdited, ENpdDataDeleted, ENpdDataErased }
    Public Member Functions
    virtual ~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)
    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()

    Detailed Description

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

    Member Enumeration Documentation

    Enum anonymous

    EnumeratorValueDescription
    ENpdDataEdited0
    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 voidAddContentL(const TDesC &aText)[static]

    Save text as a memo.

    ParameterDescription
    aTextmemo text to save.

    CreateListDialogL ( TInt )

    IMPORT_C voidCreateListDialogL(TIntaResId)

    Create CNotepadListDialog.

    ParameterDescription
    aResIdresource id of type NOTEPAD_LIST_DIALOG.

    CreateModelL ( TInt )

    IMPORT_C voidCreateModelL(TIntaResId)

    Create CNotepadModel.

    ParameterDescription
    aResIdresource id of type NOTEPAD_MODEL.

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

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

    Create CNotepadViewerDialog.

    ParameterDescription
    aFileNamefilename to view.
    aTitletitle pane (if NULL, filename is used).
    aDoWaitcreate waiting dialog if ETrue.
    aGuessEncodingguess encoding if ETrue (ignore aEncoding).
    aEncodingencoding 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
    )

    Create CNotepadViewerDialog.

    ParameterDescription
    aFilefile handle.
    aTitletitle pane (if NULL, filename is used).
    aDoWaitcreate waiting dialog if ETrue.
    aGuessEncodingguess encoding if ETrue (ignore aEncoding).
    aEncodingencoding of the File (default ISO-8859-1. This is ignored if aGuessEncoding is ETrue).

    CreateViewerDialogL ( const TBool )

    IMPORT_C voidCreateViewerDialogL(const TBoolaDoWait)

    Create CNotepadViewerDialog.

    ParameterDescription
    aDoWaitcreate waiting dialog if ETrue.

    Dialog ( )

    IMPORT_C CEikDialog *Dialog()

    Return internal Dialog object. (Internal to NpdLib)

    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.

    ParameterDescription
    aFileNametext file to view.
    aTitleTitlePane string (if NULL, Title will be FileName).
    aDoWaitUse wait dialog if ETrue.
    aGuessEncodingguess encoding if ETrue (ignore aEncoding).
    aEncodingencoding 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 )

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

    Execute a file viewer dialog.

    ParameterDescription
    aFilefile handle.
    aTitleTitlePane string (if NULL, Title will be FileName).
    aDoWaitUse wait dialog if ETrue.
    aGuessEncodingguess encoding if ETrue (ignore aEncoding).
    aEncodingencoding 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 & )

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

    Execute text viewer dialog for read only text

    ParameterDescription
    aTextthe text to be viewed.
    aTitleTitle of the viewer dialog. If null, application default is used instead.
    aDeleteConfirmationTextConfirmation text shown if user chooses to delete the document

    Returns: KErrNone or one of the global error codes.

    ExecTemplatesL ( )

    IMPORT_C TIntExecTemplatesL()[static]

    Execute MCE's "List of templates".

    Returns: CEikDialog's exit status.

    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

    ParameterDescription
    aReturnStatusKErrGeneral (-1) if document was deleted, KErrNone otherwise.
    aTextdescriptor that holds the initial text. If null, editor starts empty
    aTitleTitle of the editor dialog. If null, application default is used instead.
    aDeleteConfirmationTextConfirmation text shown if user chooses to delete the document

    Returns: pointer to modified text.

    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

    ParameterDescription
    aReturnStatusKErrGeneral (-1) if the text was deleted. KErrNone otherwise
    aTextthe text to be viewed
    aTitleTitle of the viewer dialog. If null, application default is used instead.
    aDeleteConfirmationTextConfirmation 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 TBoolExistsMemoL(const TIntaKey)[static]

    Probe a memo (API for Pinboard).

    ParameterDescription
    aKeya 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.

    ParameterDescription
    aTitleOptional 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.

    ParameterDescription
    aTitleOptional title text.

    Returns: fetched string, (NULL if canceled or no templates).

    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.

    Returns: constructed CNotepadApi object.

    NewLC ( )

    IMPORT_C CNotepadApi *NewLC()[static]

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

    Returns: constructed CNotepadApi object.

    NumberOfTemplates ( )

    IMPORT_C TIntNumberOfTemplates()[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 )

    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.

    ParameterDescription
    aKeya serial number of memo.

    Returns: ETrue if exists, EFalse otherwise.

    SaveFileAsMemoL ( const TDesC & )

    IMPORT_C voidSaveFileAsMemoL(const TDesC &aFileName)[static]

    Save contents of a specified file as a memo.

    ParameterDescription
    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.

    ParameterDescription
    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.

    ParameterDescription
    aFileNamethe name of a file to be saved.
    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.

    ParameterDescription
    aFilethe file handle.
    aEncodingThe character encoding used in the file.