CAknToolbar Class Reference

class CAknToolbar : public CAknControl

The class to provide toolbar for the application

eikcoctl.lib Series 60 3.1

Inherits from

Public Member Functions
~CAknToolbar()
IMPORT_C voidAddItemL(CCoeControl *, const TInt, const TInt, const TInt)
IMPORT_C voidAddItemL(CCoeControl *, const TInt, const TInt, const TInt, const TInt)
IMPORT_C CCoeControl *ComponentControl(TInt)
IMPORT_C CCoeControl *ControlOrNull(const TInt)
IMPORT_C TIntCountComponentControls()
TInt CountFadedComponents()
IMPORT_C voidDisableToolbarL(TBool)
IMPORT_C voidDraw(CWindowGc &, const CCoeControl &, const TRect &)
voidDynInitExtensionL(CCoeControl *)
IMPORT_C TIntEventModifiers()
voidExtensionEventL(TInt)
CCoeControl *FadedComponent(TInt)
IMPORT_C TIntFocusedItem()
IMPORT_C voidHandleControlEventL(CCoeControl *, TCoeEvent)
IMPORT_C voidHandlePointerEventL(const TPointerEvent &)
IMPORT_C voidHandleResourceChange(TInt)
IMPORT_C voidHideItem(const TInt, const TBool, const TBool)
IMPORT_C voidHideItemsAndDrawOnlyBackground(TBool)
IMPORT_C voidHideItemsAndDrawOnlyBackground(TBool, TInt)
IMPORT_C TCoeInputCapabilitiesInputCapabilities()
IMPORT_C TBoolIsShown()
IMPORT_C TBoolIsSupportedItemType(const TInt)
IMPORT_C TBoolIsToolbarDisabled()
IMPORT_C CAknToolbar *NewL(const TInt)
IMPORT_C CAknToolbar *NewLC(const TInt)
IMPORT_C TKeyResponseOfferKeyEventL(const TKeyEvent &, TEventCode)
IMPORT_C voidPositionChanged()
voidPrepareForFocusLossL()
IMPORT_C voidProcessCommandL(TInt)
TInt ReadyToSlide(TAny *)
voidReduceRect(TRect &)
IMPORT_C voidRemoveItem(const TInt)
IMPORT_C voidSetCloseOnAllCommands(const TBool)
IMPORT_C voidSetCloseOnCommand(const TInt, const TBool)
IMPORT_C voidSetDimmed(TBool)
IMPORT_C voidSetEmphasis(const TBool)
IMPORT_C voidSetFocusedItemL(const TInt)
IMPORT_C voidSetInitialFocusedItem(const TInt)
IMPORT_C voidSetItemDimmed(const TInt, const TBool, const TBool)
IMPORT_C voidSetOrientation(const TAknOrientation)
IMPORT_C voidSetSkinBackgroundId(const TAknsItemID &)
IMPORT_C voidSetSoftkeyResourceIdL(TInt)
IMPORT_C voidSetToolbarObserver(MAknToolbarObserver *)
IMPORT_C voidSetToolbarVisibility(const TBool)
IMPORT_C voidSetToolbarVisibility(const TBool, const TBool)
IMPORT_C voidSetWithSliding(const TBool)
voidShowToolbarForBackgroundUpdate()
voidSlideWithIdle()
IMPORT_C CAknToolbarExtension *ToolbarExtension()
IMPORT_C TIntToolbarFlags()
IMPORT_C MAknToolbarObserver *ToolbarObserver()
TInt ToolbarVisibleIndexByControl(const CCoeControl *)
IMPORT_C voidUpdateBackground()
Protected Member Functions
IMPORT_C void *ExtensionInterface(TUid)
IMPORT_C voidFocusChanged(TDrawNow)
IMPORT_C TTypeUid::PtrMopSupplyObject(TTypeUid)
IMPORT_C voidSizeChanged()
Private Member Functions
CAknToolbar()
voidAdjustAllButtons()
voidAdjustButton(CAknButton &)
TRect CalculateControlRect(TRect &)
voidCalculateRects(TRect &, TRect &, TRect &, TRect &)
TRect CalculateSizeAndPosition()
voidCheckFixedToolbarButtonsL()
voidCheckHitAreas()
CAknToolbarItem *ConstructControlLC(TResourceReader &)
IMPORT_C voidConstructFromResourceL(TResourceReader &)
voidConstructFromResourceL(const TInt)
voidConstructL()
IMPORT_C voidDraw(const TRect &)
voidDrawFixedBackgroundL(CWindowGc &, const CCoeControl &, const TRect &)
voidFadeBehindPopup(TBool)
TInt GetNextSelectableItemIndex(TInt, TBool)
voidHideToolbarForBackgroundUpdate()
voidHideToolbarL()
voidInitFocusedItemL(const TBool)
voidMoveHighlightL(TInt, const TBool, const TBool, const TBool)
TRect RectFromLayout(const TRect &, const TAknWindowComponentLayout &)
voidSelectItemL(const TInt, const TBool)
voidSetOrdinalPositions()
voidSetRightCbaTextL()
voidSetShown(const TBool)
TInt ShowDelayedToolbar(TAny *)
voidShowToolbarL()
voidShowViaIdle()
voidSlideToolbar(const TPoint &)
TBool TooFewItemsVisible()
CAknToolbarItem *ToolbarItemByControl(const CCoeControl *)
CAknToolbarItem *ToolbarItemById(const TInt)
TInt ToolbarItemIndexByControl(const CCoeControl *)
TInt ToolbarItemIndexById(const TInt)
TInt ToolbarVisibleIndexById(const TInt)
voidUpdateControlPositions()
voidUpdateControlVisibility()
voidUpdateItemTooltipPosition()
TInt WaitForScreenSwitch(TAny *)
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::ActivateL()
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::GetColorUseListL(CArrayFix< TCoeColorUse > &)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::HasBorder()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::MinimumSize()
CCoeControl::NotifyFontChange(const CCoeFontProvider *)
CCoeControl::Observer()const
CCoeControl::OverrideColorL(TInt,TRgb)
CCoeControl::OwnsWindow()const
CCoeControl::Parent()
CCoeControl::Parent()const
CCoeControl::Position()const
CCoeControl::PositionRelativeToScreen()const
CCoeControl::PrepareForFocusGainL()
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::SetAdjacent(TInt)
CCoeControl::SetAllowStrayPointers()
CCoeControl::SetBackground(const MCoeControlBackground *)
CCoeControl::SetBlank()
CCoeControl::SetCanDrawOutsideRect()
CCoeControl::SetComponentsToInheritVisibility(TBool)
CCoeControl::SetContainerWindowL(RBackedUpWindow &)
CCoeControl::SetContainerWindowL(RWindow &)
CCoeControl::SetContainerWindowL(const CCoeControl &)
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::WriteInternalStateL(RWriteStream &)const
CCoeControl::WriteInternalStateNowL(RWriteStream &)const
CCoeControl::ZoomWithType()const
CCoeControl::operator=(const CCoeControl &)
CCoeControl::~CCoeControl()
Public Member Enumerations
enumTEventModifiers { ELongPress = 1, ELongPressEnded = 2 }
Inherited Enumerations
CCoeControl:TZoomType
Private Attributes
CFbsBitmap *iBgBitmap
CAknsBasicBackgroundControlContext *iBgContext
TAknsItemID iBgIID
TRect iBgRect
TInt iDownItem
TInt iDrawingPriority
TInt iEndPos
TInt iEventModifiers
TAknPopupFader iFader
TInt iFlags
TInt iFocusedItem
CAknsFrameBackgroundControlContext *iFrameContext
CFbsBitmap *iHighlightBitmap
CFbsBitmap *iHighlightMask
CIdle *iIdle
TInt iInitialFocusedItem
TBitFlags iInternalFlags
RPointerArray< CAknToolbarItem >iItems
TInt iLastFocusedItem
TAknOrientation iOrientation
TInt iPreviousItem
TInt iSelectedItem
TInt iSoftkeyResource
TInt iStep
CEikButtonGroupContainer *iToolbarCba
MAknToolbarObserver *iToolbarObserver
TInt iToolbarResourceId
RPointerArray< CAknToolbarItem >iVisibleItems
Inherited Attributes
CCoeControl::iCoeEnv
CCoeControl::iContext
CCoeControl::iPosition
CCoeControl::iSize

