CAknToolbarExtension Class Reference

Link against: eikcoctl.lib


#include <akntoolbarextension.h>

Inherits CAknButton.


Detailed Description

Toolbar extension.

Toolbar extension component. Opens an extension view when this extension is pressed.

Dll eikcoctl
Since:
S60 v5.0

Public Member Functions

  ~CAknToolbarExtension ()
  Destructor.
void  ConstructFromResourceL (TResourceReader &aReader)
  From CAknButton constructs the extension from resource.
TKeyResponse  OfferKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType)
  From CCoeControl.
void  HandleResourceChange (TInt aType)
  From CCoeControl Handles resource changes.
void  MakeVisible (TBool aVisible)
  From CCoeControl.
void  HandleControlEventL (CCoeControl *aControl, TCoeEvent aEventType)
  From MCoeControlObserver.
TInt  ExtensionPosition ()
  Using this the extension view can get extension position in fixed toolbar.
void  ShowViewViaIdle ()
  Creates idle if it does not exist yet and calls it by giving a callback for notifying when ready to draw extension view.
void  ViewClosed ()
  Extension view tells extension to change state using this method.
IMPORT_C CCoeControl *  ControlOrNull (TInt aCommandId) const
  Gets a pointer to the specified control.
IMPORT_C void  AddItemL (CCoeControl *aItem, TInt aType, TInt aCommandId, TInt aFlags, TInt aIndex)
  Adds one item to the specified place.
IMPORT_C void  RemoveItemL (TInt aCommandId)
  Removes one item from the extension view.
TInt  ExtensionFlags ()
  Gets extension flags.
IMPORT_C TBool  IsShown () const
  Returns boolean indicating if extension view is shown.
IMPORT_C void  SetShown (TBool aShown)
  Shows or hides extension view.
CCoeControl *  ExtensionView ()
  Returns pointer to extension view.
IMPORT_C void  SetItemDimmed (TInt aCommandId, TBool aDimmed)
  Sets item dimmed or undimmed.
IMPORT_C void  HideItemL (TInt aCommandId, TBool aHide)
  Hides or unhides item.

Static Public Member Functions

static CAknToolbarExtension NewL ()
  Creates toolbar extension.
static IMPORT_C CAknToolbarExtension NewL (TInt aResourceId)
  Creates toolbar extension.
static IMPORT_C CAknToolbarExtension NewLC (TInt aResourceId)
  Creates toolbar extension.
static TInt  ShowView (TAny *aThis)
  Callback to get notified when ready to show extension view again.

Constructor & Destructor Documentation

CAknToolbarExtension::~CAknToolbarExtension  ) 
 

Destructor.


Member Function Documentation

IMPORT_C void CAknToolbarExtension::AddItemL CCoeControl *  aItem,
TInt  aType,
TInt  aCommandId,
TInt  aFlags,
TInt  aIndex
 

Adds one item to the specified place.

Takes ownership. Leaves with value KErrNotSupported, if called when extension view is shown and with KErrArgument if aItem does not exist or aIndex is out of bound.

Parameters:
aItem  The control.
aType  The type of the new toolbar item.
aCommandId  The command ID for this item.
aFlags  The flags.
aIndex  The index in array at which item should be added.
void CAknToolbarExtension::ConstructFromResourceL TResourceReader &  aReader  ) 
 

From CAknButton constructs the extension from resource.

Parameters:
aReader  resource reader

Reimplemented from CAknButton.

IMPORT_C CCoeControl* CAknToolbarExtension::ControlOrNull TInt  aCommandId  )  const
 

Gets a pointer to the specified control.

Parameters:
aControlId  The ID of the control for which a pointer is required.
Returns:
Pointer to the control with the specified ID.
TInt CAknToolbarExtension::ExtensionFlags  ) 
 

Gets extension flags.

Returns:
extension flags
TInt CAknToolbarExtension::ExtensionPosition  ) 
 

Using this the extension view can get extension position in fixed toolbar.

Returns:
index of the position
CCoeControl* CAknToolbarExtension::ExtensionView  ) 
 

Returns pointer to extension view.

Returns:
pointer to extension view
void CAknToolbarExtension::HandleControlEventL CCoeControl *  aControl,
TCoeEvent  aEventType
 

From MCoeControlObserver.

Here the events from the extension itself and extension view components are handled

Parameters:
aControl  control that sent this event
aEventType  type of the event
void CAknToolbarExtension::HandleResourceChange TInt  aType  ) 
 

From CCoeControl Handles resource changes.

Parameters:
aType  the type of the resource change

Reimplemented from CAknButton.

IMPORT_C void CAknToolbarExtension::HideItemL TInt  aCommandId,
TBool  aHide
 

Hides or unhides item.

Leaves with value KErrNotSupported if called when extension view is shown.

Parameters:
aCommandId  command id of the item to be hidden/unhidden
aHide  to hide or unhide
IMPORT_C TBool CAknToolbarExtension::IsShown  )  const
 

Returns boolean indicating if extension view is shown.

Returns:
ETrue if shown, EFalse if not
void CAknToolbarExtension::MakeVisible TBool  aVisible  ) 
 

From CCoeControl.

Makes extension and extension view visible or hides them

Parameters:
aVisible  boolean to tell if showing or hiding

Reimplemented from CAknButton.

static IMPORT_C CAknToolbarExtension* CAknToolbarExtension::NewL TInt  aResourceId  )  [static]
 

Creates toolbar extension.

Parameters:
aResourceid  The ID for this component's resource
Returns:
extension

Reimplemented from CAknButton.

static CAknToolbarExtension* CAknToolbarExtension::NewL  )  [static]
 

Creates toolbar extension.

Returns:
extension

Reimplemented from CAknButton.

static IMPORT_C CAknToolbarExtension* CAknToolbarExtension::NewLC TInt  aResourceId  )  [static]
 

Creates toolbar extension.

Parameters:
aResourceid  The ID for this component's resource
Returns:
extension

Reimplemented from CAknButton.

TKeyResponse CAknToolbarExtension::OfferKeyEventL const TKeyEvent &  aKeyEvent,
TEventCode  aType
 

From CCoeControl.

Parameters:
aKeyEvent  information about the key event
aType  type of the key event
Returns:
boolean indicating if key event was consumed or not

Reimplemented from CAknButton.

IMPORT_C void CAknToolbarExtension::RemoveItemL TInt  aCommandId  ) 
 

Removes one item from the extension view.

Leaves with value KErrNotSupported if called when extension view is shown.

Parameters:
aCommandId  The ID of the item which should be removed.
IMPORT_C void CAknToolbarExtension::SetItemDimmed TInt  aCommandId,
TBool  aDimmed
 

Sets item dimmed or undimmed.

Parameters:
aCommandId  command id of the item to be dimmed/undimmed
aDimmed  to dim or undim
IMPORT_C void CAknToolbarExtension::SetShown TBool  aShown  ) 
 

Shows or hides extension view.

Parameters:
aShown  to show or to hide
static TInt CAknToolbarExtension::ShowView TAny *  aThis  )  [static]
 

Callback to get notified when ready to show extension view again.

Parameters:
aThis  pointer to this object
Returns:
error code
void CAknToolbarExtension::ShowViewViaIdle  ) 
 

Creates idle if it does not exist yet and calls it by giving a callback for notifying when ready to draw extension view.

void CAknToolbarExtension::ViewClosed  ) 
 

Extension view tells extension to change state using this method.

This is used when tapping outside extension view.


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

Copyright © Nokia Corporation 2001-2007
Back to top