CEikCbaButton Class Reference

API published in: S60 1st Ed

Link against: eikcoctl.lib avkon.lib

Capability Information

Required Capabilities

None


#include <eikcba.h>

Inherits CAknControl.

Inherited by CEikEnhancedCbaButton.


Detailed Description

EIKON CBA button class definition.

Public Member Functions

  ~CEikCbaButton ()
  Destructor.
void  ConstructL (TGulAlignmentValue aAlignment)
  Constructs a new CBA button instance.
void  AddCommandL (const TDesC &aText)
  Updates the label text with the given label.
void  PushCommandL (TInt aCommandId, const TDesC &aText)
  Pushes a command into button stack.
TInt  PopCommand ()
  Pops a command from the button stack.
void  RemoveCommand (TInt aCommandId)
  Removes a command from the button stack.
void  RemovePreviousCommand ()
  Removes the previos command from the button stack.
void  SwitchToShortTextL (TBool aShortText)
  Switches the button's text to short or long depending on the parameter given.
void  SetLabelFont (const CFont *aLabelFont)
  Sets the labels font.
void  TruncateLabelText ()
  Truncates the label.
void  SetContainerWindowL (const CCoeControl &aContainer)
  From CCoeControl.
void  ConstructFromResourceL (TResourceReader &aReader, TGulAlignmentValue anAlignment)
  Constructs the control from a resource file.
TSize  MinimumSize ()
  From CCoeControl.
void  SetDimmed (TBool aDimmed)
  From CCoeControl.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.
void  SetImage (CEikImage &aImage)
  Sets the button's image.
void  ReplaceImageByLabel ()
  Replaces the buttons image with label.
TBool  IsImageOn () const
  Returns whether the button has image set.
void  ConstructEmptyButtonL ()
  Constructs empty button with id EAknSoftkeyEmpty.
TBool  PressedDown () const
  Returns the state of CEikCbaButton.
void  SetPressedDownL (const TBool aPressedDown)
  Changes the state of CEikCbaButton.

Protected Member Functions

TInt  IndexFromCommandId (TInt aCommandId)
  Returns the button's index by command id.
void  UpdateLabelText (TPtrC aLabelText)
  Updates the label text with the given label.

Protected Attributes

TBuf< KMaxCbaLabelLength iFullLabelText
TPtrC  iLongLabelText
TPtrC  iShortLabelText
CEikLabel iLabel
CDesCArray *  iText
CArrayFix< SButtonOptions > *  iButtonOptions
CEikImage iImage
const CFbsBitmap *  iMask
  Original mask for softkey image.
CFbsBitmap *  iSfeMask
  Feedback effects transparency mask for softkey image.
TBool  iDoImage
TInt  iSpare
TBool  iPressedDown
  Buttons state.

Data Structures

struct   SButtonOptions
  Holds information about command id and dimming status for a button. More...

Constructor & Destructor Documentation

CEikCbaButton::~CEikCbaButton  ) 
 

Destructor.


Member Function Documentation

void CEikCbaButton::AddCommandL const TDesC &  aText  ) 
 

Updates the label text with the given label.

Parameters:
aText  The new label text.
void CEikCbaButton::ConstructEmptyButtonL  ) 
 

Constructs empty button with id EAknSoftkeyEmpty.

Reimplemented in CEikEnhancedCbaButton.

void CEikCbaButton::ConstructFromResourceL TResourceReader &  aReader,
TGulAlignmentValue  anAlignment
 

Constructs the control from a resource file.

Parameters:
aReader  The resource reader.
anAlignment  Alignment for label.
void CEikCbaButton::ConstructL TGulAlignmentValue  aAlignment  ) 
 

Constructs a new CBA button instance.

Parameters:
aAlignment  Alignment for label.
IMPORT_C void CEikCbaButton::HandlePointerEventL const TPointerEvent &  aPointerEvent  ) 
 

From CCoeControl.

Handles pointer events.

Parameters:
aPointerEvent  The pointer event.
TInt CEikCbaButton::IndexFromCommandId TInt  aCommandId  )  [protected]
 