Constructor & Destructor Documentation

CAknToolbar()

CAknToolbar()[private]

C++ default constructor.

~CAknToolbar()

~CAknToolbar()

Destructor

Member Functions Documentation

AddItemL(CCoeControl *, const TInt, const TInt, const TInt)

IMPORT_C voidAddItemL(CCoeControl *aItem,
const TIntaType,
const TIntaCommandId,
const TIntaFlags
)

Adds one item to the end of the toolbar. Takes ownership. Leaves with value KErrNotSupported, if the control type is not supported by toolbar (see CAknToolbar::IsSupportedItemType()).

Parameters

CCoeControl * aItemThe control.
const TInt aTypeThe type of the new toolbar item.
const TInt aCommandIdThe command ID for this item.
const TInt aFlagsThe flags.

AddItemL(CCoeControl *, const TInt, const TInt, const TInt, const TInt)

IMPORT_C voidAddItemL(CCoeControl *aItem,
const TIntaType,
const TIntaCommandId,
const TIntaFlags,
const TIntaIndex
)

Adds one item to the specified place. Takes ownership. Leaves with value KErrNotSupported, if the control type is not supported by toolbar (see CAknToolbar::IsSupportedItemType()).

Parameters

CCoeControl * aItemThe control.
const TInt aTypeThe type of the new toolbar item.
const TInt aCommandIdThe command ID for this item.
const TInt aFlagsThe flags.
const TInt aIndexThe index in array at which item should be added.

