CEikScrollBarFrame Class Reference
class CEikScrollBarFrame : public CBase |
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.
Nested Classes and Structures
Public Member Functions |
---|
| CEikScrollBarFrame() |
| CEikScrollBarFrame(CCoeControl *, MEikScrollBarObserver *, TBool) |
| CEikScrollBarFrame(CCoeControl *, MEikScrollBarObserver *, TBool, TBool) |
| ~CEikScrollBarFrame() |
IMPORT_C CCoeControl * | ComponentControl(TInt) |
IMPORT_C TInt | CountComponentControls() |
IMPORT_C void | CreateDoubleSpanScrollBarsL(TBool, TBool) |
IMPORT_C void | CreateDoubleSpanScrollBarsL(TBool, TBool, TBool, TBool) |
void | DisconnectExternalScrollBar(CEikScrollBar *) |
IMPORT_C TInt | DrawBackground(TBool, TBool) |
IMPORT_C TInt | DrawBackgroundState(TBool &, TBool &) |
void | DrawScrollBarsDeferred() |
IMPORT_C void | DrawScrollBarsNow() |
IMPORT_C CEikScrollBar * | GetScrollBarHandle(CEikScrollBar::TOrientation) |
CEikScrollBar * | HorizontalScrollBar() |
void | InitExtension(CCoeControl *, MEikScrollBarObserver *) |
IMPORT_C TBool | IsArrowHeadScrollBar(TInt) |
IMPORT_C void | MoveHorizThumbTo(TInt) |
IMPORT_C void | MoveThumbsBy(TInt, TInt) |
IMPORT_C void | MoveVertThumbTo(TInt) |
IMPORT_C TInt | ScrollBarBreadth(CEikScrollBar::TOrientation) |
IMPORT_C TBool | ScrollBarExists(CEikScrollBar::TOrientation) |
MEikScrollBarObserver * | ScrollBarFrameObserver() |
IMPORT_C TScrollBarVisibility | ScrollBarVisibility(CEikScrollBar::TOrientation) |
IMPORT_C void | SetAdjustsHorizontalModel(TBool) |
IMPORT_C void | SetAdjustsVerticalModel(TBool) |
void | SetScrollBarFrameFlags(TInt) |
IMPORT_C void | SetScrollBarFrameObserver(MEikScrollBarObserver *) |
IMPORT_C void | SetScrollBarVisibilityL(TScrollBarVisibility, TScrollBarVisibility) |
IMPORT_C void | SetTypeOfHScrollBar(TScrollBarType) |
IMPORT_C void | SetTypeOfVScrollBar(TScrollBarType) |
IMPORT_C void | SetVFocusPosToThumbPos(TInt) |
IMPORT_C TBool | Tile(TEikScrollBarModel *) |
IMPORT_C void | Tile(TEikScrollBarModel *, TRect &) |
IMPORT_C void | Tile(TEikScrollBarModel *, TEikScrollBarModel *) |
IMPORT_C TBool | TileL(TEikScrollBarModel *, TEikScrollBarModel *, TRect &, TRect &, const TEikScrollBarFrameLayout &) |
IMPORT_C TScrollBarType | TypeOfHScrollBar() |
IMPORT_C TScrollBarType | TypeOfVScrollBar() |
TScrollBarVisibility
| VScrollBarVisibility() |
IMPORT_C CEikScrollBar * | VerticalScrollBar() |
Public Member Enumerations |
---|
enum | TScrollBarFrameFlags { EHVisible = 0x01, EVVisible = 0x02, EEnableNudgeButtons = 0x04, EDisableExpandedTouchArea = 0x08 } |
enum | TScrollBarManagement { EComponent, EFloating, EApplicationScrollBar } |
enum | TScrollBarSide { EBottomOrRight = 0x0, ETopOrLeft = 0x800 } |
enum | TScrollBarType { ENormalScrollBar = 0x0, EArrowHead = 0x200, EDoubleSpan = 0x400 } |
enum | TScrollBarVisibility { EOff, EOn, EAuto } |
Constructor & Destructor Documentation
CEikScrollBarFrame()
CEikScrollBarFrame | ( | ) | [inline] |
CEikScrollBarFrame(CCoeControl *, MEikScrollBarObserver *, TBool)
Constructor. Constructs a scroll bar frame object.
CEikScrollBarFrame(CCoeControl *, MEikScrollBarObserver *, TBool, TBool)
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).
~CEikScrollBarFrame()
IMPORT_C | ~CEikScrollBarFrame | ( | ) | |
Member Functions Documentation
ApplyModel(SBarData &)
void | ApplyModel | ( | SBarData & | aSBar | ) | [private] |
CalcTheoreticalScrollBarVisibility(const TEikScrollBarModel *)
CalcTheoreticalScrollBarVisibility(const TEikScrollBarModel *, const TEikScrollBarModel *)
ComponentControl(TInt)
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.
CountComponentControls()
IMPORT_C TInt | CountComponentControls | ( | ) | const |
From CCoeControl
Gets the number of controls contained in a compound control.
CreateArrowHeadScrollBarsL()
void | CreateArrowHeadScrollBarsL | ( | ) | [private] |
CreateDoubleSpanScrollBarsL(TBool, TBool)
IMPORT_C void | CreateDoubleSpanScrollBarsL | ( | TBool | aWindowOwning, |
| TBool | aRemote |
| ) | |
This method creates double span type scrollbars into this frame. Old scrollbars are deleted or disconnected.
- Since
- S60 2.6
Example of use:
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);
Parameters
TBool aWindowOwning | Tells wheter created scrollbar should be a window owning control or not. Selection for this is relevant especially because skinned scrollbar draws |
TBool 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. |
CreateDoubleSpanScrollBarsL(TBool, TBool, TBool, TBool)
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.
- Since
- S60 2.8
-
leave
- KErrNotFound Parent object doesn't have scrollbar frame.
Parameters
TBool 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. |
TBool 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. |
TBool aVertical | If ETrue vertical scrollbar will be created to scrollbar frame. |
TBool aHorizontal | If ETrue horizontal scrollbar will be created to scrollbar frame. |
DeleteScrollBars()
void | DeleteScrollBars | ( | ) | [private] |
DisconnectExternalScrollBar(CEikScrollBar *)
This method is used only internally by the CEikScrollBar. Disconnects externally connected scrollbar.
DrawBackground(TBool, TBool)
IMPORT_C TInt | DrawBackground | ( | TBool | aDrawHorizontal, |
| TBool | aDrawVertical |
| ) | |
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.
Parameters
TBool aDrawHorizontal | sets the state of the background drawing of the horizontal scrollbar. |
TBool aDrawVertical | sets the state of the background drawing of the vertical scrollbar. |
DrawBackgroundState(TBool &, TBool &)
IMPORT_C TInt | DrawBackgroundState | ( | TBool & | aDrawHorizontal, |
| TBool & | aDrawVertical |
| ) | |
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.
Parameters
TBool & aDrawHorizontal | gets the state of the background drawing of the horizontal scrollbar. |
TBool & aDrawVertical | gets the state of the background drawing of the vertical scrollbar. |
DrawScrollBarsDeferred()
void | DrawScrollBarsDeferred | ( | ) | const |
Tell scroll bars and the corner window to redraw if it is visible
DrawScrollBarsNow()
IMPORT_C void | DrawScrollBarsNow | ( | ) | const |
Forces any scroll bars and the corner window if it is visible to be redrawn.
GetCurrentCba()
CEikCba * | GetCurrentCba | ( | ) | [private] |
GetScrollBarHandle(CEikScrollBar::TOrientation)
Returns a pointer to the scroll bar identified by orientation aOrientation.
GetScrollBars(TBool)
void | GetScrollBars | ( | TBool | aDoubleSpan | ) | [private] |
HorizontalScrollBar()
Gets a pointer to the horizontal scroll bar.
InitExtension(CCoeControl *, MEikScrollBarObserver *)
IsArrowHeadScrollBar(TInt)
IMPORT_C TBool | IsArrowHeadScrollBar | ( | TInt | aFlag | ) | const |
Checks if the vertical scrollbar type is EArrowHead.
MakeSBarVisible(SBarData &, TBool)
MoveHorizThumbTo(TInt)
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.
Parameters
TInt aHorizThumbPos | The required thumb position. |
MoveThumbsBy(TInt, TInt)
IMPORT_C void | MoveThumbsBy | ( | TInt | aDeltaX, |
| TInt | aDeltaY |
| ) | |
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.
Parameters
TInt aDeltaX | The amount to move the horizontal scroll bar. |
TInt aDeltaY | The amount to move the vertical scroll bar. |
MoveVertThumbTo(TInt)
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.
Parameters
TInt aVertThumbPos | The required thumb position. |
ParentWindow()
Gets a pointer to the parent window.
ScrollBarBreadth(CEikScrollBar::TOrientation)
Returns the breadth of the scroll bar idenitified by aOrientation, or zero if none exists.
ScrollBarExists(CEikScrollBar::TOrientation)
Determines whether the scroll bar specified by aOrientation exists
ScrollBarFrameObserver()
Sets scrollbar observers.
ScrollBarVisibility(CEikScrollBar::TOrientation)
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()
SetAdjustsHorizontalModel(TBool)
IMPORT_C void | SetAdjustsHorizontalModel | ( | TBool | aAdjusts | ) | |
SetAdjustsVerticalModel(TBool)
IMPORT_C void | SetAdjustsVerticalModel | ( | TBool | aAdjusts | ) | |
SetParentWindow(CCoeControl *)
void | SetParentWindow | ( | CCoeControl * | aParentWindow | ) | [protected] |
Parameters
CCoeControl * aParentWindow | A pointer to the parent window. |
SetScrollBarFrameFlags(TInt)
void | SetScrollBarFrameFlags | ( | TInt | aMask | ) | [inline] |
Sets scrollbar frame flags.
Parameters
TInt aMask | Bitmask of the bits that are to be set. |
SetScrollBarFrameObserver(MEikScrollBarObserver *)
Sets scrollbar observers.
SetScrollBarVisibilityL(TScrollBarVisibility, TScrollBarVisibility)
Sets the visibility state for both the horizontal and the vertical scroll bars. This is used when tiling.
SetTypeOfHScrollBar(TScrollBarType)
Sets the type of horizontal scroll bar. Possible values are EArrowHead and EDoubleSpan.
SetTypeOfVScrollBar(TScrollBarType)
Sets the type of vertical scroll bar. Possible values are EArrowHead and EDoubleSpan.
SetVFocusPosToThumbPos(TInt)
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.
Parameters
TInt aFocusPosition | The required thumb position. |
Tile(TEikScrollBarModel *)
Sets the vertical scrollbar mode. Does not actually draw anything until the thumb or focus setting functions are called.
Tile(TEikScrollBarModel *, TRect &)
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.
- Since
- S60 2.6
For
EDoublespan type scrollbar the layout can be set also with a helper method from the
AknLayoutUtils class:
AknLayoutUtils::LayoutVerticalScrollBar(
CEikScrollBarFrame* aScrollBarFrame,
const TRect& aControlParent,
const TAknWindowLineLayout& aLayout);
Tile(TEikScrollBarModel *, TEikScrollBarModel *)
Sets the models of the scrollbars.
TileL(TEikScrollBarModel *, TEikScrollBarModel *, TRect &, TRect &, const TEikScrollBarFrameLayout &)
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);
TypeOfHScrollBar()
Returns the control type of the horizontal scroll bar
TypeOfVScrollBar()
Returns the control type of the vertical scroll bar
VerticalScrollBar()
Returns a pointer to the vertical scroll bar.
Member Enumerations Documentation
Enum TMarginsAdjustmentMode
Enum TScrollBarFrameFlags
Defines that is the horizontal or the vertical (spanned) scroll bar visible. Applicaple only for spanned scroll bars.
Enumerators
EHVisible = 0x01 |
Horizontal spanned scroll bar visible.
|
EVVisible = 0x02 |
Vertical spanned scroll bar visible.
|
EEnableNudgeButtons = 0x04 |
Enables nudge buttons in touch devices. This flag MUST be set before the creation of the doublespan scrollbar.
|
EDisableExpandedTouchArea = 0x08 |
Disables expanded touch area, which is on by default in touch devices. This flag MUST be set before the creation of the doublespan scrollbar.
|
Enum TScrollBarManagement
Determines how the scroll bar frame manages scroll bars.
Enumerators
EComponent |
The scroll bar frame creates, destroys and recreates, scroll bars according to the visibility mode. The scroll bar frame also acts as an intermediary with its owning control so that the scroll bars can be treated as component controls.
|
EFloating |
The scroll bar frame creates, destroys and recreates, scroll bars according to the visibility mode. In this case, the scroll bars are not treated as component controls. Instead, the scroll bars are geometry managed in windows floating above the control window and their position is determined in relation to the frame s position on the screen.
|
EApplicationScrollBar |
The scroll bar frame uses the central application scroll bar as held in the environment. This scroll bar is neither owned by the frame nor treated as a component control of the frame s owner.
|
Enum TScrollBarSide
Defines where the scroll bar is located.
Enumerators
EBottomOrRight = 0x0 |
Scroll bar located at the bottom, or to the right of the scroll bar frame.
|
ETopOrLeft = 0x800 |
Scroll bar located at the top, or to the left of the scroll bar frame.
|
Enum TScrollBarType
Defines the type of scroll bar.
Enumerators
ENormalScrollBar = 0x0 |
Scroll bar complete with shaft. Not used.
|
EArrowHead = 0x200 |
Floating arrow head scroll bar, without shaft. Legacy type.
|
EDoubleSpan = 0x400 |
Spanned scroll bar.
|
Enum TScrollBarVisibility
Defines the scroll bar s visibility.
Enumerators
EOff |
Scroll bar not visible.
|
EOn |
Scroll bar visible.
|
EAuto |
Scroll bar visible if required.
|
Member Data Documentation
CEikScrollBarFrameExtension * iExtension
TInt
iScrollBarFrameFlags
TInt
| iScrollBarFrameFlags | [private] |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.