UIQ Technology
Symbian OS Library

UIQ 3.1 SDK        UIQ developer portal

[Index] [Spacer] [Previous] [Next]



Location: EIKIMAGE.H
Link against: eikcoctl.lib

Class CEikImage

class CEikImage : public CEikAlignedControl;

Description

This class provides functions that enable you to package bitmaps into an image.

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

Derivation

Members

Defined in CEikImage:
Bitmap(), CEikImage(), ConstructFromResourceL(), Content(), CreateAnimationFromThemeL(), CreatePictureFromFileL(), CreateSkinFromThemeL(), DefaultContentObserver(), Draw(), HandlePointerEventL(), IsCropped(), IsEmphasized(), IsHighlighted(), IsPictureOwnedExternally(), IsStretchMaintainAspectRatio(), IsStretched(), MakeVisible(), Mask(), MinimumSize(), MopSupplyObject(), OfferKeyEventL(), Pause(), Play(), Reserved_2(), SetBitmap(), SetContentL(), SetContentL(), SetContentL(), SetContentObserver(), SetCropped(), SetDimmed(), SetEmphasis(), SetHighlighted(), SetMask(), SetPicture(), SetPictureOwnedExternally(), SetStretchMaintainAspectRatio(), SetStretched(), Stop(), Type(), WriteInternalStateL(), ~CEikImage()

Inherited from CBase:
Delete(), Extension_(), operator new()

Inherited from CCoeControl:
AccumulatedZoom(), ActivateGc(), BackedUpWindow(), Background(), CapturesPointer(), ClaimPointerGrab(), CloseWindow(), ComponentArrayExists(), Components(), ControlContext(), ControlEnv(), CopyControlContextFrom(), CreateBackedUpWindowL(), CreateWindowL(), DeactivateGc(), DrawBackground(), DrawDeferred(), DrawForeground(), DrawNow(), DrawableWindow(), EAbsoluteZoom, ERelativeZoom, EnableDragEvents(), FindBackground(), FindFontProvider(), GetColor(), GetGc(), GetTextDrawer(), GrabbingComponent(), HandleComponentControlsResourceChange(), HandleRedrawEvent(), HitTest(), IgnoreEventsUntilNextPointerUp(), Index(), InitComponentArrayL(), IsActivated(), IsBackedUp(), IsBeingDestroyed(), IsBlank(), IsDimmed(), IsFocused(), IsNonFocusing(), IsReadyToDraw(), IsVisible(), LayoutManager(), MaximumWidth(), MopNext(), Observer(), OverrideColorL(), OwnsWindow(), Parent(), Position(), PositionRelativeToScreen(), Rect(), RecursivelyMergedInputCapabilities(), ReportEventL(), ResetGc(), ScreenFont(), SetAllowStrayPointers(), SetBackground(), SetBlank(), SetCanDrawOutsideRect(), SetComponentsToInheritVisibility(), SetControlContext(), SetCornerAndSize(), SetExtent(), SetExtentToWholeScreen(), SetFocus(), SetFocusing(), SetFontProviderL(), SetGc(), SetGloballyCapturing(), SetHitTest(), SetMaximumWidth(), SetMopParent(), SetNonFocusing(), SetObserver(), SetPointerCapture(), SetPosition(), SetRect(), SetSize(), SetSizeWithoutNotification(), SetUniqueHandle(), SetZoomFactorL(), Size(), SystemGc(), TZoomType, TextDrawer(), UniqueHandle(), Window(), ZoomWithType(), iCoeEnv, iContext, iPosition, iSize

Inherited from CEikAlignedControl:
ActivateL(), Alignment(), ComponentControl(), CountComponentControls(), FocusChanged(), GetColorUseListL(), GetHelpContext(), HandleControlArrayEventL(), HandlePointerBufferReadyL(), HandleResourceChange(), HasBorder(), InputCapabilities(), Margins(), PositionChanged(), PrepareForFocusGainL(), PrepareForFocusLossL(), RequestRelayout(), SetAdjacent(), SetAlignment(), SetAllMarginsTo(), SetContainerWindowL(), SetLayoutManagerL(), SetNeighbor(), SetParent(), SetTextBaselineSpacing(), SizeChanged(), TextBaselineOffset(), iAlignment, iMargin

Inherited from MEikAlignedControl:
ETypeId, anonymous

Inherited from MObjectProvider:
MObjectProvider_Reserved1(), MObjectProvider_Reserved2(), MopGetObject(), MopGetObjectNoChaining()


Construction and destruction


CEikImage()

IMPORT_C CEikImage();

Description

Default constructor.


~CEikImage()

IMPORT_C ~CEikImage();

Description

Destructor.

[Top]


Member functions


MinimumSize()

virtual IMPORT_C TSize MinimumSize();

Description

Gets the minimum size required to draw the image.

Return value

TSize

The minimum size required to draw the image.


ConstructFromResourceL()

virtual IMPORT_C void ConstructFromResourceL(TResourceReader &aReader);

Description