AdjustAllButtons()

voidAdjustAllButtons()[private]

Adjusts all buttons' properties depending on the toolbar's features.

AdjustButton(CAknButton &)

voidAdjustButton(CAknButton &aButton)[private]

Adjusts button's properties depending on the toolbar's features.

Parameters

CAknButton & aButton

CalculateControlRect(TRect &)

TRect CalculateControlRect(TRect &aCurrentCellPaneRect)[private]

Calculates the position and size of the control rect

control rect for the toolbar item

Parameters

TRect & aCurrentCellPaneRectcurrent cell pane rect is needed to get correct control rect from layout data.

CalculateRects(TRect &, TRect &, TRect &, TRect &)

voidCalculateRects(TRect &aMainPaneRect,
TRect &aToolbarRect,
TRect &aGridPaneRect,
TRect &aCellPaneRect
)[private]

Calculates rects that are used in calculating the size and position of the toolbar items

Parameters

TRect & aMainPaneRectmain pane rect
TRect & aToolbarRectrect for toolbar
TRect & aGridPaneRectrect for grid pane
TRect & aCellPaneRectrect for cell pane

CalculateSizeAndPosition()

TRect CalculateSizeAndPosition()[private]

Calculates size and position of the toolbar depending on the number and size of the toolbar items.

Toolbar rectangular.

CheckFixedToolbarButtonsL()

voidCheckFixedToolbarButtonsL()[private]

Counts buttons of fixed tool bar and adds button(s) if needed There has to bee at leas three buttons in fixed toolbar.

CheckHitAreas()

voidCheckHitAreas()[private]

Sets buttons to check their touchable areas when tapped

ComponentControl(TInt)

IMPORT_C CCoeControl *ComponentControl(TIntaIndex)const [virtual]

From CCoeControl. Gets the specified component of a compound control.

The component control with an index of aIndex.

Parameters

TInt aIndexThe index of the control to get

ConstructControlLC(TResourceReader &)

CAknToolbarItem *ConstructControlLC(TResourceReader &aReader)[private]

Constructs one of the toolbar items.

Constructed toolbar item.

Parameters

TResourceReader & aReaderThe resource reader with which to access the control's resource values.

ConstructFromResourceL(TResourceReader &)

IMPORT_C voidConstructFromResourceL(TResourceReader &aReader)[private, virtual]

From CCoeControl. Constructs controls from a resource file. Hides the one defined in base class.

Parameters

TResourceReader & aReaderThe resource reader with which to access the control's resource values.

ConstructFromResourceL(const TInt)

voidConstructFromResourceL(const TIntaResourceId)[private]

Constructs controls from a resource file.

Parameters

const TInt aResourceIdThe ID for this component's resource.

ConstructL()

voidConstructL()[private]

Symbian 2nd phase constructor.

ControlOrNull(const TInt)

IMPORT_C CCoeControl *ControlOrNull(const TIntaControlId)const

Gets a pointer to the specified control.

Pointer to the control with the specified ID.

Parameters

const TInt aControlIdThe ID of the control for which a pointer is required.

CountComponentControls()

IMPORT_C TIntCountComponentControls()const [virtual]

From CCoeControl. Gets the number of controls contained in a compound control.

The number of component controls contained by this control.

CountFadedComponents()

TInt CountFadedComponents()

DisableToolbarL(TBool)

IMPORT_C voidDisableToolbarL(TBoolaDisable)

Disables/Enables toolbar so that it cannot/can be activated from e.g. touch pane. Needed especially if a dialog is on the screen and toolbar is not wished to be shown. Leaves with value KErrToolbarShown if called when toolbar is shown.

S60 3.2

Parameters

TBool aDisableETrue if toolbar should be disabled

Draw(CWindowGc &, const CCoeControl &, const TRect &)

