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.
Protected Member Functions | |
---|---|
CCoeControl * | ParentWindow () |
void | SetParentWindow ( CCoeControl *) |
Private Member Functions | |
---|---|
void | ApplyModel ( SBarData &) |
void | CalcTheoreticalScrollBarVisibility (const TEikScrollBarModel *) |
void | CalcTheoreticalScrollBarVisibility (const TEikScrollBarModel *, const TEikScrollBarModel *) |
void | CreateArrowHeadScrollBarsL () |
void | DeleteScrollBars () |
CEikCba * | GetCurrentCba () |
void | GetScrollBars ( TBool ) |
void | MakeSBarVisible ( SBarData &, TBool ) |
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 } |
Private Member Enumerations | |
---|---|
enum | TMarginsAdjustmentMode { EGrow , EShrink } |
Protected Attributes | |
---|---|
SBarData | iV |
Private Attributes | |
---|---|
CEikScrollBarFrameExtension * | iExtension |
TInt | iScrollBarFrameFlags |
IMPORT_C | CEikScrollBarFrame | ( | CCoeControl * | aParentWindow, |
MEikScrollBarObserver * | aObserver, | |||
TBool | aPreAlloc = EFalse | |||
) |
Constructor. Constructs a scroll bar frame object.
CCoeControl * aParentWindow | The scroll bar s parent control. |
MEikScrollBarObserver * aObserver | The scroll bar observer. |
TBool aPreAlloc = EFalse | 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).
CCoeControl * aParentWindow | The scroll bar s parent control. |
MEikScrollBarObserver * aObserver | The scroll bar observer. |
TBool aPreAlloc | Not used. |
TBool aDoubleSpan | If ETrue, spanned scroll bar is created. |
void | CalcTheoreticalScrollBarVisibility | ( | const TEikScrollBarModel * | aVModel | ) | [private] |
const TEikScrollBarModel * aVModel |
void | CalcTheoreticalScrollBarVisibility | ( | const TEikScrollBarModel * | aVModel, |
const TEikScrollBarModel * | aHModel | |||
) | [private] |
const TEikScrollBarModel * aVModel | |
const TEikScrollBarModel * aHModel |
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.
TInt aIndex |
IMPORT_C void | CreateDoubleSpanScrollBarsL | ( | TBool | aWindowOwning, |
TBool | aRemote | |||
) |
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);
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. |
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.
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. |
void | DisconnectExternalScrollBar | ( | CEikScrollBar * | aScrollBar | ) |
This method is used only internally by the CEikScrollBar . Disconnects externally connected scrollbar.
CEikScrollBar * aScrollBar | Scrollbar to be disconnected. |
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.
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.
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 .
CEikScrollBar::TOrientation aOrientation | The orientation of the scroll bar for which you wish to obtain a pointer. |
void | GetScrollBars | ( | TBool | aDoubleSpan | ) | [private] |
TBool aDoubleSpan |
CEikScrollBar * | HorizontalScrollBar | ( | ) | const |
Gets a pointer to the horizontal scroll bar.
void | InitExtension | ( | CCoeControl * | aParentWindow, |
MEikScrollBarObserver * | aObserver | |||
) |
Initializes a new CEikScrollBarFrameExtension object.
CCoeControl * aParentWindow | The scroll bar s parent control. |
MEikScrollBarObserver * aObserver | The scroll bar observer. |
IMPORT_C TBool | IsArrowHeadScrollBar | ( | TInt | aFlag | ) | const |
Checks if the vertical scrollbar type is EArrowHead .
TInt aFlag | Not used. |
void | MakeSBarVisible | ( | SBarData & | aSBar, |
TBool | aVisible | |||
) | [private] |
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.
TInt aHorizThumbPos | The required thumb position. |
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.
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.
TInt aVertThumbPos | The required thumb position. |
CCoeControl * | ParentWindow | ( | ) | const [protected] |
Gets 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.
CEikScrollBar::TOrientation aOrientation | The orientation of the scroll bar for which you wish to obtain the breadth. |
IMPORT_C TBool | ScrollBarExists | ( | CEikScrollBar::TOrientation | aOrientation | ) | const |
Determines whether the scroll bar specified by aOrientation exists
CEikScrollBar::TOrientation aOrientation | The scroll bar s orientation. |
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()
CEikScrollBar::TOrientation aOrientation | The orientation of a scrollbar in the frame. |
IMPORT_C void | SetAdjustsHorizontalModel | ( | TBool | aAdjusts | ) |
Not implemented.
TBool aAdjusts | Not used. |
IMPORT_C void | SetAdjustsVerticalModel | ( | TBool | aAdjusts | ) |
Not implemented.
TBool aAdjusts | Not used. |
void | SetParentWindow | ( | CCoeControl * | aParentWindow | ) | [protected] |
Sets parent window.
CCoeControl * aParentWindow | A pointer to the parent window. |
void | SetScrollBarFrameFlags | ( | TInt | aMask | ) | [inline] |
Sets scrollbar frame flags.
TInt aMask | Bitmask of the bits that are to be set. |
IMPORT_C void | SetScrollBarFrameObserver | ( | MEikScrollBarObserver * | aObserver | ) |
Sets scrollbar observers.
MEikScrollBarObserver * 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.
TScrollBarVisibility aHVisibility | Horizontal scroll bar visibility. |
TScrollBarVisibility aVVisibility | Vertical scroll bar visibility. |
IMPORT_C void | SetTypeOfHScrollBar | ( | TScrollBarType | aType | ) |
Sets the type of horizontal scroll bar. Possible values are EArrowHead and EDoubleSpan .
TScrollBarType aType | Type of the scrollbar. |
IMPORT_C void | SetTypeOfVScrollBar | ( | TScrollBarType | aType | ) |
Sets the type of vertical scroll bar. Possible values are EArrowHead and EDoubleSpan .
TScrollBarType 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.
TInt 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.
TEikScrollBarModel * aVModel | Model for the vertical scrollbar. |
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);
TEikScrollBarModel * aVModel | Vertical scrollbar model. |
TRect & aVScrollBar | Vertical scrollbar rectangle. |
IMPORT_C void | Tile | ( | TEikScrollBarModel * | aHModel, |
TEikScrollBarModel * | aVModel | |||
) |
Sets the models of the scrollbars.
TEikScrollBarModel * aHModel | The model of the horizontal scrollbar. |
TEikScrollBarModel * 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);
TEikScrollBarModel * aHModel | Horizontal scroll bar model. |
TEikScrollBarModel * aVModel | Vertical scroll bar model. |
TRect & aClientRect | Client rectangle. |
TRect & aInclusiveRect | A rectangle that includes the area to be scrolled and the scroll bars themselves. |
const TEikScrollBarFrameLayout & aLayout | Tiling layout. |
IMPORT_C TScrollBarType | TypeOfHScrollBar | ( | ) | const |
Returns the control type of the horizontal scroll bar
IMPORT_C TScrollBarType | TypeOfVScrollBar | ( | ) | const |
Returns the control type of the vertical scroll bar
TScrollBarVisibility | VScrollBarVisibility | ( | ) | const [inline] |
Determines the vertical scroll bar s visibility. CEikScrollBarFrame::ScrollBarVisibility ( CEikScrollBar::TOrientation aOrientation) can be used instead of this method.
IMPORT_C CEikScrollBar * | VerticalScrollBar | ( | ) | const |
Returns a pointer to the vertical scroll bar.
Defines that is the horizontal or the vertical (spanned) scroll bar visible. Applicaple only for spanned scroll bars.
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. |
Determines how the scroll bar frame manages scroll bars.
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. |
Defines where the scroll bar is located.
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. |
Defines the type of scroll bar.
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. |
Defines the scroll bar s visibility.
EOff |
Scroll bar not visible. |
EOn |
Scroll bar visible. |
EAuto |
Scroll bar visible if required. |
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.