CNotepadApi Class Reference

API published in: S60 1st Ed

Link against: npdlib.lib

Capability Information

Required Capabilities

None


#include <npdapi.h>

Detailed Description

APIs of Notepad library.

CNotepadApi provides APIs for other modules.


Public Types

enum   { ENpdDataEdited = 0, ENpdDataDeleted, ENpdDataErased }

Public Member Functions

virtual IMPORT_C  ~CNotepadApi ()
  Destructor.
IMPORT_C CEikDialog Dialog ()
  Return internal Dialog object.
IMPORT_C CNotepadModel *  Model ()
  Return internal Model object.
IMPORT_C void  CreateListDialogL (TInt aResId)
  Create CNotepadListDialog.
IMPORT_C void  CreateViewerDialogL (const TDesC &aFileName, const TDesC *aTitle, const TBool aDoWait, TBool aGuessEncoding=EFalse, TUint aEncoding=KCharacterSetIdentifierIso88591)
  Create CNotepadViewerDialog.
IMPORT_C void  CreateViewerDialogL (RFile &aFile, const TDesC *aTitle, const TBool aDoWait, TBool aGuessEncoding=EFalse, TUint aEncoding=KCharacterSetIdentifierIso88591)
  Create CNotepadViewerDialog.
IMPORT_C void  CreateViewerDialogL (const TBool aDoWait)
  Create CNotepadViewerDialog.
IMPORT_C void  CreateModelL (TInt aResId)
  Create CNotepadModel.
IMPORT_C TBool  ProbeMemoL (const TInt aKey)
  Probe a memo (API for Pinboard).

Static Public Member Functions

static IMPORT_C CNotepadApi NewL ()
  Constructor.
static IMPORT_C CNotepadApi NewLC ()
  Constructor, returned value is also kept on the CleanupStack.
static IMPORT_C HBufC *  FetchMemoL (const TDesC *aTitle=NULL)
  Fetch a memo.
static IMPORT_C HBufC *  FetchTemplateL (const TDesC *aTitle=NULL)
  Fetch a template.
static IMPORT_C TInt  ExecTemplatesL ()
  Execute MCE's "List of templates".
static IMPORT_C TInt  ExecFileViewerL (const TDesC &aFileName, const TDesC *aTitle=NULL, const TBool aDoWait=ETrue, TBool aGuessEncoding=EFalse, TUint aEncoding=KCharacterSetIdentifierIso88591)
  Execute a file viewer dialog.
static IMPORT_C TInt  ExecFileViewerL (RFile &aFile, const TDesC *aTitle=NULL, const TBool aDoWait=ETrue, TBool aGuessEncoding=EFalse, TUint aEncoding=KCharacterSetIdentifierIso88591)
  Execute a file viewer dialog.
static IMPORT_C void  AddContentL (const TDesC &aText)
  Save text as a memo.
static IMPORT_C TBool  ExistsMemoL (const TInt aKey)
  Probe a memo (API for Pinboard).
static IMPORT_C TInt  NumberOfTemplates ()
  Get number of templates.
static IMPORT_C void  SaveFileAsMemoL (const TDesC &aFileName)
  Save contents of a specified file as a memo.
static IMPORT_C void  SaveFileAsMemoL (RFile &aFile)
  Save contents of a specified file as a memo.
static IMPORT_C void  SaveFileAsMemoL (const TDesC &aFileName, const TUint aEncoding)
  Save contents of a specified file as a memo.
static IMPORT_C void  SaveFileAsMemoL (RFile &aFile, const TUint aEncoding)
  Save contents of a specified file as a memo.
static IMPORT_C TInt  ExecReadOnlyTextViewerL (const TDesC &aText, const TDesC &aTitle=KNullDesC, const TDesC &aDeleteConfirmationText=KNullDesC)
  Execute text viewer dialog for read only text.
static IMPORT_C HBufC *  ExecTextViewerL (TInt &aReturnStatus, const TDesC &aText, const TDesC &aTitle=KNullDesC, const TDesC &aDeleteConfirmationText=KNullDesC)
  Execute text viewer dialog for editable text.
static IMPORT_C HBufC *  ExecTextEditorL (TInt &aReturnStatus, const TDesC &aText=KNullDesC, const TDesC &aTitle=KNullDesC, const TDesC &aDeleteConfirmationText=KNullDesC)
  Execute text editor dialog.

Member Enumeration Documentation

anonymous enum
 
Enumerator:
ENpdDataEdited 
ENpdDataDeleted 
ENpdDataErased 

Constructor & Destructor Documentation

virtual IMPORT_C CNotepadApi::~CNotepadApi  )  [virtual]
 

Destructor.

Remove a resource file of NpdLib.


Member Function Documentation

static IMPORT_C void CNotepadApi::AddContentL const TDesC &  aText  )  [static]
 

Save text as a memo.

Parameters:
aText  memo text to save.
IMPORT_C void CNotepadApi::CreateListDialogL TInt  aResId  ) 
 

Create CNotepadListDialog.