IMPORT_C voidDraw(CWindowGc &aGc,
const CCoeControl &aControl,
const TRect &aRect
)const

From MCoeControlBackground. Draw the background for a given control. The text drawer that shall be used to draw text on the specific background can be fetched through the GetTextDrawer() method.

Parameters

CWindowGc & aGcGraphics context used for drawing.
const CCoeControl & aControlThe control being drawn (may be a child of the drawer).
const TRect & aRectThe area to be redrawn.

Draw(const TRect &)

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

From CCoeControl. Draw a control called by window server.

Parameters

const TRect & aRectThe region of the control to be redrawn. Co-ordinates are relative to the control's origin (top left corner).

DrawFixedBackgroundL(CWindowGc &, const CCoeControl &, const TRect &)

voidDrawFixedBackgroundL(CWindowGc &aGc,
const CCoeControl &aControl,
const TRect &aRect
)const [private]

Draws backgrounds of fixed toolbar

Parameters

CWindowGc & aGcGraphics context used for drawing.
const CCoeControl & aControlThe control being drawn (may be a child of the drawer).
const TRect & aRectThe area to be drawn.

DynInitExtensionL(CCoeControl *)

voidDynInitExtensionL(CCoeControl *aControl)

Calls DynInitToolbar with extensions commmand id

Parameters

CCoeControl * aControl

EventModifiers()

IMPORT_C TIntEventModifiers()const

Returns event modifiers defined in TEventModifiers in this header. This can be used by applications in OfferToolbarEventL to know if the event sent was for example a long press event. Information is valid only during OfferToolbarEventL.

event modifiers

S60 3.2

ExtensionEventL(TInt)

voidExtensionEventL(TIntaCommandId)

Extension notifies of its events using this method aCommandId command id of the button

Parameters

TInt aCommandId

ExtensionInterface(TUid)

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

From CAknControl. For future extensions.

Parameters

TUid aInterfaceThe ID for the extension interface.

FadeBehindPopup(TBool)

voidFadeBehindPopup(TBoolaFade)[private]

Fades behind toolbar

Parameters

TBool aFadeif ETrue then fade

FadedComponent(TInt)

CCoeControl *FadedComponent(TIntaIndex)

Parameters

TInt aIndex

FocusChanged(TDrawNow)

IMPORT_C voidFocusChanged(TDrawNowaDrawNow)[protected, virtual]

From CCoeControl. This function is called whenever a control gains or loses focus.

Parameters

TDrawNow aDrawNowContains the value that was passed to it by SetFocus().

FocusedItem()

IMPORT_C TIntFocusedItem()const

Returns command id of focused item.

command id of focused item. Returns KErrNotFound if no item is focused.

S60 3.2

GetNextSelectableItemIndex(TInt, TBool)

TInt GetNextSelectableItemIndex(TIntaStartIndex,
TBoolaMoveForward
)[private]

Returns next non-dimmed and non-hidden control index.

The index of next non-dimmed and non-hidden item.

Parameters

TInt aStartIndexThe index of the item from which the search should be started.
TBool aMoveForwardETrue if search is done from lower index to the higher one.

HandleControlEventL(CCoeControl *, TCoeEvent)

IMPORT_C voidHandleControlEventL(CCoeControl *aControl,
TCoeEventaEventType
)

From MCoeControlObserver. Handles an event from an observed toolbar item.

Parameters

CCoeControl * aControlThe control which sent the event
TCoeEvent aEventTypeThe event type

HandlePointerEventL(const TPointerEvent &)

IMPORT_C voidHandlePointerEventL(const TPointerEvent &aPointerEvent)[virtual]

From CCoeControl. Handles pointer events.

Parameters

const TPointerEvent & aPointerEventThe pointer event.

HandleResourceChange(TInt)

IMPORT_C voidHandleResourceChange(TIntaType)[virtual]

From CCoeControl. Handles a change to the control's resources.

Parameters

TInt aTypeA message UID value.

HideItem(const TInt, const TBool, const TBool)

IMPORT_C voidHideItem(const TIntaCommandId,
const TBoolaHide,
const TBoolaDrawNow
)

Hides or unhides a toolbar item.

Parameters

const TInt aCommandIdThe command (as defined in an .hrh file) associated with this toolbar item. This identifies the toolbar item, which will be set to hidden or unhidden.
const TBool aHideUse ETrue to hide this toolbar item or EFalse to unhide this toolbar item.
const TBool aDrawNowShould be ETrue for the toolbar to be redrawn.

HideItemsAndDrawOnlyBackground(TBool)

