#include <mw/eiksbfrm.h>
class CEikScrollBarFrame : public CBase |
Protected Attributes | |
---|---|
SBarData | iV |
Public Member Enumerations | |
---|---|
enum | anonymous { ETypeId } |
enum | TScrollBarFrameFlags { EHVisible, EVVisible, EEnableNudgeButtons, EDisableExpandedTouchArea } |
enum | TScrollBarManagement { EComponent, EFloating, EApplicationScrollBar } |
enum | TScrollBarSide { EBottomOrRight, ETopOrLeft } |
enum | TScrollBarType { ENormalScrollBar, EArrowHead, EDoubleSpan } |
enum | TScrollBarVisibility { EOff, EOn, EAuto } |
Protected Member Functions | |
---|---|
CCoeControl * | ParentWindow() |
void | SetParentWindow(CCoeControl *) |
The scroll bar frame is a control assemblage manager that relates a control, or control body, to two scroll bars and a corner window. A corner window is that part of the screen that is common to both the horizontal, and the vertical elements of a scroll bar.
This class helps with access to, and set up of, scroll bars and also with the layout of the scrolled control or control body. A scroll bar frame is not a control, but it does implement the standard control composite pattern to manage the assemblage.
Defines that is the horizontal or the vertical (spanned) scroll bar visible. Applicaple only for spanned scroll bars.
Determines how the scroll bar frame manages scroll bars.
IMPORT_C | CEikScrollBarFrame | ( | CCoeControl * | aParentWindow, |
MEikScrollBarObserver * | aObserver, | |||
TBool | aPreAlloc = EFalse | |||
) |
Constructor. Constructs a scroll bar frame object.
Parameter | Description |
---|---|
aParentWindow | The scroll bar s parent control. |
aObserver | The scroll bar observer. |
aPreAlloc | Not used. |
CEikScrollBarFrame | ( | CCoeControl * | aParentWindow, |
MEikScrollBarObserver * | aObserver, | ||
TBool | aPreAlloc, | ||
TBool | aDoubleSpan | ||
) |
Constructor. Internal only to Eikcoctl.lib use. Parameter aDoubleSpan offers possibility to optimize scroll bar loading (if ETrue, arrowhead scroll bar will never be loaded).
Parameter | Description |
---|---|
aParentWindow | The scroll bar s parent control. |
aObserver | The scroll bar observer. |
aPreAlloc | Not used. |
aDoubleSpan | If ETrue, spanned scroll bar is created. |
IMPORT_C CCoeControl * | ComponentControl | ( | TInt | aIndex | ) | const |
From CCoeControl
Gets the component specified by index. Within a compound control, each component control is identified by an index, where the index depends on the order the controls were added: the first is given an index of 0, the next an index of 1, and so on.
Returns: The component control with an index of aIndex
IMPORT_C TInt | CountComponentControls | ( | ) | const |
From CCoeControl
Gets the number of controls contained in a compound control.
Returns: The number of component controls contained in this control.
This method creates double span type scrollbars into this frame. Old scrollbars are deleted or disconnected.
iSBFrame=new(ELeave) CEikScrollBarFrame(this, NULL, ETrue); iSBFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto); iSBFrame->CreateDoubleSpanScrollBarsL(ETrue, EFalse); Note that double span scrollbar types requires different model classes to be used in places of @c TEikScrollBarModel of this scrollbar frame API:s other method calls. Scrollbar type Required model (in places of TEikScrollBarModel) --------------- ------------------------------------------------ EDoubleSpan TAknDoubleSpanScrollBarModel EArrowHead TEikScrollBarModel // model for double span type scrollbar TAknDoubleSpanScrollBarModel vModel; // model for double span type scrollbar TAknDoubleSpanScrollBarModel hModel; iSBFrame->Tile(vModel, iVRect);
Parameter | Description |
---|---|
aWindowOwning | Tells wheter created scrollbar should be a window owning control or not. Selection for this is relevant especially because skinned scrollbar draws |
aRemote | True if this method should instead of creating own scrollbar try to connect to a remote scrollbar frame and start using its scrollbars. Connecting is done using through object provider mechanism, so the object supply chain must be valid. Also if true, then parameter aWindowOwning will be ignored. |
IMPORT_C void | CreateDoubleSpanScrollBarsL | ( | TBool | aWindowOwning, |
TBool | aRemote, | |||
TBool | aVertical, | |||
TBool | aHorizontal | |||
) |
This method creates double span type scrollbars into this frame. Old scrollbars are deleted or disconnected.
Parameter | Description |
---|---|
aWindowOwning | Tells wheter created scrollbar should be a window owning control or not. Selection for this is relevant especially because skinned scrollbar draws its background using its parent windows background context. |
aRemote | True if this method should instead of creating own scrollbar try to connect to a remote scrollbar frame and start using its scrollbars. Connecting is done using through object provider mechanism, so the object supply chain must be valid. Also if true, then parameter aWindowOwning will be ignored. |
aVertical | If ETrue vertical scrollbar will be created to scrollbar frame. |
aHorizontal | If ETrue horizontal scrollbar will be created to scrollbar frame. |
void | DisconnectExternalScrollBar | ( | CEikScrollBar * | aScrollBar | ) |
This method is used only internally by the CEikScrollBar. Disconnects externally connected scrollbar.
Parameter | Description |
---|---|
aScrollBar | Scrollbar to be disconnected. |
Sets the background drawing for the double spanned scrollbars
This method can be used to enable or disable the drawing of the scrollbar background via mop chain.
Parameter | Description |
---|---|
aDrawHorizontal | sets the state of the background drawing of the horizontal scrollbar. |
aDrawVertical | sets the state of the background drawing of the vertical scrollbar. |
Returns: Success of the call, KErrNotSupported if the scrollbars are not doublespan scrollbars.
Gets the state of the background drawing for the double spanned scrollbars.
This method can be used to get the state of drawing of the scrollbar background via mop chain.
Parameter | Description |
---|---|
aDrawHorizontal | gets the state of the background drawing of the horizontal scrollbar. |
aDrawVertical | gets the state of the background drawing of the vertical scrollbar. |
Returns: Success of the call, KErrNotSupported if the scrollbars are not doublespan scrollbars.
void | DrawScrollBarsDeferred | ( | ) | const |
Tell scroll bars and the corner window to redraw if it is visible
IMPORT_C void | DrawScrollBarsNow | ( | ) | const |
Forces any scroll bars and the corner window if it is visible to be redrawn.
IMPORT_C CEikScrollBar * | GetScrollBarHandle | ( | CEikScrollBar::TOrientation | aOrientation | ) | const |
Returns a pointer to the scroll bar identified by orientation aOrientation.
Parameter | Description |
---|---|
aOrientation | The orientation of the scroll bar for which you wish to obtain a pointer. |
Returns: A pointer to the scroll bar with orientation aOrientation if the scrollbar is visible.
CEikScrollBar * | HorizontalScrollBar | ( | ) | const |
Gets a pointer to the horizontal scroll bar.
Returns: A pointer to the horizontal scroll bar.
void | InitExtension | ( | CCoeControl * | aParentWindow, |
MEikScrollBarObserver * | aObserver | |||
) |
Initializes a new CEikScrollBarFrameExtension object.
Parameter | Description |
---|---|
aParentWindow | The scroll bar s parent control. |
aObserver | The scroll bar observer. |
IMPORT_C void | MoveHorizThumbTo | ( | TInt | aHorizThumbPos | ) |
Moves the horizontal scroll bar thumb to the position aHorizThumbPos. This function is used to update the scroll bar after an external scroll. The value of aThumbPos should be supplied in terms of the scrolling model, which is presumed not to have changed spans.
Parameter | Description |
---|---|
aHorizThumbPos | The required thumb position. |
Moves the scroll bar thumbs by the specified amounts. This updates the scroll bars after an external scroll. The values of the parameters should be supplied in terms of the horizontal and vertical scrolling models respectively. The scrolling models are presumed not to have changed spans.
Parameter | Description |
---|---|
aDeltaX | The amount to move the horizontal scroll bar. |
aDeltaY | The amount to move the vertical scroll bar. |
IMPORT_C void | MoveVertThumbTo | ( | TInt | aVertThumbPos | ) |
Moves the vertical scroll bar thumb to the position aVertThumbPos. This function is used to update the scroll bar after an external scroll. The value of aThumbPos should be supplied in terms of the scrolling model, which is presumed not to have changed spans.
Parameter | Description |
---|---|
aVertThumbPos | The required thumb position. |
CCoeControl * | ParentWindow | ( | ) | const [protected] |
Gets a pointer to the parent window.
Returns: A pointer to the parent window.
IMPORT_C TInt | ScrollBarBreadth | ( | CEikScrollBar::TOrientation | aOrientation | ) | const |
Returns the breadth of the scroll bar idenitified by aOrientation, or zero if none exists.
Parameter | Description |
---|---|
aOrientation | The orientation of the scroll bar for which you wish to obtain the breadth. |
Returns: The specified scroll bar's breadth. This is zero if none exists.
IMPORT_C TBool | ScrollBarExists | ( | CEikScrollBar::TOrientation | aOrientation | ) | const |
Determines whether the scroll bar specified by aOrientation exists
Parameter | Description |
---|---|
aOrientation | The scroll bar s orientation. |
Returns: ETrue if the specified scroll bar exists otherwise EFalse.
MEikScrollBarObserver * | ScrollBarFrameObserver | ( | ) |
Sets scrollbar observers.
IMPORT_C TScrollBarVisibility | ScrollBarVisibility | ( | CEikScrollBar::TOrientation | aOrientation | ) | const |
Gets the visibility of given scrollbar orientation.
This method should be used instead of a deprecated method CEikScrollBarFrame::HScrollBarVisibility() and also can be used instead of CEikScrollBarFrame::VScrollBarVisibility()
Parameter | Description |
---|---|
aOrientation | The orientation of a scrollbar in the frame. |
Returns: The visibility of requested scrollbar.
IMPORT_C void | SetAdjustsHorizontalModel | ( | TBool | aAdjusts | ) |
Not implemented.
Parameter | Description |
---|---|
aAdjusts | Not used. |
IMPORT_C void | SetAdjustsVerticalModel | ( | TBool | aAdjusts | ) |
Not implemented.
Parameter | Description |
---|---|
aAdjusts | Not used. |
void | SetParentWindow | ( | CCoeControl * | aParentWindow | ) | [protected] |
Sets parent window.
Parameter | Description |
---|---|
aParentWindow | A pointer to the parent window. |
void | SetScrollBarFrameFlags | ( | TInt | aMask | ) | [inline] |
Sets scrollbar frame flags.
Parameter | Description |
---|---|
aMask | Bitmask of the bits that are to be set. |
IMPORT_C void | SetScrollBarFrameObserver | ( | MEikScrollBarObserver * | aObserver | ) |
Sets scrollbar observers.
Parameter | Description |
---|---|
aObserver | The scroll bar observer. |
IMPORT_C void | SetScrollBarVisibilityL | ( | TScrollBarVisibility | aHVisibility, |
TScrollBarVisibility | aVVisibility | |||
) |
Sets the visibility state for both the horizontal and the vertical scroll bars. This is used when tiling.
Parameter | Description |
---|---|
aHVisibility | Horizontal scroll bar visibility. |
aVVisibility | Vertical scroll bar visibility. |
IMPORT_C void | SetTypeOfHScrollBar | ( | TScrollBarType | aType | ) |
Sets the type of horizontal scroll bar. Possible values are EArrowHead and EDoubleSpan.
Parameter | Description |
---|---|
aType | Type of the scrollbar. |
IMPORT_C void | SetTypeOfVScrollBar | ( | TScrollBarType | aType | ) |
Sets the type of vertical scroll bar. Possible values are EArrowHead and EDoubleSpan.
Parameter | Description |
---|---|
aType | Type of the scrollbar. |
IMPORT_C void | SetVFocusPosToThumbPos | ( | TInt | aFocusPosition | ) |
Moves the vertical scroll bar thumb to the position aFocusPosition. This function is used to update the scroll bar after an external scroll. The value of aFocusPosition should be supplied in terms of the scrolling model, which is presumed not to have changed spans.
Parameter | Description |
---|---|
aFocusPosition | The required thumb position. |
IMPORT_C TBool | Tile | ( | TEikScrollBarModel * | aVModel | ) |
Sets the vertical scrollbar mode. Does not actually draw anything until the thumb or focus setting functions are called.
Parameter | Description |
---|---|
aVModel | Model for the vertical scrollbar. |
Returns: EFalse.
IMPORT_C void | Tile | ( | TEikScrollBarModel * | aVModel, |
TRect & | aVScrollBar | |||
) |
Tiles the vertical EDouble span type scroll bar managed by the frame. The scroll bar is set up according to the scroll bar model and given rectangle which is relative to the parent window of the frame.
AknLayoutUtils::LayoutVerticalScrollBar( CEikScrollBarFrame* aScrollBarFrame, const TRect& aControlParent, const TAknWindowLineLayout& aLayout);
Parameter | Description |
---|---|
aVModel | Vertical scrollbar model. |
aVScrollBar | Vertical scrollbar rectangle. |
IMPORT_C void | Tile | ( | TEikScrollBarModel * | aHModel, |
TEikScrollBarModel * | aVModel | |||
) |
Sets the models of the scrollbars.
Parameter | Description |
---|---|
aHModel | The model of the horizontal scrollbar. |
aVModel | The model of the vertical scrollbar. |
IMPORT_C TBool | TileL | ( | TEikScrollBarModel * | aHModel, |
TEikScrollBarModel * | aVModel, | |||
TRect & | aClientRect, | |||
TRect & | aInclusiveRect, | |||
const TEikScrollBarFrameLayout & | aLayout | |||
) |
Tiles the client area and the scroll bars managed by the frame. The scroll bars are set up according to the scroll bar models; aHModel and aVModel. Ownership is not transferred as a result of passing these parameters as pointers. The result of tiling geometry management is observable through the two rectangles aClientRect and aInclusiveRect. Depending on the tiling layout aLayout and the scroll bar visibility settings, either of these rectangles can be made constant and the other rectangle adjusted accordingly.
For EArrowhead type scrollbar the layout is always fixed, it cannot be altered by using this method.
For EDoublespan type scrollbar the layout can be set also with two helper methods from the AknLayoutUtils class:
AknLayoutUtils::LayoutVerticalScrollBar( CEikScrollBarFrame* aScrollBarFrame, const TRect& aControlParent, const TAknWindowLineLayout& aLayout); AknLayoutUtils::LayoutHorizontalScrollBar( CEikScrollBarFrame* aScrollBarFrame, const TRect& aControlParent, const TAknWindowLineLayout& aLayout);
Parameter | Description |
---|---|
aHModel | Horizontal scroll bar model. |
aVModel | Vertical scroll bar model. |
aClientRect | Client rectangle. |
aInclusiveRect | A rectangle that includes the area to be scrolled and the scroll bars themselves. |
aLayout | Tiling layout. |
Returns: ETrue if the non-constant rectangle is adjusted, otherwise EFalse.
IMPORT_C TScrollBarType | TypeOfHScrollBar | ( | ) | const |
Returns the control type of the horizontal scroll bar
Returns: Type of the scrollbar.
IMPORT_C TScrollBarType | TypeOfVScrollBar | ( | ) | const |
Returns the control type of the vertical scroll bar
Returns: Type of the scrollbar.
TScrollBarVisibility | VScrollBarVisibility | ( | ) | const [inline] |
Determines the vertical scroll bar s visibility. CEikScrollBarFrame::ScrollBarVisibility (CEikScrollBar::TOrientation aOrientation) can be used instead of this method.
Returns: Visibility for vertical scroll bar.
IMPORT_C CEikScrollBar * | VerticalScrollBar | ( | ) | const |
Returns a pointer to the vertical scroll bar.
Returns: A pointer to the vertical scroll bar.