Parameters:
aResId  resource id of type NOTEPAD_LIST_DIALOG.
IMPORT_C void CNotepadApi::CreateModelL TInt  aResId  ) 
 

Create CNotepadModel.

Parameters:
aResId  resource id of type NOTEPAD_MODEL.
IMPORT_C void CNotepadApi::CreateViewerDialogL const TBool  aDoWait  ) 
 

Create CNotepadViewerDialog.

Parameters:
aDoWait  create waiting dialog if ETrue.
IMPORT_C void CNotepadApi::CreateViewerDialogL RFile &  aFile,
const TDesC *  aTitle,
const TBool  aDoWait,
TBool  aGuessEncoding = EFalse,
TUint  aEncoding = KCharacterSetIdentifierIso88591
 

Create CNotepadViewerDialog.

Parameters:
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).
IMPORT_C void CNotepadApi::CreateViewerDialogL const TDesC &  aFileName,
const TDesC *  aTitle,
const TBool  aDoWait,
TBool  aGuessEncoding = EFalse,
TUint  aEncoding = KCharacterSetIdentifierIso88591
 

Create CNotepadViewerDialog.

Parameters:
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).
IMPORT_C CEikDialog* CNotepadApi::Dialog  ) 
 

Return internal Dialog object.

(Internal to NpdLib)

static IMPORT_C TInt CNotepadApi::ExecFileViewerL RFile &  aFile,
const TDesC *  aTitle = NULL,
const TBool  aDoWait = ETrue,
TBool  aGuessEncoding = EFalse,
TUint  aEncoding = KCharacterSetIdentifierIso88591
[static]
 

Execute a file viewer dialog.

Parameters:
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.
static IMPORT_C TInt CNotepadApi::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:
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.
static IMPORT_C TInt CNotepadApi::ExecReadOnlyTextViewerL const TDesC &  aText,
const TDesC &  aTitle = KNullDesC,
const TDesC &  aDeleteConfirmationText = KNullDesC
[static]
 

Execute text viewer dialog for read only text.

Parameters:
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.
static IMPORT_C TInt CNotepadApi::ExecTemplatesL  )  [static]
 

Execute MCE's "List of templates".

Returns:
CEikDialog's exit status.
static IMPORT_C HBufC* CNotepadApi::ExecTextEditorL TInt &  aReturnStatus,
const TDesC &  aText = KNullDesC,
const TDesC &  aTitle = KNullDesC,
const TDesC &  aDeleteConfirmationText = KNullDesC
[static]
 

Execute text editor dialog.

Parameters:
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.
static IMPORT_C HBufC* CNotepadApi::ExecTextViewerL TInt &  aReturnStatus,
const TDesC &  aText,
const TDesC &  aTitle = KNullDesC,
const TDesC &  aDeleteConfirmationText = KNullDesC
[static]
 

Execute text viewer dialog for editable text.

Parameters:
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..
static IMPORT_C TBool CNotepadApi::ExistsMemoL const TInt  aKey  )  [static]
 

Probe a memo (API for Pinboard).

Parameters:
aKey  a serial number of memo.
Returns:
ETrue if exists, EFalse otherwise.
static IMPORT_C HBufC* CNotepadApi::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:
aTitle  Optional title text.
Returns:
fetched string, (NULL if canceled or no memo).
static IMPORT_C HBufC* CNotepadApi::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:
aTitle  Optional title text.
Returns:
fetched string, (NULL if canceled or no templates).
IMPORT_C CNotepadModel* CNotepadApi::Model  ) 
 

Return internal Model object.

(Internal to NpdLib)

static IMPORT_C CNotepadApi* CNotepadApi::NewL  )  [static]
 

Constructor.

Add a resource file of NpdLib.

Returns:
constructed CNotepadApi object.
static IMPORT_C CNotepadApi* CNotepadApi::NewLC  )  [static]
 

Constructor, returned value is also kept on the CleanupStack.

Add a resource file of NpdLib.

Returns:
constructed CNotepadApi object.
static IMPORT_C TInt CNotepadApi::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.
IMPORT_C TBool CNotepadApi::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:
aKey  a serial number of memo.
Returns:
ETrue if exists, EFalse otherwise.
static IMPORT_C void CNotepadApi::SaveFileAsMemoL RFile &  aFile,
const TUint  aEncoding
[static]
 

Save contents of a specified file as a memo.

Parameters:
aFile  the file handle.
aEncoding  The character encoding used in the file.
static IMPORT_C void CNotepadApi::SaveFileAsMemoL const TDesC &  aFileName,
const TUint  aEncoding
[static]
 

Save contents of a specified file as a memo.

Parameters:
aFileName  the name of a file to be saved.
aEncoding  The character encoding used in the file.
static IMPORT_C void CNotepadApi::SaveFileAsMemoL RFile &  aFile  )  [static]
 

Save contents of a specified file as a memo.

Parameters:
aFile  the file handle.
static IMPORT_C void CNotepadApi::SaveFileAsMemoL const TDesC &  aFileName  )  [static]
 

Save contents of a specified file as a memo.

Parameters:
aFileName  the name of a file to be saved.

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top