CEikTwoPictureCommandButton Class Reference

class CEikTwoPictureCommandButton : public CEikCommandButtonBase

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.

eikcoctl.dll
Since
S60 1.0
Public Member Functions
CEikTwoPictureCommandButton()
~CEikTwoPictureCommandButton()
IMPORT_C voidActivateL()
IMPORT_C voidConstructFromResourceL(TResourceReader &)
IMPORT_C voidConstructImagesFromResourceL(TResourceReader &, TWhichComponent)
IMPORT_C voidHandlePointerEventL(const TPointerEvent &)
IMPORT_C TBoolIsSecondPictureOwnedExternally()
IMPORT_C CEikImage *Picture()
IMPORT_C voidSetPictureFromFileL(const TDesC &, TInt, TInt)
IMPORT_C voidSetSecondPicture(const CFbsBitmap *, const CFbsBitmap *)
IMPORT_C voidSetSecondPictureFromFileL(const TDesC &, TInt, TInt)
IMPORT_C voidSetSecondPictureOwnedExternally(TBool)
IMPORT_C voidSetTextL(const TDesC &)
IMPORT_C voidSetTwoPicturesL(const CFbsBitmap *, const CFbsBitmap *, const CFbsBitmap *, const CFbsBitmap *)
Protected Member Functions
IMPORT_C voidWriteInternalStateL(RWriteStream &)
Private Member Functions
IMPORT_C voidDraw(const TRect &)
IMPORT_C void *ExtensionInterface(TUid)
IMPORT_C voidPrepareContext(CWindowGc &)
IMPORT_C voidStateChanged()
voidSwapPictures(CEikImage *)
Inherited Functions
CAknControl::CAknControl()
CAknControl::~CAknControl()
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CCoeControl::AccumulatedZoom()const
CCoeControl::ActivateGc()const
CCoeControl::BackedUpWindow()const
CCoeControl::Background()const
CCoeControl::CCoeControl()
CCoeControl::CCoeControl(CCoeEnv *)
CCoeControl::CCoeControl(const CCoeControl &)
CCoeControl::CapturesPointer()const
CCoeControl::ClaimPointerGrab(TBool)
CCoeControl::ClaimPointerGrab(TInt,TBool)
CCoeControl::CloseWindow()
CCoeControl::ComponentArrayExists()const
CCoeControl::Components()
CCoeControl::Components()const
CCoeControl::ControlContext()const
CCoeControl::ControlEnv()const
CCoeControl::CopyControlContextFrom(const CCoeControl *)
CCoeControl::CreateBackedUpWindowL(RWindowTreeNode &)
CCoeControl::CreateBackedUpWindowL(RWindowTreeNode &,TDisplayMode)
CCoeControl::CreateWindowL()
CCoeControl::CreateWindowL(RWindowGroup *)
CCoeControl::CreateWindowL(RWindowTreeNode &)
CCoeControl::CreateWindowL(const CCoeControl *)
CCoeControl::CustomGc()const
CCoeControl::DeactivateGc()const
CCoeControl::DrawBackground(const TRect &)const
CCoeControl::DrawDeferred()const
CCoeControl::DrawForeground(const TRect &)const
CCoeControl::DrawNow()const
CCoeControl::DrawNow(const TRect &)const
CCoeControl::DrawableWindow()const
CCoeControl::EnableDragEvents()
CCoeControl::EnableReportControlStateChange(TBool)
CCoeControl::EnableWindowTransparency()
CCoeControl::FindBackground()const
CCoeControl::FindFontProvider()const
CCoeControl::GetColor(TInt,TRgb &)const
CCoeControl::GetGc()const
CCoeControl::GetHelpContext(TCoeHelpContext &)const
CCoeControl::GrabbingComponent()const
CCoeControl::GrabbingComponent(TInt)const
CCoeControl::HandleComponentControlsResourceChange(TInt)
CCoeControl::HandleControlArrayEventL(CCoeControlArray::TEvent,const CCoeControlArray *,CCoeControl *,TInt)
CCoeControl::HandlePointerBufferReadyL()
CCoeControl::HandleRedrawEvent(const TRect &)const
CCoeControl::HitTest()const
CCoeControl::IgnoreEventsUntilNextPointerUp()
CCoeControl::Index(const CCoeControl *)const
CCoeControl::InitComponentArrayL()
CCoeControl::IsActivated()const
CCoeControl::IsBackedUp()const
CCoeControl::IsBeingDestroyed()const
CCoeControl::IsBlank()const
CCoeControl::IsDimmed()const
CCoeControl::IsFocused()const
CCoeControl::IsNonFocusing()const
CCoeControl::IsReadyToDraw()const
CCoeControl::IsVisible()const
CCoeControl::LayoutManager()const
CCoeControl::MakeVisible(TBool)
CCoeControl::MaximumWidth()const
CCoeControl::MopSupplyObject(TTypeUid)
CCoeControl::NotifyFontChange(const CCoeFontProvider *)
CCoeControl::Observer()const
CCoeControl::OverrideColorL(TInt,TRgb)
CCoeControl::OwnsWindow()const
CCoeControl::Parent()
CCoeControl::Parent()const
CCoeControl::Position()const
CCoeControl::PositionChanged()
CCoeControl::PositionRelativeToScreen()const
CCoeControl::PrepareForFocusGainL()
CCoeControl::PrepareForFocusLossL()
CCoeControl::ProcessPointerBufferReadyL()
CCoeControl::ProcessPointerEventL(const TPointerEvent &)
CCoeControl::Rect()const
CCoeControl::RecursivelyMergeInputCapabilities(TCoeInputCapabilities &)const
CCoeControl::RecursivelyMergedInputCapabilities()const
CCoeControl::RefetchPixelMappingL()
CCoeControl::RemoveFromParent()
CCoeControl::ReportEventL(MCoeControlObserver::TCoeEvent)
CCoeControl::RequestRelayout(const CCoeControl *)
CCoeControl::ResetGc()const
CCoeControl::ScreenFont(const TCoeFont &)const
CCoeControl::SetAllowStrayPointers()
CCoeControl::SetBackground(const MCoeControlBackground *)
CCoeControl::SetBlank()
CCoeControl::SetCanDrawOutsideRect()
CCoeControl::SetComponentsToInheritVisibility(TBool)
CCoeControl::SetContainerWindowL(RBackedUpWindow &)
CCoeControl::SetContainerWindowL(RWindow &)
CCoeControl::SetControlContext(MCoeControlContext *)
CCoeControl::SetCornerAndSize(TGulAlignment,const TSize &)
CCoeControl::SetCustomGc(CWindowGc *)
CCoeControl::SetExtent(const TPoint &,const TSize &)
CCoeControl::SetExtentToWholeScreen()
CCoeControl::SetFocus(TBool,TDrawNow)
CCoeControl::SetFocusing(TBool)
CCoeControl::SetFontProviderL(const CCoeFontProvider &)
CCoeControl::SetGc(CWindowGc *)const
CCoeControl::SetGloballyCapturing(TBool)
CCoeControl::SetHitTest(const MCoeControlHitTest *)
CCoeControl::SetLayoutManagerL(MCoeLayoutManager *)
CCoeControl::SetMaximumWidth(TInt)
CCoeControl::SetMopParent(MObjectProvider *)
CCoeControl::SetNeighbor(CCoeControl *)
CCoeControl::SetNonFocusing()
CCoeControl::SetObserver(MCoeControlObserver *)
CCoeControl::SetParent(CCoeControl *)
CCoeControl::SetPointerCapture(TBool)
CCoeControl::SetPosition(const TPoint &)
CCoeControl::SetRect(const TRect &)
CCoeControl::SetSize(const TSize &)
CCoeControl::SetSizeWithoutNotification(const TSize &)
CCoeControl::SetTextBaselineSpacing(TInt)
CCoeControl::SetUniqueHandle(TInt)
CCoeControl::SetZoomFactorL(TInt,TZoomType)
CCoeControl::Size()const
CCoeControl::SystemGc()const
CCoeControl::TextBaselineOffset(const TSize &)const
CCoeControl::TextDrawer(TInt)const
CCoeControl::UniqueHandle()const
CCoeControl::Window()const
CCoeControl::WriteInternalStateNowL(RWriteStream &)const
CCoeControl::ZoomWithType()const
CCoeControl::operator=(const CCoeControl &)
CCoeControl::~CCoeControl()
CEikBorderedControl::Border()const
CEikBorderedControl::CEikBorderedControl()
CEikBorderedControl::CEikBorderedControl(const TGulBorder &)
CEikBorderedControl::HasBorder()const
CEikBorderedControl::SetAdjacent(TInt)
CEikBorderedControl::SetBorder(TGulBorder::TBorderType)
CEikBorderedControl::SetBorder(TInt)
CEikButtonBase::Animate()
CEikButtonBase::CEikButtonBase()
CEikButtonBase::CopyDrawStateTo(CEikButtonBase *)const
CEikButtonBase::DrawState()const
CEikButtonBase::InputCapabilities()const
CEikButtonBase::IsPressed()const
CEikButtonBase::SetAllowTristate()
CEikButtonBase::SetBehavior(TButtonBehavior)
CEikButtonBase::SetCoordinator(TEikButtonCoordinator *)
CEikButtonBase::SetIgnoreNextPointerUp()
CEikButtonBase::SetReportOnPointerDown()
CEikButtonBase::SetState(TState)
CEikButtonBase::State()const
CEikButtonBase::~CEikButtonBase()
CEikCommandButtonBase::Behavior()const
CEikCommandButtonBase::ButFlags()const
CEikCommandButtonBase::CEikCommandButtonBase()
CEikCommandButtonBase::CheckCreateCommandStackL()
CEikCommandButtonBase::CommandStack()const
CEikCommandButtonBase::ComponentControl(TInt)const
CEikCommandButtonBase::ConstructImageFromResourceL(TResourceReader &,TWhichComponent)
CEikCommandButtonBase::ConstructLabelFromResourceL(TResourceReader &,TWhichComponent)
CEikCommandButtonBase::CountComponentControls()const
CEikCommandButtonBase::FocusChanged(TDrawNow)
CEikCommandButtonBase::GetColorUseListL(CArrayFix< TCoeColorUse > &)const
CEikCommandButtonBase::HandleResourceChange(TInt)
CEikCommandButtonBase::IsDefault()const
CEikCommandButtonBase::LayoutComponents()
CEikCommandButtonBase::MinimumSize()
CEikCommandButtonBase::OfferKeyEventL(const TKeyEvent &,TEventCode)
CEikCommandButtonBase::SetButtonLayout(TLayout)
CEikCommandButtonBase::SetContainerWindowL(const CCoeControl &)
CEikCommandButtonBase::SetDefault(TBool)
CEikCommandButtonBase::SetDimmed(TBool)
CEikCommandButtonBase::SetDisplayContent(TDisplayContent)
CEikCommandButtonBase::SetExcessSpace(TExcess)
CEikCommandButtonBase::SetImageAttributes(CEikImage *)
CEikCommandButtonBase::SetPictureFromFileL(const TDesC &,TInt,TInt,CEikAlignedControl *&)
CEikCommandButtonBase::SetPictureL(const CFbsBitmap *,const CFbsBitmap *,CEikAlignedControl *&)
CEikCommandButtonBase::SetTextL(const TDesC &,CEikAlignedControl *&)
CEikCommandButtonBase::StartConstructFromResourceL(TResourceReader &)
CEikCommandButtonBase::UpdateComponentAlignment()
CEikCommandButtonBase::~CEikCommandButtonBase()
Public Member Enumerations
enumTDisplayContent { ETextOnly = 0x0100, EPictureOnly = 0x0200, ETextAndPicture = 0x0300 }
enumTExcess { EShare = 0x0000, EToText = 0x0010, EToPicture = 0x0020 }
enumTLayout { ETextRightPictureLeft = 0x000, ETextBottomPictureTop = 0x001, ETextTopPictureBottom = 0x002, ETextLeftPictureRight = 0x003 }
Private Member Enumerations
enumTExternalPicture { EPictureNotOwnedExternally = 0x00, EPictureOwnedExternally = 0x01 }
enumTPictureButtonType { EPictureButWithBorders = 0x0000, EPictureButWithoutBorders = 0x1000 }
Inherited Enumerations
CCoeControl:TZoomType
CEikButtonBase:TDrawState
CEikButtonBase:TState
CEikCommandButtonBase:TWhichComponent
Private Attributes
TInt iDummy
TInt iPictureFlags
const CFbsBitmap *iSecondBitmap
const CFbsBitmap *iSecondMaskBitmap
Inherited Attributes
CCoeControl::iCoeEnv
CCoeControl::iContext
CCoeControl::iPosition
CCoeControl::iSize
CEikBorderedControl::iBorder
CEikButtonBase::iButFlags
CEikCommandButtonBase::iCmdFlags
CEikCommandButtonBase::iComponents
CEikCommandButtonBase::iMargins

