CAknForm Class Reference

API published in: S60 1st Ed

Link against: avkon.lib

Capability Information

Required Capabilities

None


#include <aknform.h>

Inherits CAknDialog.

Inherited by CPbkContactEditorDlg.


Detailed Description

Forms are special types of dialogs.

The item layout and functionality can differ between the two states. In the view state, the fields are not editable. It looks and acts like a listbox. The listbox focus can be moved and items can be selected.


Public Member Functions

IMPORT_C  CAknForm ()
  Base class default constructor.
IMPORT_C void  ConstructL (TInt aMenuBarId=0)
  Perform the second phase construction of a object.
IMPORT_C  ~CAknForm ()
  Destructor.
virtual IMPORT_C void  DynInitMenuPaneL (TInt aResourceId, CEikMenuPane *aMenuPane)
  Function from MEikMenuObserver.
virtual IMPORT_C void  ProcessCommandL (TInt aCommandId)
  Function from MEikCommandObserver.
IMPORT_C void  HandleResourceChange (TInt aType)
  Function from CCoeControl handles a change to the control's resources of type aType which are shared across the environment, e.g.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.

Protected Types

enum   TFlags { EDeleting = 0x1, EUnsavedEdit = 0x2 }

Protected Member Functions

virtual IMPORT_C TBool  OkToExitL (TInt aButtonId)
  Function from CEikDialog.
virtual IMPORT_C void  PrepareForFocusTransitionL ()
  Function from CEikDialog and thence from [email protected] MEikDialogPageObserver.
virtual IMPORT_C TBool  SaveFormDataL ()
  This routine should be re-implemented by the client to save the contents of the form.
virtual IMPORT_C void  DoNotSaveFormDataL ()
  This routine should be implemented by the client for dealing with the occasion of a change from edit->view mode but the user does not wish to save the changes.
virtual IMPORT_C TBool  QuerySaveChangesL ()
  This routine may be overridden.
virtual IMPORT_C void  EditCurrentLabelL ()
  This routine may be overridden.
virtual IMPORT_C void  DeleteCurrentItemL ()
  This routine may be overridden.
virtual IMPORT_C void  AddItemL ()
  This routine may be overridden.
IMPORT_C void  SetChangesPending (TBool aChangesPending)
  Sets changes pending.
IMPORT_C void  PostLayoutDynInitL ()
  Function from CEikdialog.
IMPORT_C void  HandleControlStateChangeL (TInt aControlId)
  Overridden, so that the form can tell if a line's state has changed.
IMPORT_C void  SetInitialCurrentLine ()
  This is added, so that anyone adding lines either in PreLayoutDynInit() or SetInitialCurrentLine() should have the lines in a consistent state.
IMPORT_C TBool  UnsavedEdit () const
  Required by OkToExit().
IMPORT_C TBool  Deleting () const
  Required by PrepareForFocusTransitionL().
IMPORT_C void  SetFormFlag (TFlags aFlagPattern, TBool aSetTheFlag)
  Set the form flag indicated.

Member Enumeration Documentation

enum CAknForm::TFlags [protected]
 
Enumerator:
EDeleting  Flag for deleting item.
EUnsavedEdit  Flag for unsave editing item.

Constructor & Destructor Documentation

IMPORT_C CAknForm::CAknForm  ) 
 

Base class default constructor.

IMPORT_C CAknForm::~CAknForm  ) 
 

Destructor.


Member Function Documentation

virtual IMPORT_C void CAknForm::AddItemL  )  [protected, virtual]
 

This routine may be overridden.

Implementation is missing in this class.

IMPORT_C void CAknForm::ConstructL TInt  aMenuBarId = 0  ) 
 

Perform the second phase construction of a object.

If a leave occurs the framework generates a Symbian Leave code.

Parameters:
aMenuResource  The menu resource to be used for the form.

Reimplemented from CAknDialog.

virtual IMPORT_C void CAknForm::DeleteCurrentItemL  )  [protected, virtual]
 

This routine may be overridden.

Default displays "Delete item? Yes/No" Deletes item on return from the dialog before returning. If a leave occurs the framework generates a Symbian Leave code.

IMPORT_C TBool CAknForm::Deleting  )  const [protected]
 

Required by PrepareForFocusTransitionL().

Returns:
ETrue if deleting, and EFalse if it should not.
virtual IMPORT_C void CAknForm::DoNotSaveFormDataL  )  [protected, virtual]
 

This routine should be implemented by the client for dealing with the occasion of a change from edit->view mode but the user does not wish to save the changes.

A typical implementation would set the controls back to their old values. If a leave occurs the framework generates a Symbian Leave code.

virtual IMPORT_C void CAknForm::DynInitMenuPaneL TInt  aResourceId,
CEikMenuPane aMenuPane
[virtual]
 

Function from MEikMenuObserver.

The framework calls this function. It removes the unused default form options. If a leave occurs the framework generates a Symbian Leave code.

