Nokia N97 SDK
Example Applications Guide

CHelpfulForm Class Reference

#include <helpfulform.h>

Inheritance diagram for CHelpfulForm:

List of all members.

Detailed Description

CHelpfulForm CHelpfulForm implements context sensitive help for itself and the controls it contains

Definition at line 27 of file helpfulform.h.


Public Member Functions

void  ProcessCommandL (TInt aCommandId)
void  GetHelpContext (TCoeHelpContext &aContext) const
void  DynInitMenuPaneL (TInt aResourceId, CEikMenuPane *aMenuPane)

Static Public Member Functions

static CHelpfulForm *  NewL (TInt aMenuResource)
static CHelpfulForm *  NewLC (TInt aMenuResource)

Private Member Functions

void  ConstructL (TInt aMenuResource)


Member Function Documentation

CHelpfulForm * CHelpfulForm::NewL (  TInt  aMenuResource  )  [static]
 

NewL() Construct a CHelpfulForm for the AVKON application using two phase construction, and return a pointer to the created object

Parameters:
aMenuResource  Resource of menu to be added to form menu (with Help option)
Returns:
A pointer to the created instance of CHelpfulForm

Definition at line 33 of file helpfulform.cpp.

References NewLC().

Referenced by CHelpExampleAppUi::HandleCommandL().

00034     {
00035     CHelpfulForm* self = NewLC( aMenuResource );
00036     CleanupStack::Pop( self );
00037     return self;
00038     }

CHelpfulForm * CHelpfulForm::NewLC (  TInt  aMenuResource  )  [static]
 

NewLC() Construct a CHelpfulForm for the AVKON application using two phase construction, and return a pointer to the created object

Parameters:
aMenuResource  Resource of menu to be added to form menu (with Help option)
Returns:
A pointer to the created instance of CHelpfulForm

Definition at line 45 of file helpfulform.cpp.

Referenced by NewL().

00046     {
00047     CHelpfulForm* self = new ( ELeave ) CHelpfulForm();
00048     CleanupStack::PushL( self );
00049     self->ConstructL( aMenuResource );
00050     return self;
00051     }

void CHelpfulForm::ProcessCommandL (  TInt  aCommandId  ) 
 

ProcessCommandL() Handle user menu commands

Parameters:
aCommandId  The command identifier to process

Definition at line 99 of file helpfulform.cpp.

00100     {
00101     switch ( aCommandId )
00102         {
00103         case ELaunchHelpForContext :
00104             // Pass it back to the AppUi to deal with
00105             iAvkonAppUi->HandleCommandL( aCommandId );
00106             break;
00107         default :
00108             break;
00109         }
00110 
00111     // Need to do this in all cases or menu does not disappear after
00112     // a selection is made
00113     CAknForm::ProcessCommandL( aCommandId );
00114     }

void CHelpfulForm::GetHelpContext (  TCoeHelpContext &  aContext  )  const
 

GetHelpContext() Identify the help context so that the framework can look up the corresponding help topic

Parameters:
aContext  Returns the help context

Definition at line 70 of file helpfulform.cpp.

00071     {
00072     // Get any special help context for the control with focus, else a default
00073     aContext.iMajor = KUidHelpFile;
00074 
00075     switch ( IdOfFocusControl() )
00076         {
00077         case EHelpExampleEdwin1:
00078             // Provide special help context if first control has focus
00079             aContext.iContext = KContextEdwin1;
00080             break;
00081 
00082         case EHelpExampleEdwin2:
00083             // Provide special help context if second control has focus
00084             aContext.iContext = KContextEdwin2;
00085             break;
00086 
00087         default:
00088             // Provide default help context for this dialog otherwise
00089             aContext.iContext = KContextHelpfulForm;
00090             break;
00091         }
00092     }

void CHelpfulForm::DynInitMenuPaneL (  TInt  aResourceId,
CEikMenuPane *  aMenuPane
) 
 

DynInitMenuPaneL() Remove the unused default form options

Parameters:
aResourceId  The id of the menu pane
aMenuPane  The menu pane itself

Definition at line 121 of file helpfulform.cpp.

00122     {
00123     CAknForm::DynInitMenuPaneL( aResourceId, aMenuPane );
00124     if ( aResourceId == R_AVKON_FORM_MENUPANE )
00125         {
00126         // Override the default form options. N/A in this case
00127         aMenuPane->SetItemDimmed( EAknFormCmdAdd, ETrue );
00128         aMenuPane->SetItemDimmed( EAknFormCmdSave, ETrue );
00129         aMenuPane->SetItemDimmed( EAknFormCmdLabel, ETrue );
00130         aMenuPane->SetItemDimmed( EAknFormCmdDelete, ETrue );
00131         }
00132     }

void CHelpfulForm::ConstructL (  TInt  aMenuResource  )  [private]
 

ConstructL() Perform the second phase construction of a CHelpfulForm object

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

Definition at line 58 of file helpfulform.cpp.

00059     {
00060     // Ensure the base class construction is complete or some of the form's
00061     // features will not work
00062     CAknForm::ConstructL( aMenuResource );
00063     }


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

© Nokia 2009

Back to top