IMPORT_C voidHideItemsAndDrawOnlyBackground(TBoolaHide)

Hides/Unhides toolbar items temporarily. When called with ETrue toolbar draws just background in landscape and is hidden in portrait. Calling with EFalse returns the situation to normal, so drawing the items normally in portrait and landscape. Use this method only with fixed toolbar!

Parameters

TBool aHideETrue if hiding items, EFalse if unhiding.

HideItemsAndDrawOnlyBackground(TBool, TInt)

IMPORT_C voidHideItemsAndDrawOnlyBackground(TBoolaHide,
TIntaPriority
)

Hides/Unhides toolbar items temporarily. When called with ETrue toolbar draws just background in landscape and is hidden in portrait. Toolbar window priority is changed to priority passed in parameter. Priority should be one of the window priority values defined in TCoeWinPriority. Default priority is ECoeWinPriorityLow. Note that if toolbar is already hidden, the toolbar window priority is still changed to priority passed in parameter. Calling the function HideItemsAndDrawOnlyBackground with EFalse returns the situation to normal, so drawing the items normally in portrait and landscape. Use this method only with fixed toolbar!

Parameters

TBool aHideETrue if hiding items, EFalse if unhiding.
TInt aPriorityOrdinal priority of toolbar window.

HideToolbarForBackgroundUpdate()

voidHideToolbarForBackgroundUpdate()[private]

Hides toolbar so that screen capture can be taken from the background in order to update it.

HideToolbarL()

voidHideToolbarL()[private]

Hides toolbar.

InitFocusedItemL(const TBool)

voidInitFocusedItemL(const TBoolaDrawNow)[private]

Sets the focus to the middle or the first item, depending on the toolbar flags.

Parameters

const TBool aDrawNowif the newly focused item should be redrawn.

InputCapabilities()

IMPORT_C TCoeInputCapabilitiesInputCapabilities()const [virtual]

From CCoeControl. Gets the control's input capabilities.

The control's input capabilities.

IsShown()

IMPORT_C TBoolIsShown()const

Returns toolbar visibility at this moment

ETrue, if toolbar is shown.

IsSupportedItemType(const TInt)

IMPORT_C TBoolIsSupportedItemType(const TIntaType)const

Returns ETrue if the type of the item can be included in the toolbar.

ETrue for the supported type, otherwise EFalse.

Parameters

const TInt aType

IsToolbarDisabled()

IMPORT_C TBoolIsToolbarDisabled()const

Checks if toolbar is disabled.

ETrue if toolbar is disabled, EFalse if not

S60 3.2

MopSupplyObject(TTypeUid)

IMPORT_C TTypeUid::PtrMopSupplyObject(TTypeUidaId)[protected]

From CCoeControl. Retrieves an object of the same type as that encapsulated in aId.

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

Parameters

TTypeUid aIdAn encapsulated object type ID.

MoveHighlightL(TInt, const TBool, const TBool, const TBool)

voidMoveHighlightL(TIntaItemIndex,
const TBoolaDrawNow,
const TBoolaMoveForward = ETrue,
const TBoolaPrepareControl = ETrue
)[private]

Moves highlight from one item to another. It also will change softkey text for the focused toolbar.

Parameters

TInt aItemIndexThe index for the newly focused item.
const TBool aDrawNowSpecifies whether the item should be redrawn.
const TBool aMoveForward = ETrueSpecifies whether the next item in the array should be selected when the item with aItemIndex is dimmed.
const TBool aPrepareControl = ETrueSpecifies whether PrepareForFocusLossL() or PrepareForFocusGainL() functions should be called.

NewL(const TInt)

IMPORT_C CAknToolbar *NewL(const TIntaResourceId)[static]

Two-phased constructor.

Pointer to the created toolbar object

Parameters

const TInt aResourceIdThe ID for this component's resource

NewLC(const TInt)

IMPORT_C CAknToolbar *NewLC(const TIntaResourceId)[static]

Two-phased constructor.

Pointer to the created toolbar object

Parameters

const TInt aResourceIdThe ID for this component's resource

OfferKeyEventL(const TKeyEvent &, TEventCode)

IMPORT_C TKeyResponseOfferKeyEventL(const TKeyEvent &aKeyEvent,
TEventCodeaType
)[virtual]

From CCoeControl. Handles key events.

TKeyResponse Indicates whether or not the key event was used by this control.

Parameters

const TKeyEvent & aKeyEventThe key event
TEventCode aTypeThe type of key event: EEventKey, EEventKeyUp or EEventKeyDown.

PositionChanged()

