CPbkDataSaveAppUi Class Reference

API published in: S60 1st Ed
API deprecated in: S60 5th Ed

Link against: pbkview.lib

Capability Information

Required Capabilities

ReadUserData WriteUserData


#include <cpbkdatasaveappui.h>

Detailed Description

Phonebook Data Save service helper.

Implements "Save to phonebook" menu functionality for external applications.

Note that in most cases current status pane layout is replaced with the Phonebook one. Restoring the original pane is left to be the responsibility of the client.


Public Member Functions

  ~CPbkDataSaveAppUi ()
  Destructor.
IMPORT_C void  AddMenuItemsL (CEikMenuPane *aMenuPane, TInt aCommandId)
  Adds Phonebook data save menu items to a menu pane.
IMPORT_C void  DynInitMenuPaneL (TInt aResourceId, CEikMenuPane *aMenuPane)
  Updates Phonebook data save menu items.
IMPORT_C TBool  HandleCommandL (TInt aCommandId, CArrayPtr< CPbkFieldInfo > &aFieldTypes, const TDesC &aText, MPbkDataSaveCallback *aCallback=NULL)
  Handles a menu command inserted by AddMenuItemsL.
IMPORT_C TBool  HandleCommandL (TInt aCommandId, CArrayPtr< CPbkFieldInfo > &aFieldTypes, const TTime &aDate, MPbkDataSaveCallback *aCallback=NULL)
  Handles a menu command inserted by AddMenuItemsL.
IMPORT_C void  HideEditorExitCommand ()
  Hides the "Exit" command from contact editor's options menu.

Static Public Member Functions

static IMPORT_C CPbkDataSaveAppUi NewL (CPbkContactEngine &aEngine)
  Creates an instance of this class.

Constructor & Destructor Documentation

CPbkDataSaveAppUi::~CPbkDataSaveAppUi  ) 
 

Destructor.

Destroys this object and cancels any open dialogs.


Member Function Documentation

IMPORT_C void CPbkDataSaveAppUi::AddMenuItemsL CEikMenuPane aMenuPane,
TInt  aCommandId
 

Adds Phonebook data save menu items to a menu pane.

Called from applications DynInitMenuPaneL. This call is not mandatory: if the application provides its own menus it may call HandleCommandL directly from menu's command handler.

Parameters:
aMenuPane  Menu pane where to add the menu items.
aCommandId  Id of command which to replace with Phonebook data save menu items. This command id is stored into this object as the base id after which are app-specific command Ids reserved for Phonebook data save API usage.
See also:
DynInitMenuPaneL

HandleCommandL

IMPORT_C void CPbkDataSaveAppUi::DynInitMenuPaneL TInt  aResourceId,
CEikMenuPane aMenuPane
 

Updates Phonebook data save menu items.

Called from applications DynInitMenuPaneL. This call is not mandatory: if the application provides its own menus it may call HandleCommandL directly from menu's command handler.

Parameters:
aResourceId  Resource id of the menu pane as passed to MEikMenuObserver::DynInitMenuPaneL. If this resource id does not match with Phonebook data save submenu this function does nothing.
aMenuPane  Menu pane as passed to MEikMenuObserver::DynInitMenuPaneL.
See also:
AddMenuItemsL
IMPORT_C TBool CPbkDataSaveAppUi::HandleCommandL TInt  aCommandId,
CArrayPtr< CPbkFieldInfo > &  aFieldTypes,
const TTime &  aDate,
MPbkDataSaveCallback aCallback = NULL
 

Handles a menu command inserted by AddMenuItemsL.

Parameters:
aCommandId  Command to execute. iBaseCommandId+1 is Create New Entry and iBaseCommandId+2 is Add to Existing Entry. Use directly EPbkCmdDataSaveCreateNew or EPbkCmdDataSaveAddToExisting if AddMenuItemsL is not called.
aFieldTypes  Field types where the user can select from. If there is only one field type selection list is not displayed.
aDate  Date to put to the selected field.
aCallback  Calls back to this object if there are problems in adding the field. See MPbkDataSaveCallback class for details.
Returns:
ETrue if the command was executed and the data added, EFalse if the operation was canceled in any stage.
See also:
AddMenuItemsL

MPbkDataSaveCallback

TPbkDataSaveCommandId in PbkDataSaveAppUi.hrh

IMPORT_C TBool CPbkDataSaveAppUi::HandleCommandL TInt  aCommandId,
CArrayPtr< CPbkFieldInfo > &  aFieldTypes,
const TDesC &  aText,
MPbkDataSaveCallback aCallback = NULL
 

Handles a menu command inserted by AddMenuItemsL.

Parameters:
aCommandId  Command to execute. iBaseCommandId+1 is Create New Entry and iBaseCommandId+2 is Add to Existing Entry. Use directly EPbkCmdDataSaveCreateNew or EPbkCmdDataSaveAddToExisting if AddMenuItemsL is not called.
aFieldTypes  Field types where the user can select from. If there is only one field type selection list is not displayed.
aText  Text to put to the selected field.
aCallback  Calls back to this object if there are problems in adding the field. See MPbkDataSaveCallback class for details.
Returns:
ETrue if the command was executed and the data added, EFalse if the operation was canceled in any stage.
See also:
AddMenuItemsL

MPbkDataSaveCallback

TPbkDataSaveCommandId in PbkDataSaveAppUi.hrh

IMPORT_C void CPbkDataSaveAppUi::HideEditorExitCommand  ) 
 

Hides the "Exit" command from contact editor's options menu.

Call this function after creating this object.

static IMPORT_C CPbkDataSaveAppUi* CPbkDataSaveAppUi::NewL CPbkContactEngine aEngine  )  [static]
 

Creates an instance of this class.

Parameters:
aEngine  Phonebook engine instance.

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

Copyright © Nokia Corporation 2001-2008
Back to top