Parameters:
aResourceId  The ID of the menu pane.
aMenuPane  The menu pane itself.

Reimplemented from CAknDialog.

virtual IMPORT_C void CAknForm::EditCurrentLabelL  )  [protected, virtual]
 

This routine may be overridden.

Default displays old label as caption and editor for new one. Uses customised dialog.If a leave occurs the framework generates a Symbian Leave code.

IMPORT_C void CAknForm::HandleControlStateChangeL TInt  aControlId  )  [protected, virtual]
 

Overridden, so that the form can tell if a line's state has changed.

This is used to decide when to save changes. If a leave occurs the framework generates a Symbian Leave code.

Parameters:
aControlId.  Control id.

Reimplemented from CEikDialog.

IMPORT_C void CAknForm::HandlePointerEventL const TPointerEvent &  aPointerEvent  ) 
 

From CCoeControl.

Handles pointer events

Parameters:
aPointerEvent  The pointer event.

Reimplemented from CAknDialog.

IMPORT_C void CAknForm::HandleResourceChange TInt  aType  )  [virtual]
 

Function from CCoeControl handles a change to the control's resources of type aType which are shared across the environment, e.g.

colors or fonts.

Parameters:
aType.  A message UID value.

Reimplemented from CEikDialog.

virtual IMPORT_C TBool CAknForm::OkToExitL TInt  aButtonId  )  [protected, virtual]
 

Function from CEikDialog.

Called by framework when the softkey is pressed. Use this to pop up the options menu or close the dialog. Will call [email protected] SaveFormDataL() before closing if data has been edited. Will NOT permit exit if attempt to save data fails. If a leave occurs the framework generates a Symbian Leave code.

Parameters:
aButtonId  Translates the button presses into commands ID.
Returns:
ETrue if the dialog should exit, and EFalse if it should not.

Reimplemented from CAknDialog.

IMPORT_C void CAknForm::PostLayoutDynInitL  )  [protected, virtual]
 

Function from CEikdialog.

This function is called by the EIKON dialog framework just before the dialog is activated, after it has called PreLayoutDynInitL() and the dialog has been sized. If a leave occurs the framework generates a Symbian Leave code.

Reimplemented from CEikDialog.

virtual IMPORT_C void CAknForm::PrepareForFocusTransitionL  )  [protected, virtual]
 

Function from CEikDialog and thence from [email protected] MEikDialogPageObserver.

This funtion should be implemented to prepare for focus transition from the current line. If deleting then this routine must not do anything (the default tries to access the control which has just been deleted). If a leave occurs the framework generates a Symbian Leave code.

Reimplemented from CEikDialog.

virtual IMPORT_C void CAknForm::ProcessCommandL TInt  aCommandId  )  [virtual]
 

Function from MEikCommandObserver.

Handle user menu commands. If a leave occurs the framework generates a Symbian Leave code.

Parameters:
aCommandId  The command identifier to process.

Reimplemented from CAknDialog.

virtual IMPORT_C TBool CAknForm::QuerySaveChangesL  )  [protected, virtual]
 

This routine may be overridden.

Default displays 'Save Changes Dialog Yes/No'. Data validation may occur here as an alternative to overriding OkToExit(). Re-implementation may put data validation here (as an alternative to over-riding OkToExit() - which is a more complicated method). Note that this routine does not perform the changes itself. If the leave occurs the framework generates a Symbian Leave code.

Returns:
ETrue if changes are requested to be saved and then are successfully saved. Save of data is not performed here but in SaveFormDataL().
virtual IMPORT_C TBool CAknForm::SaveFormDataL  )  [protected, virtual]
 

This routine should be re-implemented by the client to save the contents of the form.

The re-implementation can call this function to display the 'Saved' dialog CAknForm::SaveFormDataL().

Returns:
ETrue if the editable state can be left. The return value should reflect whether or not the form is to leave the editable state. A real system problem saving should generate a Symbian Leave code.
IMPORT_C void CAknForm::SetChangesPending TBool  aChangesPending  )  [protected]
 

Sets changes pending.

Parameters:
aChangesPending  ETrue if changes are pending. Else .
IMPORT_C void CAknForm::SetFormFlag TFlags  aFlagPattern,
TBool  aSetTheFlag
[protected]
 

Set the form flag indicated.

Parameters:
aFlagPattern  Pattern of bits to set or clear.
aSetTheFlag  If ETrue, sets the pattern; if EFalse, clear the pattern.
IMPORT_C void CAknForm::SetInitialCurrentLine  )  [protected, virtual]
 

This is added, so that anyone adding lines either in PreLayoutDynInit() or SetInitialCurrentLine() should have the lines in a consistent state.

Reimplemented from CEikDialog.

IMPORT_C TBool CAknForm::UnsavedEdit  )  const [protected]
 

Required by OkToExit().

Returns:
ETrue if unsave editing, and EFalse if it should not.

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

Copyright © Nokia Corporation 2001-2008
Back to top