IMPORT_C voidPositionChanged()[virtual]

From CCoeControl. Responds to changes in the position of a toolbar.

PrepareForFocusLossL()

voidPrepareForFocusLossL()[virtual]

Takes focus away from edwin or other controls if needed. Called by AknAppUi from HandleWsEventL when a pointer event is targeted to other control than toolbar.

S60 3.2

ProcessCommandL(TInt)

IMPORT_C voidProcessCommandL(TIntaCommandId)

From MEikCommandObserver. Processes user commands.

Parameters

TInt aCommandId

ReadyToSlide(TAny *)

TInt ReadyToSlide(TAny *aThis)[static]

Callback for sliding toolbar.

Parameters

TAny * aThis

RectFromLayout(const TRect &, const TAknWindowComponentLayout &)

TRect RectFromLayout(const TRect &aParent,
const TAknWindowComponentLayout &aComponentLayout
)const [private]

Gets rect from layout data.

Parameters

const TRect & aParent
const TAknWindowComponentLayout & aComponentLayout

ReduceRect(TRect &)

voidReduceRect(TRect &aBoundingRect)const

Parameters

TRect & aBoundingRect

RemoveItem(const TInt)

IMPORT_C voidRemoveItem(const TIntaCommandId)

Removes one item from the toolbar.

Parameters

const TInt aCommandIdThe ID of the item which should be removed.

SelectItemL(const TInt, const TBool)

voidSelectItemL(const TIntaIndex,
const TBoolaSelect
)[private]

Selects/deselects the toolbar item at given index.

Parameters

const TInt aIndex
const TBool aSelect

SetCloseOnAllCommands(const TBool)

IMPORT_C voidSetCloseOnAllCommands(const TBoolaClose)

Sets whether the toolbar should be closed after a command is issued from the toolbar. This method affects every command on the toolbar.

Parameters

const TBool aCloseETrue, if toolbar should be closed.

SetCloseOnCommand(const TInt, const TBool)

IMPORT_C voidSetCloseOnCommand(const TIntaCommandId,
const TBoolaClose
)

Sets whether the toolbar should be closed or remain open after the specified command is issued from the toolbar.

Parameters

const TInt aCommandIdThe command.
const TBool aCloseETrue, if toolbar should be close.

SetDimmed(TBool)

IMPORT_C voidSetDimmed(TBoolaDimmed)[virtual]

From CCoeControl. Sets toolbar dimmed. Doesn't redraw.

Parameters

TBool aDimmedis ETrue to dim the toolbar, EFalse to set the toolbar as not dimmed

SetEmphasis(const TBool)

IMPORT_C voidSetEmphasis(const TBoolaEmphasis)

Called by the framework to handle the emphasising or de-emphasising of a toolbar window when it is needed.

Parameters

const TBool aEmphasisETrue to emphasize the menu, EFalse otherwise.

SetFocusedItemL(const TInt)

IMPORT_C voidSetFocusedItemL(const TIntaCommandId)

Moves highlight from one item to another. Leaves with value KErrNotFound if item not found.

S60 3.2

Parameters

const TInt aCommandIdcommand id of the item to be focused.

SetInitialFocusedItem(const TInt)

IMPORT_C voidSetInitialFocusedItem(const TIntaCommandId)

Changes the command ID for the initially focused item when toolbar is shown or gain focus. Notice that, if this item is not visible, then focus will be according default behaviour. Normally, focus will be on the first item, if KAknToolbarMiddleItemFocused flag was not used.

Parameters

const TInt aCommandIdThe command ID for the item to get focus.

SetItemDimmed(const TInt, const TBool, const TBool)

IMPORT_C voidSetItemDimmed(const TIntaCommandId,
const TBoolaDimmed,
const TBoolaDrawNow
)

Dims (greys out) or undims a toolbar item.

Parameters

const TInt aCommandIdThe command (as defined in an .hrh file) associated with this toolbar item. This identifies the toolbar item, whose text is to be dimmed or un-dimmed.
const TBool aDimmedUse ETrue to dim this toolbar item or EFalse to un-dim this toolbar item.
const TBool aDrawNowShould be ETrue for the item to be redrawn.

SetOrdinalPositions()

voidSetOrdinalPositions()const [private]

Adjusts toolbar's and overlying dialog's window positions so that dialog is displayed on top of the toolbar.

SetOrientation(const TAknOrientation)

IMPORT_C voidSetOrientation(const TAknOrientationaOrientation)

Sets toolbar orientation.

3.2

Parameters

const TAknOrientation aOrientationOrientation that should be used for toolbar.