Constructor & Destructor Documentation

CEikTwoPictureCommandButton()

IMPORT_CCEikTwoPictureCommandButton()

Two picture command button constructor

~CEikTwoPictureCommandButton()

IMPORT_C~CEikTwoPictureCommandButton()

Two picture command button C++ destructor

Member Functions Documentation

ActivateL()

IMPORT_C voidActivateL()[virtual]

From CCoeControl

Make the control ready for display

ConstructFromResourceL(TResourceReader &)

IMPORT_C voidConstructFromResourceL(TResourceReader &aReader)[virtual]

Parameters

TResourceReader & aReaderFully constructed resource reader

ConstructImagesFromResourceL(TResourceReader &, TWhichComponent)

IMPORT_C voidConstructImagesFromResourceL(TResourceReader &aReader,
TWhichComponentaWhich
)

Constructs the two images from resource

Parameters

TResourceReader & aReaderConstructed resource reader.
TWhichComponent aWhichWhich picture to be constructing

Draw(const TRect &)

IMPORT_C voidDraw(const TRect &)const [private, virtual]

From CCoeControl

Request for the control to draw itself within the given rectangle

Parameters

const TRect &

ExtensionInterface(TUid)

IMPORT_C void *ExtensionInterface(TUidaInterface)[private, virtual]

