CEikImage Class Reference

API published in: S60 1st Ed

Link against: eikcoctl.lib

Capability Information

Required Capabilities

None


#include <eikimage.h>

Inherits CEikAlignedControl.


Detailed Description

The package class CEikImage enables bitmaps to be packaged into an image.

Two bitmaps can be packaged, one for the image itself and, optionally, another for the image’s mask.


Public Member Functions

IMPORT_C  CEikImage ()
  C++ default constructor.
IMPORT_C  ~CEikImage ()
  Destructor.
IMPORT_C TSize  MinimumSize ()
  Gets the minimum size required to draw the image.
IMPORT_C void  ConstructFromResourceL (TResourceReader &aReader)
  Constructs an image from resource using the specified resource reader.
IMPORT_C void  CreatePictureFromFileL (const TDesC &aFilename, TInt aMainId, TInt aMaskId=-1)
  Creates a bitmap and a mask for an icon.
IMPORT_C void  SetPicture (const CFbsBitmap *aBitmap, const CFbsBitmap *aMaskBitmap=NULL)
  Sets picture parameters.
IMPORT_C void  SetEmphasis (TBool aEmphasis)
  Sets emphasis.
IMPORT_C void  SetPictureOwnedExternally (TBool aOwnership)
  Sets the owner of the picture.
IMPORT_C const CFbsBitmap *  Bitmap () const
  Gets a pointer of CFbsBitmap object.
IMPORT_C const CFbsBitmap *  Mask () const
  Gets pointer of CFbsBitmap object.
IMPORT_C void  SetBitmap (const CFbsBitmap *aBitmap)
  Sets new bitmap.
IMPORT_C void  SetMask (const CFbsBitmap *aMaskBitmap)
  Sets new bitmap mask.
IMPORT_C void  SetNewBitmaps (const CFbsBitmap *aNewBitmap, const CFbsBitmap *aNewMask)
  Sets new bitmap and bitmap's mask.
IMPORT_C TBool  IsPictureOwnedExternally ()
  Checks whether picture is owned externally.
IMPORT_C void  SetBrushStyle (CGraphicsContext::TBrushStyle aBrushStyle)
  Sets the brush style.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.

Protected Member Functions

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

Constructor & Destructor Documentation

IMPORT_C CEikImage::CEikImage  ) 
 

C++ default constructor.

IMPORT_C CEikImage::~CEikImage  ) 
 

Destructor.


Member Function Documentation

IMPORT_C const CFbsBitmap* CEikImage::Bitmap  )  const
 

Gets a pointer of CFbsBitmap object.

Returns:
Pointer to handle to the bitmap or NULL.
IMPORT_C void CEikImage::ConstructFromResourceL TResourceReader &  aReader  ) 
 

Constructs an image from resource using the specified resource reader.

Parameters:
aReader  The resource reader.
IMPORT_C void CEikImage::CreatePictureFromFileL const TDesC &  aFilename,
TInt  aMainId,
TInt  aMaskId = -1
 

Creates a bitmap and a mask for an icon.

If aMaskId is not negative then function allocates bitmap and mask objects and sets member variables to point at them. These bitmaps are not ready for drawing until they are initialized with SetSize() method. Usually, UI controls do this. Note also that a single SetSize() call initializes both the bitmap and the mask.

If aMaskId is not needed and not given then this function creates the bitmap for an icon. Returned object is saved to the member variable. The bitmap is not ready for drawing until it is initialized with SetSize() method. Usually, UI controls do this.

Parameters:
aFilename  File name. Can be either MBM or MIF file. Extension is changed based on the given bitmap ID.
aMainId  Bitmap id.
aMaskId  Mask id, by default -1.
IMPORT_C void CEikImage::HandlePointerEventL const TPointerEvent &  aPointerEvent  ) 
 

From CCoeControl.

Handles pointer events.

This function gets called whenever a pointer event occurs in the control, i.e. when the pointer is within the control's extent, or when the control has grabbed the pointer. The control should implement this function to handle pointer events.

Note: events of type EButton1Down are processed before HandlePointerEventL() is called in order to transfer keyboard focus to the control in which the EButton1Down event occurred.

If overriding HandlePointerEventL(), the implementation must include a base call to CCoeControl's HandlePointerEventL().

Parameters:
aPointerEvent  The pointer event.

Reimplemented from CEikAlignedControl.

IMPORT_C TBool CEikImage::IsPictureOwnedExternally  ) 
 

Checks whether picture is owned externally.

Returns:
ETrue if picture owned externally and EFalse if not.
IMPORT_C const CFbsBitmap* CEikImage::Mask  )  const
 

Gets pointer of CFbsBitmap object.

Returns:
Pointer to handle to the bitmap's mask or NULL.
IMPORT_C TSize CEikImage::MinimumSize  ) 
 

Gets the minimum size required to draw the image.

Returns:
The minimum size required to draw the image.
IMPORT_C void CEikImage::SetBitmap const CFbsBitmap *  aBitmap  ) 
 

Sets new bitmap.

Parameters:
aBitmap  Pointer to CFbsBitmap object containing the bitmap.
IMPORT_C void CEikImage::SetBrushStyle CGraphicsContext::TBrushStyle  aBrushStyle  ) 
 

Sets the brush style.

Parameters:
aBrushStyle  A brush style.
IMPORT_C void CEikImage::SetEmphasis TBool  aEmphasis  ) 
 

Sets emphasis.

Parameters:
aEmphasis  Full emphasis if ETrue and if not then EFalse.
IMPORT_C void CEikImage::SetMask const CFbsBitmap *  aMaskBitmap  ) 
 

Sets new bitmap mask.

Parameters:
aMaskBitmap  Pointer to CFbsBitmap object containing the bitmap mask.
IMPORT_C void CEikImage::SetNewBitmaps const CFbsBitmap *  aNewBitmap,
const CFbsBitmap *  aNewMask
 

Sets new bitmap and bitmap's mask.

Parameters:
aNewBitmap  A bitmap.
aNewMask  A bitmap mask.
IMPORT_C void CEikImage::SetPicture const CFbsBitmap *  aBitmap,
const CFbsBitmap *  aMaskBitmap = NULL
 

Sets picture parameters.

Parameters:
aBitmap  A bitmap.
aMaskBitmap  A bitmap mask.
IMPORT_C void CEikImage::SetPictureOwnedExternally TBool  aOwnership  ) 
 

Sets the owner of the picture.

Parameters:
aOwnership  Etrue if owner is external and EFalse if not.
IMPORT_C void CEikImage::WriteInternalStateL RWriteStream &  aWriteStream  )  const [protected]
 

From CCoeControl.

Writes the internal state of the control and its components to a stream. Does nothing in release mode. Designed to be overidden and base called by subclasses.

Parameters:
[in,out]  aWriteStream  The pointer writestream.

Reimplemented from CEikAlignedControl.


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

Copyright © Nokia Corporation 2001-2008
Back to top