SetRightCbaTextL()

voidSetRightCbaTextL()[private]

Changes CBA text if all items are dimmed.

SetShown(const TBool)

voidSetShown(const TBoolaShown)[private]

Sets the flag to be on or off and also calls CCoeControl::MakeVisible().

Parameters

const TBool aShown

SetSkinBackgroundId(const TAknsItemID &)

IMPORT_C voidSetSkinBackgroundId(const TAknsItemID &aIID)

Sets the skin background for fixed toolbar. The new background is used for all the subsequent drawing operations. This method does not itself cause a repaint.

Parameters

const TAknsItemID & aIID

SetSoftkeyResourceIdL(TInt)

IMPORT_C voidSetSoftkeyResourceIdL(TIntaSoftkeyResourceId)

Sets the resource id for toolbar softkeys. If cba allready exists then changes the existing softkeys and redraws toolbar cba. S60 3.2

Parameters

TInt aSoftkeyResourceIdID of the resource structure specifying the command buttons.

SetToolbarObserver(MAknToolbarObserver *)

IMPORT_C voidSetToolbarObserver(MAknToolbarObserver *aObserver)

Sets the observer for the toolbar.

Parameters

MAknToolbarObserver * aObserverA pointer to the observer. Ownership is not changed.

SetToolbarVisibility(const TBool)

IMPORT_C voidSetToolbarVisibility(const TBoolaVisible)

Shows or hides toolbar. Position of the top left corner should be set in advance. Toolbar set visible with this method is by default focusing. Does nothing if toolbar is disabled.

Parameters

const TBool aVisibleETrue to show it, EFalse to hide it.

SetToolbarVisibility(const TBool, const TBool)

IMPORT_C voidSetToolbarVisibility(const TBoolaVisible,
const TBoolaFocusing
)

Shows or hides toolbar. Position of the top left corner should be set in advance. This overload of the method allows toolbar to be set non-focusing. Does nothing if toolbar is disabled.

Parameters

const TBool aVisibleETrue to show it, EFalse to hide it.
const TBool aFocusingETrue to set toolbar focusing, otherwise EFalse.

SetWithSliding(const TBool)

IMPORT_C voidSetWithSliding(const TBoolaSlide)

Specifies whether toolbar should be shown with sliding effect or not. By default toolbar is shown with sliding.

Parameters

const TBool aSlideETrue for sliding effect, EFalse without sliding.

ShowDelayedToolbar(TAny *)

TInt ShowDelayedToolbar(TAny *aThis)[private, static]

Callback for delayed toolbar showing.

Parameters

TAny * aThis

ShowToolbarForBackgroundUpdate()

voidShowToolbarForBackgroundUpdate()

Shows toolbar again after it has been hidden for background changing purposes

3.2

ShowToolbarL()

voidShowToolbarL()[private]

Makes toolbar visible and activates it. Position of the top left corner should be set in advance. Also use SetFocus() to specify whether toolbar gets key events or not.

ShowViaIdle()

voidShowViaIdle()[private]

Shows toolbar via CIdle. As a result, toolbar's window priority is setted after the application's container window. This places toolbar to the right place in the window tree.

SizeChanged()

IMPORT_C voidSizeChanged()[protected, virtual]

From CCoeControl. Responds to size changes to sets the size and position of the contents of this control.

SlideToolbar(const TPoint &)

voidSlideToolbar(const TPoint &aEndPos)[private]

Draws toolbar with sliding effect.

Parameters

const TPoint & aEndPosThe position of the top left corner of toolbar at the end of animation.

SlideWithIdle()

voidSlideWithIdle()

Slide toolbar

TooFewItemsVisible()

TBool TooFewItemsVisible()[private]

Checks the number of visible items, and if too few the toolbar CBA is deleted. If last time there were too few items then toolbar CBA is created again. Also the ordinal position of the toolbar is set if there are changes to previous situation.

ETrue if too few items are visible, EFalse if not

ToolbarExtension()

IMPORT_C CAknToolbarExtension *ToolbarExtension()const

Returns pointer to toolbar extension if available toolbar extension or NULL

ToolbarFlags()

IMPORT_C TIntToolbarFlags()const

Returns the flags of toolbar. Flags are defined in eikon.hrh. toolbar flags

S60 3.2

ToolbarItemByControl(const CCoeControl *)

CAknToolbarItem *ToolbarItemByControl(const CCoeControl *aControl)const [private]

Returns toolbar item object for the specified control.

Pointer to the toolbar item.

Parameters

const CCoeControl * aControlPointer to the control.

ToolbarItemById(const TInt)

