CEikCbaButton Class Reference

Link against: avkon.lib eikcoctl.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 previous 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.
TBool IsEmptyText () const
 Checks if text is empty in this button.
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 SetPressedDown (const TBool aPressedDown)
 Changes the state of CEikCbaButton.
void SetTextBitmapMode (TBool aEnableBitmap)
 Enables bitmap mode and hides the label.
void DrawToContext (CBitmapContext &aContext, CBitmapContext &aMaskContext, const TPoint &aOffset) const
 Draws the button text and mask to give graphics contexts.
TPtrC GetFullLabelText ()
 Returns the textual value of the button.

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< KMaxCbaLabelLengthiFullLabelText
TPtrC iLongLabelText
TPtrC iShortLabelText
CEikLabeliLabel
CDesCArray * iText
CArrayFix< SButtonOptions > * iButtonOptions
CEikImageiImage
const CFbsBitmap * iMask
 Original mask for softkey image.
CFbsBitmap * iSfeMask
 Feedback effects transparency mask for softkey image.
TBool iDoImage
TBool iUseTextBitmap
 ETrue if should use text bitmap mode.
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.
void CEikCbaButton::DrawToContext CBitmapContext &  aContext,
CBitmapContext &  aMaskContext,
const TPoint &  aOffset
const
 

Draws the button text and mask to give graphics contexts.

Background is not drawn.

TPtrC CEikCbaButton::GetFullLabelText  )  [inline]
 

Returns the textual value of the button.

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::IsEmptyText  )  const
 

Checks if text is empty in this button.

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 previous 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::SetPressedDown const TBool  aPressedDown  ) 
 

Changes the state of CEikCbaButton.

Button's state is stored in a member variable.

Parameters:
aPressedDown The state that button has. ETrue if button's state is pressed down. EFalse for normal, not pressed state.
void CEikCbaButton::SetTextBitmapMode TBool  aEnableBitmap  ) 
 

Enables bitmap mode and hides the label.

The text is drawn by CEikCba in bitmap mode.

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]
 
CDesCArray* CEikCbaButton::iText [protected]
 
TBool CEikCbaButton::iUseTextBitmap [protected]
 

ETrue if should use text bitmap mode.


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

Copyright © Nokia Corporation 2001-2007
Back to top