class CAknToolbar : public CAknControl |
The class to provide toolbar for the application
eikcoctl.lib Series 60 3.1
Protected Member Functions | |
---|---|
IMPORT_C void * | ExtensionInterface(TUid) |
IMPORT_C void | FocusChanged(TDrawNow) |
IMPORT_C TTypeUid::Ptr | MopSupplyObject(TTypeUid) |
IMPORT_C void | SizeChanged() |
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 |
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()).
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. |
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()).
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. |
void | AdjustAllButtons | ( | ) | [private] |
Adjusts all buttons' properties depending on the toolbar's features.
void | AdjustButton | ( | CAknButton & | aButton | ) | [private] |
Adjusts button's properties depending on the toolbar's features.
CAknButton & aButton |
TRect | CalculateControlRect | ( | TRect & | aCurrentCellPaneRect | ) | [private] |
Calculates the position and size of the control rect
control rect for the toolbar item
TRect & aCurrentCellPaneRect | current cell pane rect is needed to get correct control rect from layout data. |
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
TRect | CalculateSizeAndPosition | ( | ) | [private] |
Calculates size and position of the toolbar depending on the number and size of the toolbar items.
Toolbar rectangular.
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.
void | CheckHitAreas | ( | ) | [private] |
Sets buttons to check their touchable areas when tapped
IMPORT_C CCoeControl * | ComponentControl | ( | TInt | aIndex | ) | const [virtual] |
From CCoeControl. Gets the specified component of a compound control.
The component control with an index of aIndex.
TInt aIndex | The index of the control to get |
CAknToolbarItem * | ConstructControlLC | ( | TResourceReader & | aReader | ) | [private] |
Constructs one of the toolbar items.
Constructed toolbar item.
TResourceReader & aReader | The resource reader with which to access the control's resource values. |
IMPORT_C void | ConstructFromResourceL | ( | TResourceReader & | aReader | ) | [private, virtual] |
From CCoeControl. Constructs controls from a resource file. Hides the one defined in base class.
TResourceReader & aReader | The resource reader with which to access the control's resource values. |
void | ConstructFromResourceL | ( | const TInt | aResourceId | ) | [private] |
Constructs controls from a resource file.
const TInt aResourceId | The ID for this component's resource. |
IMPORT_C CCoeControl * | ControlOrNull | ( | const TInt | aControlId | ) | const |
Gets a pointer to the specified control.
Pointer to the control with the specified ID.
const TInt aControlId | The ID of the control for which a pointer is required. |
IMPORT_C TInt | CountComponentControls | ( | ) | const [virtual] |
From CCoeControl. Gets the number of controls contained in a compound control.
The number of component controls contained by this control.
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.
S60 3.2
TBool aDisable | ETrue if toolbar should be disabled |
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.
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. |
IMPORT_C void | Draw | ( | const TRect & | aRect | ) | const [private, virtual] |
From CCoeControl. Draw a control called by window server.
const TRect & aRect | The region of the control to be redrawn. Co-ordinates are relative to the control's origin (top left corner). |
void | DrawFixedBackgroundL | ( | CWindowGc & | aGc, |
const CCoeControl & | aControl, | |||
const TRect & | aRect | |||
) | const [private] |
Draws backgrounds of fixed toolbar
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. |
void | DynInitExtensionL | ( | CCoeControl * | aControl | ) |
Calls DynInitToolbar with extensions commmand id
CCoeControl * aControl |
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.
event modifiers
S60 3.2
void | ExtensionEventL | ( | TInt | aCommandId | ) |
Extension notifies of its events using this method aCommandId command id of the button
TInt aCommandId |
IMPORT_C void * | ExtensionInterface | ( | TUid | aInterface | ) | [protected, virtual] |
From CAknControl. For future extensions.
TUid aInterface | The ID for the extension interface. |
void | FadeBehindPopup | ( | TBool | aFade | ) | [private] |
Fades behind toolbar
TBool aFade | if ETrue then fade |
IMPORT_C void | FocusChanged | ( | TDrawNow | aDrawNow | ) | [protected, virtual] |
From CCoeControl. This function is called whenever a control gains or loses focus.
TDrawNow aDrawNow | Contains the value that was passed to it by SetFocus(). |
IMPORT_C TInt | FocusedItem | ( | ) | const |
Returns command id of focused item.
command id of focused item. Returns KErrNotFound if no item is focused.
S60 3.2
TInt | GetNextSelectableItemIndex | ( | TInt | aStartIndex, |
TBool | aMoveForward | |||
) | [private] |
Returns next non-dimmed and non-hidden control index.
The index of next non-dimmed and non-hidden item.
IMPORT_C void | HandleControlEventL | ( | CCoeControl * | aControl, |
TCoeEvent | aEventType | |||
) |
From MCoeControlObserver. Handles an event from an observed toolbar item.
CCoeControl * aControl | The control which sent the event |
TCoeEvent aEventType | The event type |
IMPORT_C void | HandlePointerEventL | ( | const TPointerEvent & | aPointerEvent | ) | [virtual] |
From CCoeControl. Handles pointer events.
const TPointerEvent & aPointerEvent | The pointer event. |
IMPORT_C void | HandleResourceChange | ( | TInt | aType | ) | [virtual] |
From CCoeControl. Handles a change to the control's resources.
TInt aType | A message UID value. |
IMPORT_C void | HideItem | ( | const TInt | aCommandId, |
const TBool | aHide, | |||
const TBool | aDrawNow | |||
) |
Hides or unhides a toolbar item.
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. |
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!
TBool aHide | ETrue if hiding items, EFalse if unhiding. |
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!
void | HideToolbarForBackgroundUpdate | ( | ) | [private] |
Hides toolbar so that screen capture can be taken from the background in order to update it.
void | InitFocusedItemL | ( | const TBool | aDrawNow | ) | [private] |
Sets the focus to the middle or the first item, depending on the toolbar flags.
const TBool aDrawNow | if the newly focused item should be redrawn. |
IMPORT_C TCoeInputCapabilities | InputCapabilities | ( | ) | const [virtual] |
From CCoeControl. Gets the control's input capabilities.
The control's input capabilities.
IMPORT_C TBool | IsShown | ( | ) | const |
Returns toolbar visibility at this moment
ETrue, if toolbar is shown.
IMPORT_C TBool | IsSupportedItemType | ( | const TInt | aType | ) | const |
Returns ETrue if the type of the item can be included in the toolbar.
ETrue for the supported type, otherwise EFalse.
const TInt aType |
IMPORT_C TBool | IsToolbarDisabled | ( | ) | const |
Checks if toolbar is disabled.
ETrue if toolbar is disabled, EFalse if not
S60 3.2
IMPORT_C TTypeUid::Ptr | MopSupplyObject | ( | TTypeUid | aId | ) | [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.
TTypeUid aId | An encapsulated object type ID. |
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.
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. |
IMPORT_C CAknToolbar * | NewL | ( | const TInt | aResourceId | ) | [static] |
Two-phased constructor.
Pointer to the created toolbar object
const TInt aResourceId | The ID for this component's resource |
IMPORT_C CAknToolbar * | NewLC | ( | const TInt | aResourceId | ) | [static] |
Two-phased constructor.
Pointer to the created toolbar object
const TInt aResourceId | The ID for this component's resource |
IMPORT_C TKeyResponse | OfferKeyEventL | ( | const TKeyEvent & | aKeyEvent, |
TEventCode | aType | |||
) | [virtual] |
From CCoeControl. Handles key events.
TKeyResponse Indicates whether or not the key event was used by this control.
const TKeyEvent & aKeyEvent | The key event |
TEventCode aType | The type of key event: EEventKey, EEventKeyUp or EEventKeyDown. |
IMPORT_C void | PositionChanged | ( | ) | [virtual] |
From CCoeControl. Responds to changes in the position of a toolbar.
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.
S60 3.2
IMPORT_C void | ProcessCommandL | ( | TInt | aCommandId | ) |
From MEikCommandObserver. Processes user commands.
TInt aCommandId |
TInt | ReadyToSlide | ( | TAny * | aThis | ) | [static] |
Callback for sliding toolbar.
TAny * aThis |
TRect | RectFromLayout | ( | const TRect & | aParent, |
const TAknWindowComponentLayout & | aComponentLayout | |||
) | const [private] |
Gets rect from layout data.
const TRect & aParent | |
const TAknWindowComponentLayout & aComponentLayout |
IMPORT_C void | RemoveItem | ( | const TInt | aCommandId | ) |
Removes one item from the toolbar.
const TInt aCommandId | The ID of the item which should be removed. |
void | SelectItemL | ( | const TInt | aIndex, |
const TBool | aSelect | |||
) | [private] |
Selects/deselects the toolbar item at given index.
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.
const TBool aClose | ETrue, if toolbar should be closed. |
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.
IMPORT_C void | SetDimmed | ( | TBool | aDimmed | ) | [virtual] |
From CCoeControl. Sets toolbar dimmed. Doesn't redraw.
TBool aDimmed | is ETrue to dim the toolbar, EFalse to set the toolbar as not dimmed |
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.
const TBool aEmphasis | ETrue to emphasize the menu, EFalse otherwise. |
IMPORT_C void | SetFocusedItemL | ( | const TInt | aCommandId | ) |
Moves highlight from one item to another. Leaves with value KErrNotFound if item not found.
S60 3.2
const TInt aCommandId | command id of the item to be focused. |
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.
const TInt aCommandId | The command ID for the item to get focus. |
IMPORT_C void | SetItemDimmed | ( | const TInt | aCommandId, |
const TBool | aDimmed, | |||
const TBool | aDrawNow | |||
) |
Dims (greys out) or undims a toolbar item.
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. |
void | SetOrdinalPositions | ( | ) | const [private] |
Adjusts toolbar's and overlying dialog's window positions so that dialog is displayed on top of the toolbar.
IMPORT_C void | SetOrientation | ( | const TAknOrientation | aOrientation | ) |
Sets toolbar orientation.
3.2
const TAknOrientation aOrientation | Orientation that should be used for toolbar. |
void | SetShown | ( | const TBool | aShown | ) | [private] |
Sets the flag to be on or off and also calls CCoeControl::MakeVisible().
const TBool aShown |
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.
const TAknsItemID & aIID |
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. S60 3.2
TInt aSoftkeyResourceId | ID of the resource structure specifying the command buttons. |
IMPORT_C void | SetToolbarObserver | ( | MAknToolbarObserver * | aObserver | ) |
Sets the observer for the toolbar.
MAknToolbarObserver * aObserver | A pointer to the observer. Ownership is not changed. |
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.
const TBool aVisible | ETrue to show it, EFalse to hide it. |
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.
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.
const TBool aSlide | ETrue for sliding effect, EFalse without sliding. |
TInt | ShowDelayedToolbar | ( | TAny * | aThis | ) | [private, static] |
Callback for delayed toolbar showing.
TAny * aThis |
void | ShowToolbarForBackgroundUpdate | ( | ) |
Shows toolbar again after it has been hidden for background changing purposes
3.2
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.
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.
IMPORT_C void | SizeChanged | ( | ) | [protected, virtual] |
From CCoeControl. Responds to size changes to sets the size and position of the contents of this control.
void | SlideToolbar | ( | const TPoint & | aEndPos | ) | [private] |
Draws toolbar with sliding effect.
const TPoint & aEndPos | The position of the top left corner of toolbar at the end of animation. |
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
IMPORT_C CAknToolbarExtension * | ToolbarExtension | ( | ) | const |
Returns pointer to toolbar extension if available toolbar extension or NULL
IMPORT_C TInt | ToolbarFlags | ( | ) | const |
Returns the flags of toolbar. Flags are defined in eikon.hrh. toolbar flags
S60 3.2
CAknToolbarItem * | ToolbarItemByControl | ( | const CCoeControl * | aControl | ) | const [private] |
Returns toolbar item object for the specified control.
Pointer to the toolbar item.
const CCoeControl * aControl | Pointer to the control. |
CAknToolbarItem * | ToolbarItemById | ( | const TInt | aId | ) | const [private] |
Returns toolbar item object for the specified command ID.
Pointer to the toolbar item.
const TInt aId | The command ID of the item. |
TInt | ToolbarItemIndexByControl | ( | const CCoeControl * | aControl | ) | const [private] |
Returns the index of the toolbar item inside of the iItems array.
Index of the toolbar item.
const CCoeControl * aControl | The control which index is needed. |
TInt | ToolbarItemIndexById | ( | const TInt | aId | ) | const [private] |
Returns the index of the toolbar item inside of the iItems array.
Index of the toolbar item.
const TInt aId | The command ID of the item |
IMPORT_C MAknToolbarObserver * | ToolbarObserver | ( | ) |
Returns a pointer to the toolbar observer.
Pointer to the toolbar observer.
TInt | ToolbarVisibleIndexByControl | ( | const CCoeControl * | aControl | ) | const |
Returns the index of the toolbar item inside of the iVisibleItems array.
Index of the toolbar item.
const CCoeControl * aControl | The control which index is needed. |
TInt | ToolbarVisibleIndexById | ( | const TInt | aId | ) | const [private] |
Returns the index of the toolbar item inside of the iVisibleItems array.
Index of the toolbar item.
const TInt aId | The command ID of the item. |
void | UpdateControlPositions | ( | ) | [private] |
Updates control positions so that tooltips are positioned correctly
void | UpdateControlVisibility | ( | ) | [private] |
Updates control visibility based on toolbar visibility and buttons visibility inside toolbar.
TInt | WaitForScreenSwitch | ( | TAny * | aThis | ) | [private, static] |
Callback to get notified when ready to show toolbar again
TAny * aThis |
CAknsBasicBackgroundControlContext * | iBgContext | [private] |
CAknsFrameBackgroundControlContext * | iFrameContext | [private] |
RPointerArray< CAknToolbarItem > | iVisibleItems | [private] |