Parameters

TUid aInterface

HandlePointerEventL(const TPointerEvent &)

IMPORT_C voidHandlePointerEventL(const TPointerEvent &aPointerEvent)[virtual]

From CCoeControl

Handle a pointer event coming from the CONE framework

Parameters

const TPointerEvent & aPointerEventEvent to handle

IsSecondPictureOwnedExternally()

IMPORT_C TBoolIsSecondPictureOwnedExternally()

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

Returns ETrue if the bitmaps for the second button picture are owned externally.

Picture()

IMPORT_C CEikImage *Picture()const

Access the picture image.

Returns a pointer to the image control component of the button which displays the button pictures.

PrepareContext(CWindowGc &)

IMPORT_C voidPrepareContext(CWindowGc &aGc)const [private]

From MCoeControlContext

Modify the passed-in graphics context ready for use in this control

Parameters

CWindowGc & aGcGraphics context to set up

SetPictureFromFileL(const TDesC &, TInt, TInt)

IMPORT_C voidSetPictureFromFileL(const TDesC &aFilename,
TIntaMain,
TIntaMask = -1
)

Sets the bitmap and optional mask for the first picture from an mbm file.

Sets the first picture for the button by loading the image bitmap identified by aMain and the mask bitmap identified by aMask from the bitmap file named aFilename.

