CEikCommandButtonBase Class Reference

API published in: S60 1st Ed

Link against: eikcoctl.lib avkon.lib

Capability Information

Required Capabilities

None


#include <eikcmbut.h>

Inherits CEikButtonBase.

Inherited by CEikBitmapButton, CEikCommandButton, CEikTextButton, and CEikTwoPictureCommandButton.


Detailed Description

Base class for buttons that generate commands.

MControlContext is mixed in. This class is used as the interface to the button member of CEikLabeledButton, as well as being the base class for CEikCommandButton, CEikTextButton, and CEikBitmapButton


Public Types

enum   TWhichComponent { EFirst, ESecond }
  Enumeration to tag the components of a command button (text or image). More...
enum   TDisplayContent { EFirstOnly = 0x0100, ESecondOnly = 0x0200, EBoth = 0x0300 }
  Controls which of the components of the command button are shown. More...
enum   TLayout {
  EFirstRightSecondLeft = 0x0000, EFirstBottomSecondTop = 0x0001, EFirstTopSecondBottom = 0x0002, EFirstLeftSecondRight = 0x0003,
  EDenseFont = 0x0008
}
enum   TExcess { EShare = 0x0000, EToFirst = 0x0010, EToSecond = 0x0020 }
  Options for where excess space between the two components of the command button is distrubuted. More...

Public Member Functions

IMPORT_C  ~CEikCommandButtonBase ()
  C++ destructor.
IMPORT_C void  SetButtonLayout (TLayout aLayout)
  Sets the layout of the button.
IMPORT_C void  SetExcessSpace (TExcess aExcess)
  Sets where excess space is to be put.
IMPORT_C void  SetDisplayContent (TDisplayContent aContent)
  Sets the content of the button.
IMPORT_C void  LayoutComponents ()
  Causes the content to be (re-)laid out.
IMPORT_C void  StartConstructFromResourceL (TResourceReader &aReader)
  Read preamble part of the resource.
IMPORT_C void  ConstructLabelFromResourceL (TResourceReader &aReader, TWhichComponent aWhich)
  Constructs a label component for the button.
IMPORT_C void  ConstructImageFromResourceL (TResourceReader &aReader, TWhichComponent aWhich)
  Constructs an image component for the button.
virtual IMPORT_C void  UpdateComponentAlignment ()
  Cause a recalculation of the components alignment.
IMPORT_C void  SetDefault (TBool aIsDefault)
  Sets this button to be the default.
IMPORT_C void  SetDimmed (TBool aDimmed)
  From CCoeControl.
IMPORT_C TSize  MinimumSize ()
  From CCoeControl.
IMPORT_C TInt  CountComponentControls () const
  From CCoeControl.
IMPORT_C CCoeControl *  ComponentControl (TInt aIndex) const
  From CCoeControl.
IMPORT_C void  ActivateL ()
  From CCoeControl.
IMPORT_C void  SetContainerWindowL (const CCoeControl &aContainer)
  From CCoeControl.
IMPORT_C void  FocusChanged (TDrawNow aDrawNow)
  From CCoeControl.
IMPORT_C TKeyResponse  OfferKeyEventL (const TKeyEvent &aKeyEvent, TEventCode)
  From CCoeControl.
virtual IMPORT_C void  GetColorUseListL (CArrayFix< TCoeColorUse > &aColorUseList) const
  From CCoeControl.
virtual IMPORT_C void  HandleResourceChange (TInt aType)
  From CCoeControl.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.
CEikCommandStack *  CommandStack () const
  Access to the command stack.
TInt  ButFlags () const
  Access to the button flags.
TBool  IsDefault () const
  Access to whether the button is default.

Protected Member Functions

IMPORT_C void  StateChanged ()
  From CEikButtonBase.
IMPORT_C  CEikCommandButtonBase ()
  Constructor.
IMPORT_C void  SetTextL (const TDesC &aText, CEikAlignedControl *&aComponent)
  Sets the label text for the button.
IMPORT_C void  SetPictureL (const CFbsBitmap *aMain, const CFbsBitmap *aMask, CEikAlignedControl *&aComponent)
  Sets the bitmap and optional mask for the button.
IMPORT_C void  SetPictureFromFileL (const TDesC &aFilename, TInt aMain, TInt aMask, CEikAlignedControl *&aComponent)
  Sets the bitmap and optional mask from an mbm file.
void  CheckCreateCommandStackL ()
  Utility routine.
IMPORT_C void  Draw (const TRect &aRect) const
  From CCoeControl.
void  SetImageAttributes (CEikImage *aImage)
  Utility routine.
TInt  Behavior () const
  Access the behaviour set into the button.