Constructs an image from resource using the specified resource reader.

Parameters

TResourceReader &aReader

The resource reader.


CreatePictureFromFileL()

IMPORT_C void CreatePictureFromFileL(const TDesC &aFilename, TInt aMainId, TInt aMaskId=-1);

Description

Creates an image from file.

Parameters

const TDesC &aFilename

The file from which the image is created.

TInt aMainId

The ID of the bitmap to use in the image.

TInt aMaskId

The ID of the bitmap mask to use in the image. This can be the same as aMainId if you wish to use the same bitmap as both the bitmap and mask.


Content()

IMPORT_C const CQikContent &Content() const;

Description

Return value

const CQikContent &


SetContentL()

IMPORT_C void SetContentL(const CQikContent *aContent);

Description

Clones the content; ownership is not passed

Parameters

const CQikContent *aContent


SetContentL()

IMPORT_C void SetContentL(const TDesC &aUri);

Description

Creates a CEikImage based on the content that is described by the uri

Parameters

const TDesC &aUri

Loads content from a specified URI Example content might be animations, themed skins or icons, application icons or non-native bitmap formats such as PNG or JPEGs. uiq_icon:00000000?size=small|large|xlarge uiq_themed:00000000?frame=0&index=0 uiq_appicon:00000000?size=small|large|xlarge path.ext?idx=0&mask=-1 Themed content and files are interpreted as animations if the uid identifies an animation and frame is negative, or in the file case, if the file is an animation and idx is negative.


SetContentL()

IMPORT_C void SetContentL(const TDesC &aUri, const TCapabilitySet &aCapabilities, TUint aFlags);

Description

Creates a CEikImage based on the content that is described by the uri

Parameters

const TDesC &aUri

Loads content from a specified URI Example content might be animations, themed skins or icons, application icons or non-native bitmap formats such as PNG or JPEGs. uiq_icon:00000000?size=small|large|xlarge uiq_themed:00000000?frame=0&index=0 uiq_appicon:00000000?size=small|large|xlarge path.ext?idx=0&mask=-1 Themed content and files are interpreted as animations if the uid identifies an animation and frame is negative, or in the file case, if the file is an animation and idx is negative.

const TCapabilitySet &aCapabilities

Set the capabilities of this content.

TUint aFlags

Set the flags for this content.


SetContentObserver()

IMPORT_C void SetContentObserver(MQikContentObserver *aObserver);

Description

Parameters

MQikContentObserver *aObserver


DefaultContentObserver()

IMPORT_C MQikContentObserver *DefaultContentObserver();

Description

Returns the default content observer The default observer can be overriden by SetContentObserver, but an override can in turn forward events that it does not want to filter to the default observer The default observer takes the following actions whent he signalled that the content has changed: ContentChanged: Deferred Redraw ContentRequestsRedraw: Deferred Redraw ContentSizeChanged: Request Relayout

Return value

MQikContentObserver *

the default observer, or NULL if none has been initialised


CreateSkinFromThemeL()

IMPORT_C void CreateSkinFromThemeL(const TUid &aUid, TInt aFrame, TInt aMultiBitmapIndex);

Description

Creates a skin from the supplied TUid.

Parameters

const TUid &aUid

The uid of the Skin to create

TInt aFrame

The frame of the skin. A skin can contain several skin patches, this parameter chooses the one to use.

TInt aMultiBitmapIndex

The index of the multi bitmap. Each skin patch contains a bitmap, which may contain several images. The aMultiBitmapIndex points out the correct image in that bitmap. When there is only one image in the bitmap, use aMultiBitmapIndex 0.


CreateAnimationFromThemeL()

IMPORT_C void CreateAnimationFromThemeL(const TUid &aUid);

Description

Creates an animation from the supplied TUid.

Parameters

const TUid &aUid

The uid of the animation to create.


SetPicture()

IMPORT_C void SetPicture(const CFbsBitmap *aBitmap, const CFbsBitmap *aMaskBitmap=0);

Description

Sets the images bitmap and mask. Takes ownership unless the bitmaps are owned externally. The previous bitmaps are destroyed unless owned externally.

Parameters

const CFbsBitmap *aBitmap

The images bitmap.

const CFbsBitmap *aMaskBitmap

The images bitmap mask.


SetEmphasis()

IMPORT_C void SetEmphasis(TBool aEmphasis);

Description

Sets the images emphasis.

Parameters

TBool aEmphasis


SetPictureOwnedExternally()

IMPORT_C void SetPictureOwnedExternally(TBool aOwnership);

Description

Sets whether the images bitmaps are externally owned.

Parameters

TBool aOwnership

ETrue to set the image as externally owned, EFalse to set the image as not externally owned.


Bitmap()

IMPORT_C const CFbsBitmap *Bitmap() const;

Description

Gets the images bitmap.

Return value

const CFbsBitmap *

The images bitmap.


Mask()

IMPORT_C const CFbsBitmap *Mask() const;

Description

Gets the images bitmap mask.

Return value

const CFbsBitmap *