CAknToolbarItem *ToolbarItemById(const TIntaId)const [private]

Returns toolbar item object for the specified command ID.

Pointer to the toolbar item.

Parameters

const TInt aIdThe command ID of the item.

ToolbarItemIndexByControl(const CCoeControl *)

TInt ToolbarItemIndexByControl(const CCoeControl *aControl)const [private]

Returns the index of the toolbar item inside of the iItems array.

Index of the toolbar item.

Parameters

const CCoeControl * aControlThe control which index is needed.

ToolbarItemIndexById(const TInt)

TInt ToolbarItemIndexById(const TIntaId)const [private]

Returns the index of the toolbar item inside of the iItems array.

Index of the toolbar item.

Parameters

const TInt aIdThe command ID of the item

ToolbarObserver()

IMPORT_C MAknToolbarObserver *ToolbarObserver()

Returns a pointer to the toolbar observer.

Pointer to the toolbar observer.

ToolbarVisibleIndexByControl(const CCoeControl *)

TInt ToolbarVisibleIndexByControl(const CCoeControl *aControl)const

Returns the index of the toolbar item inside of the iVisibleItems array.

Index of the toolbar item.

Parameters

const CCoeControl * aControlThe control which index is needed.

ToolbarVisibleIndexById(const TInt)

TInt ToolbarVisibleIndexById(const TIntaId)const [private]

Returns the index of the toolbar item inside of the iVisibleItems array.

Index of the toolbar item.

Parameters

const TInt aIdThe command ID of the item.

UpdateBackground()

IMPORT_C voidUpdateBackground()

Updates transparent toolbar's background. 3.2

UpdateControlPositions()

voidUpdateControlPositions()[private]

Updates control positions so that tooltips are positioned correctly

UpdateControlVisibility()

voidUpdateControlVisibility()[private]

Updates control visibility based on toolbar visibility and buttons visibility inside toolbar.

UpdateItemTooltipPosition()

voidUpdateItemTooltipPosition()[private]

WaitForScreenSwitch(TAny *)

TInt WaitForScreenSwitch(TAny *aThis)[private, static]

Callback to get notified when ready to show toolbar again

Parameters

TAny * aThis

Member Enumerations Documentation

Enum TEventModifiers

Enumerators

ELongPress = 1
ELongPressEnded = 2

Member Data Documentation

CFbsBitmap * iBgBitmap

CFbsBitmap *iBgBitmap[private]

CAknsBasicBackgroundControlContext * iBgContext

CAknsBasicBackgroundControlContext *iBgContext[private]

TAknsItemID iBgIID

TAknsItemID iBgIID[private]

TRect iBgRect

TRect iBgRect[private]

TInt iDownItem

TInt iDownItem[private]

TInt iDrawingPriority

TInt iDrawingPriority[private]

TInt iEndPos

TInt iEndPos[private]

TInt iEventModifiers

TInt iEventModifiers[private]

TAknPopupFader iFader

TAknPopupFader iFader[private]

TInt iFlags

TInt iFlags[private]

TInt iFocusedItem

TInt iFocusedItem[private]

CAknsFrameBackgroundControlContext * iFrameContext

CAknsFrameBackgroundControlContext *iFrameContext[private]

CFbsBitmap * iHighlightBitmap

CFbsBitmap *iHighlightBitmap[private]

CFbsBitmap * iHighlightMask

CFbsBitmap *iHighlightMask[private]

CIdle * iIdle

CIdle *iIdle[private]

TInt iInitialFocusedItem

TInt iInitialFocusedItem[private]

TBitFlags iInternalFlags

TBitFlags iInternalFlags[private]

RPointerArray< CAknToolbarItem > iItems

RPointerArray< CAknToolbarItem >iItems[private]

TInt iLastFocusedItem

TInt iLastFocusedItem[private]

TAknOrientation iOrientation

TAknOrientation iOrientation[private]

TInt iPreviousItem

TInt iPreviousItem[private]

TInt iSelectedItem

TInt iSelectedItem[private]

TInt iSoftkeyResource

TInt iSoftkeyResource[private]

TInt iStep

TInt iStep[private]

CEikButtonGroupContainer * iToolbarCba

CEikButtonGroupContainer *iToolbarCba[private]

MAknToolbarObserver * iToolbarObserver

MAknToolbarObserver *iToolbarObserver[private]

TInt iToolbarResourceId

TInt iToolbarResourceId[private]

RPointerArray< CAknToolbarItem > iVisibleItems

RPointerArray< CAknToolbarItem >iVisibleItems[private]