CAknToolbar Class Reference

class CAknToolbar : public CAknControl

The class to provide toolbar for the application

eikcoctl.lib
Since
Series 60 3.1

Inherits from

Public Member Functions
~CAknToolbar ()
IMPORT_C void AddItemL ( CCoeControl *, const TInt , const TInt , const TInt )
IMPORT_C void AddItemL ( CCoeControl *, const TInt , const TInt , const TInt , const TInt )
IMPORT_C CCoeControl * ComponentControl ( TInt )
IMPORT_C CCoeControl * ControlOrNull (const TInt )
IMPORT_C TInt CountComponentControls ()
TInt CountFadedComponents ()
IMPORT_C void DisableToolbarL ( TBool )
IMPORT_C void Draw ( CWindowGc &, const CCoeControl &, const TRect &)
void DynInitExtensionL ( CCoeControl *)
IMPORT_C TInt EventModifiers ()
void ExtensionEventL ( TInt )
CCoeControl * FadedComponent ( TInt )
IMPORT_C TInt FocusedItem ()
IMPORT_C void HandleControlEventL ( CCoeControl *, TCoeEvent)
IMPORT_C void HandlePointerEventL (const TPointerEvent &)
IMPORT_C void HandleResourceChange ( TInt )
IMPORT_C void HideItem (const TInt , const TBool , const TBool )
IMPORT_C void HideItemsAndDrawOnlyBackground ( TBool )
IMPORT_C void HideItemsAndDrawOnlyBackground ( TBool , TInt )
IMPORT_C TCoeInputCapabilities InputCapabilities ()
IMPORT_C TBool IsShown ()
IMPORT_C TBool IsSupportedItemType (const TInt )
IMPORT_C TBool IsToolbarDisabled ()
IMPORT_C CAknToolbar * NewL (const TInt )
IMPORT_C CAknToolbar * NewLC (const TInt )
IMPORT_C TKeyResponse OfferKeyEventL (const TKeyEvent &, TEventCode )
IMPORT_C void PositionChanged ()
void PrepareForFocusLossL ()
IMPORT_C void ProcessCommandL ( TInt )
TInt ReadyToSlide ( TAny *)
void ReduceRect ( TRect &)
IMPORT_C void RemoveItem (const TInt )
IMPORT_C void SetCloseOnAllCommands (const TBool )
IMPORT_C void SetCloseOnCommand (const TInt , const TBool )
IMPORT_C void SetDimmed ( TBool )
IMPORT_C void SetEmphasis (const TBool )
IMPORT_C void SetFocusedItemL (const TInt )
IMPORT_C void SetInitialFocusedItem (const TInt )
IMPORT_C void SetItemDimmed (const TInt , const TBool , const TBool )
IMPORT_C void SetOrientation (const TAknOrientation )
IMPORT_C void SetSkinBackgroundId (const TAknsItemID &)
IMPORT_C void SetSoftkeyResourceIdL ( TInt )
IMPORT_C void SetToolbarObserver ( MAknToolbarObserver *)
IMPORT_C void SetToolbarVisibility (const TBool )
IMPORT_C void SetToolbarVisibility (const TBool , const TBool )
IMPORT_C void SetWithSliding (const TBool )
void ShowToolbarForBackgroundUpdate ()
void SlideWithIdle ()
IMPORT_C CAknToolbarExtension * ToolbarExtension ()
IMPORT_C TInt ToolbarFlags ()
IMPORT_C MAknToolbarObserver * ToolbarObserver ()
TInt ToolbarVisibleIndexByControl (const CCoeControl *)
IMPORT_C void UpdateBackground ()
Protected Member Functions
IMPORT_C void * ExtensionInterface ( TUid )
IMPORT_C void FocusChanged ( TDrawNow )
IMPORT_C TTypeUid::Ptr MopSupplyObject ( TTypeUid )
IMPORT_C void SizeChanged ()
Private Member Functions
CAknToolbar ()
void AdjustAllButtons ()
void AdjustButton ( CAknButton &)
TRect CalculateControlRect ( TRect &)
void CalculateRects ( TRect &, TRect &, TRect &, TRect &)
TRect CalculateSizeAndPosition ()
void CheckFixedToolbarButtonsL ()
void CheckHitAreas ()
CAknToolbarItem * ConstructControlLC ( TResourceReader &)
IMPORT_C void ConstructFromResourceL ( TResourceReader &)
void ConstructFromResourceL (const TInt )
void ConstructL ()
IMPORT_C void Draw (const TRect &)
void DrawFixedBackgroundL ( CWindowGc &, const CCoeControl &, const TRect &)
void FadeBehindPopup ( TBool )
TInt GetNextSelectableItemIndex ( TInt , TBool )
void HideToolbarForBackgroundUpdate ()
void HideToolbarL ()
void InitFocusedItemL (const TBool )
void MoveHighlightL ( TInt , const TBool , const TBool , const TBool )
TRect RectFromLayout (const TRect &, const TAknWindowComponentLayout &)
void SelectItemL (const TInt , const TBool )
void SetOrdinalPositions ()
void SetRightCbaTextL ()
void SetShown (const TBool )
TInt ShowDelayedToolbar ( TAny *)
void ShowToolbarL ()
void ShowViaIdle ()
void SlideToolbar (const TPoint &)
TBool TooFewItemsVisible ()
CAknToolbarItem * ToolbarItemByControl (const CCoeControl *)
CAknToolbarItem * ToolbarItemById (const TInt )
TInt ToolbarItemIndexByControl (const CCoeControl *)
TInt ToolbarItemIndexById (const TInt )
TInt ToolbarVisibleIndexById (const TInt )
void UpdateControlPositions ()
void UpdateControlVisibility ()
void UpdateItemTooltipPosition ()
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
enum TEventModifiers { 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 void AddItemL ( CCoeControl * aItem,
const TInt aType,
const TInt aCommandId,
const TInt aFlags
)

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 * aItem The control.
const TInt aType The type of the new toolbar item.
const TInt aCommandId The command ID for this item.
const TInt aFlags The flags.

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

IMPORT_C void AddItemL ( CCoeControl * aItem,
const TInt aType,
const TInt aCommandId,
const TInt aFlags,
const TInt aIndex
)

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 * aItem The control.
const TInt aType The type of the new toolbar item.
const TInt aCommandId The command ID for this item.
const TInt aFlags The flags.
const TInt aIndex The index in array at which item should be added.

AdjustAllButtons()

void AdjustAllButtons ( ) [private]

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

AdjustButton(CAknButton &)

void AdjustButton ( 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

Parameters

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

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

void CalculateRects ( 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 & aMainPaneRect main pane rect
TRect & aToolbarRect rect for toolbar
TRect & aGridPaneRect rect for grid pane
TRect & aCellPaneRect rect for cell pane

CalculateSizeAndPosition()

TRect CalculateSizeAndPosition ( ) [private]

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

CheckFixedToolbarButtonsL()

void CheckFixedToolbarButtonsL ( ) [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()

void CheckHitAreas ( ) [private]

Sets buttons to check their touchable areas when tapped

ComponentControl(TInt)

IMPORT_C CCoeControl * ComponentControl ( TInt aIndex ) const [virtual]

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

Parameters

TInt aIndex The index of the control to get

ConstructControlLC(TResourceReader &)

CAknToolbarItem * ConstructControlLC ( TResourceReader & aReader ) [private]

Constructs one of the toolbar items.

Parameters

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

ConstructFromResourceL(TResourceReader &)

IMPORT_C void ConstructFromResourceL ( TResourceReader & aReader ) [private, virtual]

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

Parameters

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

ConstructFromResourceL(const TInt)

void ConstructFromResourceL ( const TInt aResourceId ) [private]

Constructs controls from a resource file.

Parameters

const TInt aResourceId The ID for this component's resource.

ConstructL()

void ConstructL ( ) [private]

Symbian 2nd phase constructor.

ControlOrNull(const TInt)

IMPORT_C CCoeControl * ControlOrNull ( const TInt aControlId ) const

Gets a pointer to the specified control.

Parameters

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

CountComponentControls()

IMPORT_C TInt CountComponentControls ( ) const [virtual]

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

CountFadedComponents()

TInt CountFadedComponents ( )

DisableToolbarL(TBool)

IMPORT_C void DisableToolbarL ( TBool aDisable )

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.

Since
S60 3.2

Parameters

TBool aDisable ETrue if toolbar should be disabled

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

IMPORT_C void Draw ( 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 & aGc Graphics context used for drawing.
const CCoeControl & aControl The control being drawn (may be a child of the drawer).
const TRect & aRect The area to be redrawn.

Draw(const TRect &)

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

From CCoeControl . Draw a control called by window server.

Parameters

const TRect & aRect The 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 &)

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

Draws backgrounds of fixed toolbar

Parameters

CWindowGc & aGc Graphics context used for drawing.
const CCoeControl & aControl The control being drawn (may be a child of the drawer).
const TRect & aRect The area to be drawn.

DynInitExtensionL(CCoeControl *)

void DynInitExtensionL ( CCoeControl * aControl )

Calls DynInitToolbar with extensions commmand id

Parameters

CCoeControl * aControl

EventModifiers()

IMPORT_C TInt EventModifiers ( ) 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.

Since
S60 3.2

ExtensionEventL(TInt)

void ExtensionEventL ( TInt aCommandId )

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

Parameters

TInt aCommandId

ExtensionInterface(TUid)

IMPORT_C void * ExtensionInterface ( TUid aInterface ) [protected, virtual]

From CAknControl . For future extensions.

Parameters

TUid aInterface The ID for the extension interface.

FadeBehindPopup(TBool)

void FadeBehindPopup ( TBool aFade ) [private]

Fades behind toolbar

Parameters

TBool aFade if ETrue then fade

FadedComponent(TInt)

CCoeControl * FadedComponent ( TInt aIndex )

Parameters

TInt aIndex

FocusChanged(TDrawNow)

IMPORT_C void FocusChanged ( TDrawNow aDrawNow ) [protected, virtual]

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

Parameters

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

FocusedItem()

IMPORT_C TInt FocusedItem ( ) const

Returns command id of focused item.

Since
S60 3.2

GetNextSelectableItemIndex(TInt, TBool)

TInt GetNextSelectableItemIndex ( TInt aStartIndex,
TBool aMoveForward
) [private]

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

Parameters

TInt aStartIndex The index of the item from which the search should be started.
TBool aMoveForward ETrue if search is done from lower index to the higher one.

HandleControlEventL(CCoeControl *, TCoeEvent)

IMPORT_C void HandleControlEventL ( CCoeControl * aControl,
TCoeEvent aEventType
)

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

Parameters

CCoeControl * aControl The control which sent the event
TCoeEvent aEventType The event type

HandlePointerEventL(const TPointerEvent &)

IMPORT_C void HandlePointerEventL ( const TPointerEvent & aPointerEvent ) [virtual]

From CCoeControl . Handles pointer events.

Parameters

const TPointerEvent & aPointerEvent The pointer event.

HandleResourceChange(TInt)

IMPORT_C void HandleResourceChange ( TInt aType ) [virtual]

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

Parameters

TInt aType A message UID value.

HideItem(const TInt, const TBool, const TBool)

IMPORT_C void HideItem ( const TInt aCommandId,
const TBool aHide,
const TBool aDrawNow
)

Hides or unhides a toolbar item.

Parameters

const TInt aCommandId The 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 aHide Use ETrue to hide this toolbar item or EFalse to unhide this toolbar item.
const TBool aDrawNow Should be ETrue for the toolbar to be redrawn.

HideItemsAndDrawOnlyBackground(TBool)

IMPORT_C void HideItemsAndDrawOnlyBackground ( TBool aHide )

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 aHide ETrue if hiding items, EFalse if unhiding.

HideItemsAndDrawOnlyBackground(TBool, TInt)

IMPORT_C void HideItemsAndDrawOnlyBackground ( TBool aHide,
TInt aPriority
)

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 aHide ETrue if hiding items, EFalse if unhiding.
TInt aPriority Ordinal priority of toolbar window.

HideToolbarForBackgroundUpdate()

void HideToolbarForBackgroundUpdate ( ) [private]

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

HideToolbarL()

void HideToolbarL ( ) [private]

Hides toolbar.

InitFocusedItemL(const TBool)

void InitFocusedItemL ( const TBool aDrawNow ) [private]

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

Parameters

const TBool aDrawNow if the newly focused item should be redrawn.

InputCapabilities()

IMPORT_C TCoeInputCapabilities InputCapabilities ( ) const [virtual]

From CCoeControl . Gets the control's input capabilities.

IsShown()

IMPORT_C TBool IsShown ( ) const

Returns toolbar visibility at this moment

IsSupportedItemType(const TInt)

IMPORT_C TBool IsSupportedItemType ( const TInt aType ) const

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

Parameters

const TInt aType

IsToolbarDisabled()

IMPORT_C TBool IsToolbarDisabled ( ) const

Checks if toolbar is disabled.

Since
S60 3.2

MopSupplyObject(TTypeUid)

IMPORT_C TTypeUid::Ptr MopSupplyObject ( TTypeUid aId ) [protected]

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

Parameters

TTypeUid aId An encapsulated object type ID.

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

void MoveHighlightL ( TInt aItemIndex,
const TBool aDrawNow,
const TBool aMoveForward = ETrue,
const TBool aPrepareControl = ETrue
) [private]

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

Parameters

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

NewL(const TInt)

IMPORT_C CAknToolbar * NewL ( const TInt aResourceId ) [static]

Two-phased constructor.

Parameters

const TInt aResourceId The ID for this component's resource

NewLC(const TInt)

IMPORT_C CAknToolbar * NewLC ( const TInt aResourceId ) [static]

Two-phased constructor.

Parameters

const TInt aResourceId The ID for this component's resource

OfferKeyEventL(const TKeyEvent &, TEventCode)

IMPORT_C TKeyResponse OfferKeyEventL ( const TKeyEvent & aKeyEvent,
TEventCode aType
) [virtual]

From CCoeControl . Handles key events.

Parameters

const TKeyEvent & aKeyEvent The key event
TEventCode aType The type of key event: EEventKey, EEventKeyUp or EEventKeyDown.

PositionChanged()

IMPORT_C void PositionChanged ( ) [virtual]

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

PrepareForFocusLossL()

void PrepareForFocusLossL ( ) [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.

Since
S60 3.2

ProcessCommandL(TInt)

IMPORT_C void ProcessCommandL ( TInt aCommandId )

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 &)

void ReduceRect ( TRect & aBoundingRect ) const

Parameters

TRect & aBoundingRect

RemoveItem(const TInt)

IMPORT_C void RemoveItem ( const TInt aCommandId )

Removes one item from the toolbar.

Parameters

const TInt aCommandId The ID of the item which should be removed.

SelectItemL(const TInt, const TBool)

void SelectItemL ( const TInt aIndex,
const TBool aSelect
) [private]

Selects/deselects the toolbar item at given index.

Parameters

const TInt aIndex
const TBool aSelect

SetCloseOnAllCommands(const TBool)

IMPORT_C void SetCloseOnAllCommands ( const TBool aClose )

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 aClose ETrue, if toolbar should be closed.

SetCloseOnCommand(const TInt, const TBool)

IMPORT_C void SetCloseOnCommand ( const TInt aCommandId,
const TBool aClose
)

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

Parameters

const TInt aCommandId The command.
const TBool aClose ETrue, if toolbar should be close.

SetDimmed(TBool)

IMPORT_C void SetDimmed ( TBool aDimmed ) [virtual]

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

Parameters

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

SetEmphasis(const TBool)

IMPORT_C void SetEmphasis ( const TBool aEmphasis )

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

Parameters

const TBool aEmphasis ETrue to emphasize the menu, EFalse otherwise.

SetFocusedItemL(const TInt)

IMPORT_C void SetFocusedItemL ( const TInt aCommandId )

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

Since
S60 3.2

Parameters

const TInt aCommandId command id of the item to be focused.

SetInitialFocusedItem(const TInt)

IMPORT_C void SetInitialFocusedItem ( const TInt aCommandId )

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 aCommandId The command ID for the item to get focus.

SetItemDimmed(const TInt, const TBool, const TBool)

IMPORT_C void SetItemDimmed ( const TInt aCommandId,
const TBool aDimmed,
const TBool aDrawNow
)

Dims (greys out) or undims a toolbar item.

Parameters

const TInt aCommandId The 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 aDimmed Use ETrue to dim this toolbar item or EFalse to un-dim this toolbar item.
const TBool aDrawNow Should be ETrue for the item to be redrawn.

SetOrdinalPositions()

void SetOrdinalPositions ( ) 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 void SetOrientation ( const TAknOrientation aOrientation )

Sets toolbar orientation.

Since
3.2

Parameters

const TAknOrientation aOrientation Orientation that should be used for toolbar.

SetRightCbaTextL()

void SetRightCbaTextL ( ) [private]

Changes CBA text if all items are dimmed.

SetShown(const TBool)

void SetShown ( const TBool aShown ) [private]

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

Parameters

const TBool aShown

SetSkinBackgroundId(const TAknsItemID &)

IMPORT_C void SetSkinBackgroundId ( 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 void SetSoftkeyResourceIdL ( TInt aSoftkeyResourceId )
Sets the resource id for toolbar softkeys. If cba allready exists then changes the existing softkeys and redraws toolbar cba.
Since
S60 3.2

Parameters

TInt aSoftkeyResourceId ID of the resource structure specifying the command buttons.

SetToolbarObserver(MAknToolbarObserver *)

IMPORT_C void SetToolbarObserver ( MAknToolbarObserver * aObserver )

Sets the observer for the toolbar.

Parameters

MAknToolbarObserver * aObserver A pointer to the observer. Ownership is not changed.

SetToolbarVisibility(const TBool)

IMPORT_C void SetToolbarVisibility ( const TBool aVisible )

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 aVisible ETrue to show it, EFalse to hide it.

SetToolbarVisibility(const TBool, const TBool)

IMPORT_C void SetToolbarVisibility ( const TBool aVisible,
const TBool aFocusing
)

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 aVisible ETrue to show it, EFalse to hide it.
const TBool aFocusing ETrue to set toolbar focusing, otherwise EFalse.

SetWithSliding(const TBool)

IMPORT_C void SetWithSliding ( const TBool aSlide )

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

Parameters

const TBool aSlide ETrue for sliding effect, EFalse without sliding.

ShowDelayedToolbar(TAny *)

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

Callback for delayed toolbar showing.

Parameters

TAny * aThis

ShowToolbarForBackgroundUpdate()

void ShowToolbarForBackgroundUpdate ( )

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

Since
3.2

ShowToolbarL()

void ShowToolbarL ( ) [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()

void ShowViaIdle ( ) [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 void SizeChanged ( ) [protected, virtual]

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

SlideToolbar(const TPoint &)

void SlideToolbar ( const TPoint & aEndPos ) [private]

Draws toolbar with sliding effect.

Parameters

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

SlideWithIdle()

void SlideWithIdle ( )

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.

ToolbarExtension()

IMPORT_C CAknToolbarExtension * ToolbarExtension ( ) const

Returns pointer to toolbar extension if available

ToolbarFlags()

IMPORT_C TInt ToolbarFlags ( ) const
Returns the flags of toolbar. Flags are defined in eikon.hrh.
Since
S60 3.2

ToolbarItemByControl(const CCoeControl *)

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

Returns toolbar item object for the specified control.

Parameters

const CCoeControl * aControl Pointer to the control.

ToolbarItemById(const TInt)

CAknToolbarItem * ToolbarItemById ( const TInt aId ) const [private]

Returns toolbar item object for the specified command ID.

Parameters

const TInt aId The 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.

Parameters

const CCoeControl * aControl The control which index is needed.

ToolbarItemIndexById(const TInt)

TInt ToolbarItemIndexById ( const TInt aId ) const [private]

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

Parameters

const TInt aId The command ID of the item

ToolbarObserver()

IMPORT_C MAknToolbarObserver * ToolbarObserver ( )

Returns a 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.

Parameters

const CCoeControl * aControl The control which index is needed.

ToolbarVisibleIndexById(const TInt)

TInt ToolbarVisibleIndexById ( const TInt aId ) const [private]

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

Parameters

const TInt aId The command ID of the item.

UpdateBackground()

IMPORT_C void UpdateBackground ( )
Updates transparent toolbar's background.
Since
3.2

UpdateControlPositions()

void UpdateControlPositions ( ) [private]

Updates control positions so that tooltips are positioned correctly

UpdateControlVisibility()

void UpdateControlVisibility ( ) [private]

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

UpdateItemTooltipPosition()

void UpdateItemTooltipPosition ( ) [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]