CEikTwoPictureCommandButton Class Reference

API published in: S60 1st Ed

Link against: eikcoctl.lib avkon.lib

Capability Information

Required Capabilities

None


#include <eikcmbut.h>

Inherits CEikCommandButtonBase.


Detailed Description

The CEikTwoPictureCommandButton class is a command button which can hold two pictures as well as label text.

If a second picture is set for the button it is shown when the button is pressed.


Public Types

enum   TLayout { ETextRightPictureLeft = 0x000, ETextBottomPictureTop = 0x001, ETextTopPictureBottom = 0x002, ETextLeftPictureRight = 0x003 }
  Layout options for the Two Picture botton. More...
enum   TExcess { EShare = 0x0000, EToText = 0x0010, EToPicture = 0x0020 }
  Where to put the excess space when laying out the bitmaps or text. More...
enum   TDisplayContent { ETextOnly = 0x0100, EPictureOnly = 0x0200, ETextAndPicture = 0x0300 }
  Content to display for the text. More...

Public Member Functions

IMPORT_C  CEikTwoPictureCommandButton ()
  Two picture command button constructor.
IMPORT_C  ~CEikTwoPictureCommandButton ()
  Two picture command button C++ destructor.
IMPORT_C TBool  IsSecondPictureOwnedExternally ()
  Accesses ownership of the second picture' bitmap and mask (if present).
IMPORT_C CEikImage Picture () const
  Access the picture image.
IMPORT_C void  ConstructImagesFromResourceL (TResourceReader &aReader, TWhichComponent aWhich)
  Constructs the two images from resource.
IMPORT_C void  SetTextL (const TDesC &aText)
  Sets the label text on the button.
IMPORT_C void  SetTwoPicturesL (const CFbsBitmap *aMain, const CFbsBitmap *aMask=NULL, const CFbsBitmap *aSecondMain=NULL, const CFbsBitmap *aSecondMask=NULL)
  Sets the bitmap and optional mask for the button's two pictures.
IMPORT_C void  SetSecondPicture (const CFbsBitmap *aSecondMain, const CFbsBitmap *aSecondMask=NULL)
  Sets the bitmap and optional mask for the button's second picture.
IMPORT_C void  SetPictureFromFileL (const TDesC &aFilename, TInt aMain, TInt aMask=-1)
  Sets the bitmap and optional mask for the first picture from an mbm file.
IMPORT_C void  SetSecondPictureFromFileL (const TDesC &aFilename, TInt aMain, TInt aMask=-1)
  Sets the bitmap and optional mask for the second picture from an mbm file.
IMPORT_C void  SetSecondPictureOwnedExternally (TBool aOwnership)
  Sets the ownership of the second picture object.
IMPORT_C void  ConstructFromResourceL (TResourceReader &aReader)
  From CCoeControl.
IMPORT_C void  ActivateL ()
  From CCoeControl.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.

Protected Member Functions

IMPORT_C void  WriteInternalStateL (RWriteStream &aWriteStream) const
  From CCoeControl.

Member Enumeration Documentation

enum CEikTwoPictureCommandButton::TDisplayContent
 

Content to display for the text.

Enumerator:
ETextOnly 
EPictureOnly 
ETextAndPicture 

Reimplemented from CEikCommandButtonBase.

enum CEikTwoPictureCommandButton::TExcess
 

Where to put the excess space when laying out the bitmaps or text.

Enumerator:
EShare 
EToText 
EToPicture 

Reimplemented from CEikCommandButtonBase.

enum CEikTwoPictureCommandButton::TLayout
 

Layout options for the Two Picture botton.

Enumerator:
ETextRightPictureLeft 
ETextBottomPictureTop 
ETextTopPictureBottom 
ETextLeftPictureRight 

Reimplemented from CEikCommandButtonBase.


Constructor & Destructor Documentation

IMPORT_C CEikTwoPictureCommandButton::CEikTwoPictureCommandButton  ) 
 

Two picture command button constructor.

IMPORT_C CEikTwoPictureCommandButton::~CEikTwoPictureCommandButton  ) 
 

Two picture command button C++ destructor.


Member Function Documentation

IMPORT_C void CEikTwoPictureCommandButton::ActivateL  ) 
 

From CCoeControl.

Make the control ready for display

Reimplemented from CEikCommandButtonBase.

IMPORT_C void CEikTwoPictureCommandButton::ConstructFromResourceL TResourceReader &  aReader  ) 
 

From CCoeControl.

Parameters:
aReader  Fully constructed resource reader
IMPORT_C void CEikTwoPictureCommandButton::ConstructImagesFromResourceL TResourceReader &  aReader,
TWhichComponent  aWhich
 

Constructs the two images from resource.

Parameters:
aReader  Constructed resource reader.
aWhich  Which picture to be constructing
IMPORT_C void CEikTwoPictureCommandButton::HandlePointerEventL const TPointerEvent &  aPointerEvent  ) 
 

From CCoeControl.

Handle a pointer event coming from the CONE framework

Parameters:
aPointerEvent  Event to handle

Reimplemented from CEikCommandButtonBase.

IMPORT_C TBool CEikTwoPictureCommandButton::IsSecondPictureOwnedExternally  ) 
 

Accesses ownership of the second picture' bitmap and mask (if present).

Returns:
EFalse iff and if the second picture is not owned externally
IMPORT_C CEikImage* CEikTwoPictureCommandButton::Picture  )  const
 

Access the picture image.

Returns:
The picture as a CEikImage. No ownership transferred.
IMPORT_C void CEikTwoPictureCommandButton::SetPictureFromFileL const TDesC &  aFilename,
TInt  aMain,
TInt  aMask = -1
 

Sets the bitmap and optional mask for the first picture 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
IMPORT_C void CEikTwoPictureCommandButton::SetSecondPicture const CFbsBitmap *  aSecondMain,
const CFbsBitmap *  aSecondMask = NULL
 

Sets the bitmap and optional mask for the button's second picture.

Parameters:
aMain  The bitmap to use
aMask  The mask. If null, then no mask will be used
IMPORT_C void CEikTwoPictureCommandButton::SetSecondPictureFromFileL const TDesC &  aFilename,
TInt  aMain,
TInt  aMask = -1
 

Sets the bitmap and optional mask for the second picture 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
IMPORT_C void CEikTwoPictureCommandButton::SetSecondPictureOwnedExternally TBool  aOwnership  ) 
 

Sets the ownership of the second picture object.

Parameters:
aOwnership  Set to EFalse if bitmaps associated with the object are owned by the button
IMPORT_C void CEikTwoPictureCommandButton::SetTextL const TDesC &  aText  ) 
 

Sets the label text on the button.

Parameters:
aText  The text to set
IMPORT_C void CEikTwoPictureCommandButton::SetTwoPicturesL const CFbsBitmap *  aMain,
const CFbsBitmap *  aMask = NULL,
const CFbsBitmap *  aSecondMain = NULL,
const CFbsBitmap *  aSecondMask = NULL
 

Sets the bitmap and optional mask for the button's two pictures.

Optionally, only the first button's picture may be set up.

Parameters:
aMain  The bitmap to use for the first picture
aMask  The mask. If null, then no mask will be used
aSecondMain  The bitmap to use for the second picture
aSecondMask  The mask. If null, then no mask will be used
IMPORT_C void CEikTwoPictureCommandButton::WriteInternalStateL RWriteStream &  aWriteStream  )  const [protected]
 

From CCoeControl.

Serialize the state of the control

Parameters:
aWriteStream  Output stream for the serialization

Reimplemented from CEikCommandButtonBase.


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

Copyright © Nokia Corporation 2001-2008
Back to top