The images bitmap mask.


SetBitmap()

IMPORT_C void SetBitmap(const CFbsBitmap *aBitmap);

Description

Sets the images bitmap and transfers ownership unless the bitmaps are owned externally. The previous bitmap is not destroyed even if it is not owned externally.

Parameters

const CFbsBitmap *aBitmap

The images bitmap.


SetMask()

IMPORT_C void SetMask(const CFbsBitmap *aMaskBitmap);

Description

Sets the mask to aMask and transfers ownership unless the bitmaps are owned externally. The mask can be set to be identical to the bitmap if the bitmap is self-masking. The previous mask is not destroyed even if it is not owned externally.

Parameters

const CFbsBitmap *aMaskBitmap

The images bitmap mask.


IsPictureOwnedExternally()

IMPORT_C TBool IsPictureOwnedExternally();

Description

Tests whether the image is owned externally.

Return value

TBool

ETrue if the image is externally owned, EFalse otherwise.


MakeVisible()

virtual IMPORT_C void MakeVisible(TBool aVisible);

Description

Makes this control and its content visible or not.

Parameters

TBool aVisible

Changes the visibility.


SetDimmed()

virtual IMPORT_C void SetDimmed(TBool aDimmed);

Description

If possible, makes this image draw itself dimmed.

Parameters

TBool aDimmed

ETrue if dimmed, EFalse if not.


Type()

IMPORT_C CQikContent::TType Type() const;

Description

Returns the type of this CEikImage

Return value

CQikContent::TType

The CQikContent::TType of this image.


IsEmphasized()

IMPORT_C TBool IsEmphasized() const;

Description

Returns whether this CEikImage is emphasized or not.

Return value

TBool

whether this CEikImage is emphasized or not.


SetStretched()

IMPORT_C void SetStretched(TBool aStretched);

Description

If possible, makes this image draw itself stretched.

Parameters

TBool aStretched

ETrue if stretched, EFalse if not.


IsStretched()

IMPORT_C TBool IsStretched() const;

Description

Returns whether this CEikImage is stretched or not.

Return value

TBool

whether this CEikImage is stretched or not.


SetStretchMaintainAspectRatio()

IMPORT_C void SetStretchMaintainAspectRatio(TBool aStretchMaintainAspectRatio);

Description

Parameters

TBool aStretchMaintainAspectRatio


IsStretchMaintainAspectRatio()

IMPORT_C TBool IsStretchMaintainAspectRatio() const;

Description

Return value

TBool


SetCropped()

IMPORT_C void SetCropped(TBool aCropped);

Description

If possible, makes this image draw itself cropped.

Parameters

TBool aCropped

ETrue if cropped, EFalse if not.


IsCropped()

IMPORT_C TBool IsCropped() const;

Description

Returns whether this CEikImage is cropped or not.

Return value

TBool

whether this CEikImage is cropped or not.


Play()

IMPORT_C void Play(TBool aLoop);

Description

Plays this image if it is an animating format.

Parameters

TBool aLoop

determines if the animation should loop.


Pause()

IMPORT_C void Pause();

Description

Pauses this image if it is an animating format.


Stop()

IMPORT_C void Stop(TBool aImmediately);

Description

Stops this image if it is an animating format.

Parameters

TBool aImmediately

determines if the animation should stop immediately or continue until it loops and then stop.


SetHighlighted()

IMPORT_C void SetHighlighted(TBool aHighlight);

Description

If possible, draws this image highlighted.

Parameters

TBool aHighlight

ETrue if highlighted, EFalse if not.


IsHighlighted()

IMPORT_C TBool IsHighlighted() const;

Description

Returns whether this image is highlighted or not.

Return value

TBool

whether this image is highlighted or not.


HandlePointerEventL()

protected: virtual IMPORT_C void HandlePointerEventL(const TPointerEvent &aPointerEvent);

Description

Handles pointer events from this CEikImage

Parameters

const TPointerEvent &aPointerEvent

The pointer event to act upon.


OfferKeyEventL()

protected: virtual IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aCode);

Description

Handles keyevent events from this CEikImage

Parameters

const TKeyEvent &aKeyEvent

The keyevent event to act upon.

TEventCode aCode

The eventcode.

Return value

TKeyResponse


WriteInternalStateL()

protected: virtual IMPORT_C void WriteInternalStateL(RWriteStream &aWriteStream) const;

Description

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

Parameters

RWriteStream &aWriteStream


Draw()

private: virtual IMPORT_C void Draw(const TRect &aRect) const;

Description

Draw this CEikImage

Parameters

const TRect &aRect

The rect that is drawn.


MopSupplyObject()

private: virtual IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId);

Description

Gets an object whose type is encapsulated by the specified TTypeUid object.

Parameters

TTypeUid aId

Encapsulates the Uid that identifies the type of object required.

Return value

TTypeUid::Ptr

Encapsulates the pointer to the object provided. Note that the encapsulated pointer may be NULL.


Reserved_2()

private: virtual IMPORT_C void Reserved_2();

Description