Parameters

const TDesC & aFilename
TInt aMainIndex of the bitmap to use
TInt aMask = -1Index of the mask. If -1, then a null mask will be used

SetSecondPicture(const CFbsBitmap *, const CFbsBitmap *)

IMPORT_C voidSetSecondPicture(const CFbsBitmap *aSecondMain,
const CFbsBitmap *aSecondMask = NULL
)

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

Sets the second picture for the button using aSecondMain as the image bitmap and aSecondMask as the mask bitmap. Takes ownership of the bitmaps unless the second picture has been set to be owned externally.

Parameters

const CFbsBitmap * aSecondMain
const CFbsBitmap * aSecondMask = NULL

SetSecondPictureFromFileL(const TDesC &, TInt, TInt)

IMPORT_C voidSetSecondPictureFromFileL(const TDesC &aFilename,
TIntaMain,
TIntaMask = -1
)

Sets the bitmap and optional mask for the second picture from an mbm file.

Sets the second picture for the button by loading the image bitmap identified by aMain and the mask bitmap identified by aMask from the bitmap file named aFilename.

Parameters

const TDesC & aFilename
TInt aMainIndex of the bitmap to use
TInt aMask = -1Index of the mask. If -1, then a null mask will be used

SetSecondPictureOwnedExternally(TBool)