IMPORT_C void  WriteInternalStateL (RWriteStream &aWriteStream) const
  From CCoeControl.

Protected Attributes

TMargins8  iMargins
CEikAlignedControl iComponents [2]
  The components of the button: the image or the text (order determined by construction).
TInt  iCmdFlags

Member Enumeration Documentation

enum CEikCommandButtonBase::TDisplayContent
 

Controls which of the components of the command button are shown.

Enumerator:
EFirstOnly 
ESecondOnly 
EBoth 

Reimplemented in CEikCommandButton, and CEikTwoPictureCommandButton.

enum CEikCommandButtonBase::TExcess
 

Options for where excess space between the two components of the command button is distrubuted.

Enumerator:
EShare 
EToFirst 
EToSecond 

Reimplemented in CEikCommandButton, and CEikTwoPictureCommandButton.

enum CEikCommandButtonBase::TLayout
 
Enumerator:
EFirstRightSecondLeft 
EFirstBottomSecondTop 
EFirstTopSecondBottom 
EFirstLeftSecondRight 
EDenseFont 

Reimplemented in CEikCommandButton, and CEikTwoPictureCommandButton.

enum CEikCommandButtonBase::TWhichComponent
 

Enumeration to tag the components of a command button (text or image).

Enumerator:
EFirst 
ESecond 

Constructor & Destructor Documentation

IMPORT_C CEikCommandButtonBase::~CEikCommandButtonBase  ) 
 

C++ destructor.

IMPORT_C CEikCommandButtonBase::CEikCommandButtonBase  )  [protected]
 

Constructor.


Member Function Documentation

IMPORT_C void CEikCommandButtonBase::ActivateL  ) 
 

From CCoeControl.

Make the control ready for display.

Reimplemented in CEikTwoPictureCommandButton.

TInt CEikCommandButtonBase::Behavior  )  const [inline, protected]
 

Access the behaviour set into the button.

TInt CEikCommandButtonBase::ButFlags  )  const
 

Access to the button flags.

Returns:
The button flag pattern
void CEikCommandButtonBase::CheckCreateCommandStackL  )  [inline, protected]
 

Utility routine.

Calling this without a leave will ensure the internal command stack is constructed.

CEikCommandStack* CEikCommandButtonBase::CommandStack  )  const
 

Access to the command stack.

Returns:
pointer to the command stack
IMPORT_C CCoeControl* CEikCommandButtonBase::ComponentControl TInt  aIndex  )  const
 

From CCoeControl.

Return a pointer to the component control at the give index.

Returns:
Pointer to the conponent control. No ownership is transferred
IMPORT_C void CEikCommandButtonBase::ConstructImageFromResourceL TResourceReader &  aReader,
TWhichComponent  aWhich
 

Constructs an image component for the button.

aWhich Which component to construct in this call

IMPORT_C void CEikCommandButtonBase::ConstructLabelFromResourceL TResourceReader &  aReader,
TWhichComponent  aWhich
 

Constructs a label component for the button.

aWhich Which component to construct in this call

IMPORT_C TInt CEikCommandButtonBase::CountComponentControls  )  const
 

From CCoeControl.

Returns the number of component controls

Returns:
Number of component controls
IMPORT_C void CEikCommandButtonBase::Draw const TRect &  aRect  )  const [protected]
 

From CCoeControl.

Request for the control to draw itself within the given rectangle

Parameters:
aRect  TRect to draw

Reimplemented from CEikBorderedControl.

IMPORT_C void CEikCommandButtonBase::FocusChanged TDrawNow  aDrawNow  ) 
 

From CCoeControl.

Called when the focus has changed

Parameters:
aDrawNow  Iff not EFalse, then the control is requested to redraw.
virtual IMPORT_C void CEikCommandButtonBase::GetColorUseListL CArrayFix< TCoeColorUse > &  aColorUseList  )  const [virtual]
 

From CCoeControl.

Obtain the list of colors to be used by this control

Parameters:
aColorUseList 

Reimplemented from CEikButtonBase.

IMPORT_C void CEikCommandButtonBase::HandlePointerEventL const TPointerEvent &  aPointerEvent  ) 
 

From CCoeControl.

Handle a pointer event that has been routed to this control

Parameters:
aPointerEvent  Pointer event to handle

Reimplemented from CEikButtonBase.

Reimplemented in CEikCommandButton, CEikTwoPictureCommandButton, CEikInverterCommandButton, CEikTextButton, CEikBitmapButton, and CEikMenuButton.

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

From CCoeControl.

This is called when resource or layout or other display-affecting setting has changed. Change the internals of the control so that it is ready for a subsequent SizeChanged call.

Parameters:
aType  Type of resource or setting that has changed

Reimplemented from CEikButtonBase.