Returns the button's index by command id.

Parameters:
aCommandId  The button's command id.
Returns:
The button's index.
TBool CEikCbaButton::IsImageOn  )  const [inline]
 

Returns whether the button has image set.

Returns:
ETrue if the button has image set, EFalse otherwise.
TSize CEikCbaButton::MinimumSize  ) 
 

From CCoeControl.

Sets the control's minimum required size.

Returns:
The minimum size required by the control.
TInt CEikCbaButton::PopCommand  ) 
 

Pops a command from the button stack.

Returns:
The button's command id. KErrNotFound if the button stack is empty.
TBool CEikCbaButton::PressedDown  )  const
 

Returns the state of CEikCbaButton.

Returns:
Boolean value for CEikCbaButtons state. ETrue if button is pressed down. Otherwise returns EFalse.
void CEikCbaButton::PushCommandL TInt  aCommandId,
const TDesC &  aText
 

Pushes a command into button stack.

Parameters:
aCommandId  The command to be pushed.
aText  Text for the button.
void CEikCbaButton::RemoveCommand TInt  aCommandId  ) 
 

Removes a command from the button stack.

Parameters:
aCommandId  The command to be removed.
void CEikCbaButton::RemovePreviousCommand  ) 
 

Removes the previos command from the button stack.

void CEikCbaButton::ReplaceImageByLabel  ) 
 

Replaces the buttons image with label.

void CEikCbaButton::SetContainerWindowL const CCoeControl &  aContainer  ) 
 

From CCoeControl.

Sets the control's containing window by copying it from aContainer.

Parameters:
aContainer  The compound control that is the container for this control.
void CEikCbaButton::SetDimmed TBool  aDimmed  ) 
 

From CCoeControl.

Sets the control to be dimmed.

Parameters:
aDimmed  ETrue to dim the control, EFalse to set the control as not dimmed.
void CEikCbaButton::SetImage CEikImage aImage  ) 
 

Sets the button's image.

Parameters:
aImage  The image to be set.
void CEikCbaButton::SetLabelFont const CFont *  aLabelFont  ) 
 

Sets the labels font.

Parameters:
aLabelFont  The font to be used.
void CEikCbaButton::SetPressedDownL const TBool  aPressedDown  ) 
 

Changes the state of CEikCbaButton.

Buttons state is stored in a member variable.

Parameters:
aPressedDown  The state that button has. ETrue if buttons state is pressed down. EFalse for normal, not pressed, state.
void CEikCbaButton::SwitchToShortTextL TBool  aShortText  ) 
 

Switches the button's text to short or long depending on the parameter given.

Parameters:
aShortText  ETrue for short text, EFalse for the long text.
void CEikCbaButton::TruncateLabelText  ) 
 

Truncates the label.

This is done by CEikLabel.

void CEikCbaButton::UpdateLabelText TPtrC  aLabelText  )  [protected]
 

Updates the label text with the given label.

Parameters:
aText  The new label text.

Field Documentation

CArrayFix<SButtonOptions>* CEikCbaButton::iButtonOptions [protected]
 
TBool CEikCbaButton::iDoImage [protected]
 
TBuf<KMaxCbaLabelLength> CEikCbaButton::iFullLabelText [protected]
 
CEikImage* CEikCbaButton::iImage [protected]
 
CEikLabel* CEikCbaButton::iLabel [protected]
 
TPtrC CEikCbaButton::iLongLabelText [protected]
 
const CFbsBitmap* CEikCbaButton::iMask [protected]
 

Original mask for softkey image.

TBool CEikCbaButton::iPressedDown [protected]
 

Buttons state.

CFbsBitmap* CEikCbaButton::iSfeMask [protected]
 

Feedback effects transparency mask for softkey image.

TPtrC CEikCbaButton::iShortLabelText [protected]
 
TInt CEikCbaButton::iSpare [protected]
 

Reimplemented from CAknControl.

CDesCArray* CEikCbaButton::iText [protected]
 

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

Copyright © Nokia Corporation 2001-2008
Back to top