IMPORT_C voidSetSecondPictureOwnedExternally(TBoolaOwnership)

Sets the ownership of the second picture object

Sets the bitmaps used for the second button picture to be owned externally if aOwnership is ETrue.

Parameters

TBool aOwnershipSet to EFalse if bitmaps associated with the object are owned by the button

SetTextL(const TDesC &)

IMPORT_C voidSetTextL(const TDesC &aText)

Sets the label text on the button

Sets the text for the button label to aText.

Parameters

const TDesC & aTextThe text to set

SetTwoPicturesL(const CFbsBitmap *, const CFbsBitmap *, const CFbsBitmap *, const CFbsBitmap *)

IMPORT_C voidSetTwoPicturesL(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.

Sets both the pictures for the command button. The first picture is created from the image bitmap aMain and the mask bitmap aMask. The optional second picture is created from the image bitmap aSecondMain and mask bitmap aSecondMask.

Parameters

const CFbsBitmap * aMainThe bitmap to use for the first picture
const CFbsBitmap * aMask = NULLThe mask. If null, then no mask will be used
const CFbsBitmap * aSecondMain = NULLThe bitmap to use for the second picture
const CFbsBitmap * aSecondMask = NULLThe mask. If null, then no mask will be used

StateChanged()

IMPORT_C voidStateChanged()[private, virtual]

From CEikButtonBase

Framework method called when the state changes

SwapPictures(CEikImage *)

voidSwapPictures(CEikImage *aImage)[private]

Parameters

CEikImage * aImage

WriteInternalStateL(RWriteStream &)

IMPORT_C voidWriteInternalStateL(RWriteStream &aWriteStream)const [protected, virtual]

From CCoeControl

Serialize the state of the control

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 & aWriteStreamOutput stream for the serialization

Member Enumerations Documentation

Enum TDisplayContent

Content to display for the text

Enumerators

ETextOnly = 0x0100
EPictureOnly = 0x0200
ETextAndPicture = 0x0300

Enum TExcess

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

Enumerators

EShare = 0x0000
EToText = 0x0010
EToPicture = 0x0020

Enum TExternalPicture

Sets the ownership of the pictures bitmap and mask objects. If owned externally, then no copy is made of the objects in the setter functions. It must be, in this case, ensured by the client that that the button is destroyed before deleting the externally-owned objects.

Enumerators

EPictureNotOwnedExternally = 0x00
EPictureOwnedExternally = 0x01

Enum TLayout

Layout options for the Two Picture botton

Enumerators

ETextRightPictureLeft = 0x000
ETextBottomPictureTop = 0x001
ETextTopPictureBottom = 0x002
ETextLeftPictureRight = 0x003

Enum TPictureButtonType

Options for the type of button

Enumerators

EPictureButWithBorders = 0x0000
EPictureButWithoutBorders = 0x1000

Member Data Documentation

TInt iDummy

TInt iDummy[private]

TInt iPictureFlags

TInt iPictureFlags[private]

const CFbsBitmap * iSecondBitmap

const CFbsBitmap *iSecondBitmap[private]

Ownership dependent on state of flags

const CFbsBitmap * iSecondMaskBitmap

const CFbsBitmap *iSecondMaskBitmap[private]

Ownership dependent on state of flags