TBool CEikCommandButtonBase::IsDefault  )  const
 

Access to whether the button is default.

Returns:
EFalse iff the button is not default.
IMPORT_C void CEikCommandButtonBase::LayoutComponents  ) 
 

Causes the content to be (re-)laid out.

IMPORT_C TSize CEikCommandButtonBase::MinimumSize  ) 
 

From CCoeControl.

Reports to the caller the minimum size that the control can be, given its contents.

Returns:
The minimum size
IMPORT_C TKeyResponse CEikCommandButtonBase::OfferKeyEventL const TKeyEvent &  aKeyEvent,
TEventCode 
 

From CCoeControl.

CONE framework is requesting that the passed-in key be handled.

Parameters:
aKeyEvent  Wserv event type
aKeyCode  Key code

Reimplemented from CEikButtonBase.

IMPORT_C void CEikCommandButtonBase::SetButtonLayout TLayout  aLayout  ) 
 

Sets the layout of the button.

Parameters:
aLayout  Layout enumeration
IMPORT_C void CEikCommandButtonBase::SetContainerWindowL const CCoeControl &  aContainer  ) 
 

From CCoeControl.

Sets the control whose window is to be used as a container for this control

Parameters:
aContainer  control
IMPORT_C void CEikCommandButtonBase::SetDefault TBool  aIsDefault  ) 
 

Sets this button to be the default.

IMPORT_C void CEikCommandButtonBase::SetDimmed TBool  aDimmed  ) 
 

From CCoeControl.

Sets the button to be inactive. The button is drawn with a dimmed effect.

Parameters:
aDimmed  If not EFalse, set the state to dimmed. Otherwise set to non-dimmed
IMPORT_C void CEikCommandButtonBase::SetDisplayContent TDisplayContent  aContent  ) 
 

Sets the content of the button.

Parameters:
aContent 
IMPORT_C void CEikCommandButtonBase::SetExcessSpace TExcess  aExcess  ) 
 

Sets where excess space is to be put.

Parameters:
aExcess  Excess space enumeration
void CEikCommandButtonBase::SetImageAttributes CEikImage aImage  )  [protected]
 

Utility routine.

Sets additional look and feel attributes for the image

IMPORT_C void CEikCommandButtonBase::SetPictureFromFileL const TDesC &  aFilename,
TInt  aMain,
TInt  aMask,
CEikAlignedControl *&  aComponent
[protected]
 

Sets the bitmap and optional mask from an mbm file.

Parameters:
aFile  Mbm filename
aMain  Index of the bitmap to use
aMask  Index of the mask. If -1, then a null mask will be used
aComponent  The component for which the picture is to be set.
IMPORT_C void CEikCommandButtonBase::SetPictureL const CFbsBitmap *  aMain,
const CFbsBitmap *  aMask,
CEikAlignedControl *&  aComponent
[protected]
 

Sets the bitmap and optional mask for the button.

Parameters:
aMain  The bitmap to use
aMask  The mask. If null, then no mask will be used
aComponent  The component for which the picture is to be set.
IMPORT_C void CEikCommandButtonBase::SetTextL const TDesC &  aText,
CEikAlignedControl *&  aComponent
[protected]
 

Sets the label text for the button.

Parameters:
aText  The text to set
aComponent  The component for which the text is to be set.
IMPORT_C void CEikCommandButtonBase::StartConstructFromResourceL TResourceReader &  aReader  ) 
 

Read preamble part of the resource.

This call can be followed by calls to ConstructLabelFromResourceL and/or ConstructImageFromResourceL to complete contruction.

IMPORT_C void CEikCommandButtonBase::StateChanged  )  [protected, virtual]
 

From CEikButtonBase.

Framework method called when the state changes

Reimplemented from CEikButtonBase.

virtual IMPORT_C void CEikCommandButtonBase::UpdateComponentAlignment  )  [virtual]
 

Cause a recalculation of the components alignment.

Reimplemented in CEikCommandButton.

IMPORT_C void CEikCommandButtonBase::WriteInternalStateL RWriteStream &  aWriteStream  )  const [protected]
 

From CCoeControl.

Serialize the state of the control

Parameters:
aWriteStream  Output stream for the serialization

Reimplemented from CEikButtonBase.

Reimplemented in CEikTwoPictureCommandButton, CEikInverterCommandButton, and CEikMenuButton.


Field Documentation

TInt CEikCommandButtonBase::iCmdFlags [protected]
 
CEikAlignedControl* CEikCommandButtonBase::iComponents[2] [protected]
 

The components of the button: the image or the text (order determined by construction).

TMargins8 CEikCommandButtonBase::iMargins [protected]
 

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

Copyright © Nokia Corporation 2001-2008
Back to top