CEikScrollBarFrame Class Reference

#include <mw/eiksbfrm.h>

Link against: mpxalbumarteditordialog.lib

class CEikScrollBarFrame : public CBase

Inherits from

  • CEikScrollBarFrame

    Nested Classes and Structures

    Protected Attributes
    SBarData iV
    Public Member Enumerations
    enumanonymous { ETypeId }
    enumTScrollBarFrameFlags { EHVisible, EVVisible, EEnableNudgeButtons, EDisableExpandedTouchArea }
    enumTScrollBarManagement { EComponent, EFloating, EApplicationScrollBar }
    enumTScrollBarSide { EBottomOrRight, ETopOrLeft }
    enumTScrollBarType { ENormalScrollBar, EArrowHead, EDoubleSpan }
    enumTScrollBarVisibility { EOff, EOn, EAuto }
    Public Member Functions
    CEikScrollBarFrame()
    CEikScrollBarFrame(CCoeControl *, MEikScrollBarObserver *, TBool)
    CEikScrollBarFrame(CCoeControl *, MEikScrollBarObserver *, TBool, TBool)
    ~CEikScrollBarFrame()
    IMPORT_C CCoeControl *ComponentControl(TInt)
    IMPORT_C TIntCountComponentControls()
    IMPORT_C voidCreateDoubleSpanScrollBarsL(TBool, TBool)
    IMPORT_C voidCreateDoubleSpanScrollBarsL(TBool, TBool, TBool, TBool)
    voidDisconnectExternalScrollBar(CEikScrollBar *)
    IMPORT_C TIntDrawBackground(TBool, TBool)
    IMPORT_C TIntDrawBackgroundState(TBool &, TBool &)
    voidDrawScrollBarsDeferred()
    IMPORT_C voidDrawScrollBarsNow()
    IMPORT_C CEikScrollBar *GetScrollBarHandle(CEikScrollBar::TOrientation)
    CEikScrollBar *HorizontalScrollBar()
    voidInitExtension(CCoeControl *, MEikScrollBarObserver *)
    IMPORT_C TBoolIsArrowHeadScrollBar(TInt)
    IMPORT_C voidMoveHorizThumbTo(TInt)
    IMPORT_C voidMoveThumbsBy(TInt, TInt)
    IMPORT_C voidMoveVertThumbTo(TInt)
    IMPORT_C TIntScrollBarBreadth(CEikScrollBar::TOrientation)
    IMPORT_C TBoolScrollBarExists(CEikScrollBar::TOrientation)
    MEikScrollBarObserver *ScrollBarFrameObserver()
    IMPORT_C TScrollBarVisibilityScrollBarVisibility(CEikScrollBar::TOrientation)
    IMPORT_C voidSetAdjustsHorizontalModel(TBool)
    IMPORT_C voidSetAdjustsVerticalModel(TBool)
    voidSetScrollBarFrameFlags(TInt)
    IMPORT_C voidSetScrollBarFrameObserver(MEikScrollBarObserver *)
    IMPORT_C voidSetScrollBarVisibilityL(TScrollBarVisibility, TScrollBarVisibility)
    IMPORT_C voidSetTypeOfHScrollBar(TScrollBarType)
    IMPORT_C voidSetTypeOfVScrollBar(TScrollBarType)
    IMPORT_C voidSetVFocusPosToThumbPos(TInt)
    IMPORT_C TBoolTile(TEikScrollBarModel *)
    IMPORT_C voidTile(TEikScrollBarModel *, TRect &)
    IMPORT_C voidTile(TEikScrollBarModel *, TEikScrollBarModel *)
    IMPORT_C TBoolTileL(TEikScrollBarModel *, TEikScrollBarModel *, TRect &, TRect &, const TEikScrollBarFrameLayout &)
    IMPORT_C TScrollBarTypeTypeOfHScrollBar()
    IMPORT_C TScrollBarTypeTypeOfVScrollBar()
    TScrollBarVisibility VScrollBarVisibility()
    IMPORT_C CEikScrollBar *VerticalScrollBar()
    Protected Member Functions
    CCoeControl *ParentWindow()
    voidSetParentWindow(CCoeControl *)
    Inherited Functions
    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()

    Detailed Description

    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.

    Member Attribute Documentation

    iV

    SBarData iV[protected]

    Struct object.

    Member Enumeration Documentation

    Enum anonymous

    EnumeratorValueDescription
    ETypeId0x101F8672

    Enum TScrollBarFrameFlags

    Defines that is the horizontal or the vertical (spanned) scroll bar visible. Applicaple only for spanned scroll bars.

    EnumeratorValueDescription
    EHVisible0x01

    Horizontal spanned scroll bar visible.

    EVVisible0x02

    Vertical spanned scroll bar visible.

    EEnableNudgeButtons0x04

    Enables nudge buttons in touch devices. This flag MUST be set before the creation of the doublespan scrollbar.

    EDisableExpandedTouchArea0x08

    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.

    EnumeratorValueDescription
    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.

    EnumeratorValueDescription
    EBottomOrRight0x0

    Scroll bar located at the bottom, or to the right of the scroll bar frame.

    ETopOrLeft0x800

    Scroll bar located at the top, or to the left of the scroll bar frame.

    Enum TScrollBarType

    Defines the type of scroll bar.

    EnumeratorValueDescription
    ENormalScrollBar0x0

    Scroll bar complete with shaft. Not used.

    EArrowHead0x200

    Floating arrow head scroll bar, without shaft. Legacy type.

    EDoubleSpan0x400

    Spanned scroll bar.

    Enum TScrollBarVisibility

    Defines the scroll bar s visibility.

    EnumeratorValueDescription
    EOff

    Scroll bar not visible.

    EOn

    Scroll bar visible.

    EAuto

    Scroll bar visible if required.

    Constructor & Destructor Documentation

    CEikScrollBarFrame ( )

    CEikScrollBarFrame()[inline]

    C++ default constructor.

    CEikScrollBarFrame ( CCoeControl *, MEikScrollBarObserver *, TBool )

    IMPORT_CCEikScrollBarFrame(CCoeControl *aParentWindow,
    MEikScrollBarObserver *aObserver,
    TBoolaPreAlloc = EFalse
    )

    Constructor. Constructs a scroll bar frame object.

    ParameterDescription
    aParentWindowThe scroll bar s parent control.
    aObserverThe scroll bar observer.
    aPreAllocNot used.

    CEikScrollBarFrame ( CCoeControl *, MEikScrollBarObserver *, TBool, TBool )

    CEikScrollBarFrame(CCoeControl *aParentWindow,
    MEikScrollBarObserver *aObserver,
    TBoolaPreAlloc,
    TBoolaDoubleSpan
    )

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

    Since
    S60 3.0
    ParameterDescription
    aParentWindowThe scroll bar s parent control.
    aObserverThe scroll bar observer.
    aPreAllocNot used.
    aDoubleSpanIf ETrue, spanned scroll bar is created.

    ~CEikScrollBarFrame ( )

    IMPORT_C~CEikScrollBarFrame()

    Destructor.

    Member Function Documentation

    ComponentControl ( TInt )

    IMPORT_C CCoeControl *ComponentControl(TIntaIndex)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

    CountComponentControls ( )

    IMPORT_C TIntCountComponentControls()const

    From CCoeControl

    Gets the number of controls contained in a compound control.

    Returns: The number of component controls contained in this control.

    CreateDoubleSpanScrollBarsL ( TBool, TBool )

    IMPORT_C voidCreateDoubleSpanScrollBarsL(TBoolaWindowOwning,
    TBoolaRemote
    )

    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);
    ParameterDescription
    aWindowOwningTells wheter created scrollbar should be a window owning control or not. Selection for this is relevant especially because skinned scrollbar draws
    aRemoteTrue 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 voidCreateDoubleSpanScrollBarsL(TBoolaWindowOwning,
    TBoolaRemote,
    TBoolaVertical,
    TBoolaHorizontal
    )

    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.
    ParameterDescription
    aWindowOwningTells 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.
    aRemoteTrue 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.
    aVerticalIf ETrue vertical scrollbar will be created to scrollbar frame.
    aHorizontalIf ETrue horizontal scrollbar will be created to scrollbar frame.

    DisconnectExternalScrollBar ( CEikScrollBar * )

    voidDisconnectExternalScrollBar(CEikScrollBar *aScrollBar)

    This method is used only internally by the CEikScrollBar. Disconnects externally connected scrollbar.

    ParameterDescription
    aScrollBarScrollbar to be disconnected.

    DrawBackground ( TBool, TBool )

    IMPORT_C TIntDrawBackground(TBoolaDrawHorizontal,
    TBoolaDrawVertical
    )

    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.

    Since
    3.0
    ParameterDescription
    aDrawHorizontalsets the state of the background drawing of the horizontal scrollbar.
    aDrawVerticalsets the state of the background drawing of the vertical scrollbar.

    Returns: Success of the call, KErrNotSupported if the scrollbars are not doublespan scrollbars.

    DrawBackgroundState ( TBool &, TBool & )

    IMPORT_C TIntDrawBackgroundState(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.

    Since
    3.0
    ParameterDescription
    aDrawHorizontalgets the state of the background drawing of the horizontal scrollbar.
    aDrawVerticalgets the state of the background drawing of the vertical scrollbar.

    Returns: Success of the call, KErrNotSupported if the scrollbars are not doublespan scrollbars.

    DrawScrollBarsDeferred ( )

    voidDrawScrollBarsDeferred()const

    Tell scroll bars and the corner window to redraw if it is visible

    DrawScrollBarsNow ( )

    IMPORT_C voidDrawScrollBarsNow()const

    Forces any scroll bars and the corner window if it is visible to be redrawn.

    GetScrollBarHandle ( CEikScrollBar::TOrientation )

    IMPORT_C CEikScrollBar *GetScrollBarHandle(CEikScrollBar::TOrientationaOrientation)const

    Returns a pointer to the scroll bar identified by orientation aOrientation.

    ParameterDescription
    aOrientationThe 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.

    HorizontalScrollBar ( )

    CEikScrollBar *HorizontalScrollBar()const

    Gets a pointer to the horizontal scroll bar.

    Returns: A pointer to the horizontal scroll bar.

    InitExtension ( CCoeControl *, MEikScrollBarObserver * )

    voidInitExtension(CCoeControl *aParentWindow,
    MEikScrollBarObserver *aObserver
    )

    Initializes a new CEikScrollBarFrameExtension object.

    Since
    S60 3.0
    ParameterDescription
    aParentWindowThe scroll bar s parent control.
    aObserverThe scroll bar observer.

    IsArrowHeadScrollBar ( TInt )

    IMPORT_C TBoolIsArrowHeadScrollBar(TIntaFlag)const

    Checks if the vertical scrollbar type is EArrowHead.

    ParameterDescription
    aFlagNot used.

    Returns: ETrue if the type of the scrollbar is EArrowHead.

    MoveHorizThumbTo ( TInt )

    IMPORT_C voidMoveHorizThumbTo(TIntaHorizThumbPos)

    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.

    ParameterDescription
    aHorizThumbPosThe required thumb position.

    MoveThumbsBy ( TInt, TInt )

    IMPORT_C voidMoveThumbsBy(TIntaDeltaX,
    TIntaDeltaY
    )

    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.

    ParameterDescription
    aDeltaXThe amount to move the horizontal scroll bar.
    aDeltaYThe amount to move the vertical scroll bar.

    MoveVertThumbTo ( TInt )

    IMPORT_C voidMoveVertThumbTo(TIntaVertThumbPos)

    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.

    ParameterDescription
    aVertThumbPosThe required thumb position.

    ParentWindow ( )

    CCoeControl *ParentWindow()const [protected]

    Gets a pointer to the parent window.

    Returns: A pointer to the parent window.

    ScrollBarBreadth ( CEikScrollBar::TOrientation )

    IMPORT_C TIntScrollBarBreadth(CEikScrollBar::TOrientationaOrientation)const

    Returns the breadth of the scroll bar idenitified by aOrientation, or zero if none exists.

    ParameterDescription
    aOrientationThe 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.

    ScrollBarExists ( CEikScrollBar::TOrientation )

    IMPORT_C TBoolScrollBarExists(CEikScrollBar::TOrientationaOrientation)const

    Determines whether the scroll bar specified by aOrientation exists

    ParameterDescription
    aOrientationThe scroll bar s orientation.

    Returns: ETrue if the specified scroll bar exists otherwise EFalse.

    ScrollBarFrameObserver ( )

    MEikScrollBarObserver *ScrollBarFrameObserver()

    Sets scrollbar observers.

    ScrollBarVisibility ( CEikScrollBar::TOrientation )

    IMPORT_C TScrollBarVisibilityScrollBarVisibility(CEikScrollBar::TOrientationaOrientation)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()

    Since
    S60 2.6
    ParameterDescription
    aOrientationThe orientation of a scrollbar in the frame.

    Returns: The visibility of requested scrollbar.

    SetAdjustsHorizontalModel ( TBool )

    IMPORT_C voidSetAdjustsHorizontalModel(TBoolaAdjusts)

    Not implemented.

    ParameterDescription
    aAdjustsNot used.

    SetAdjustsVerticalModel ( TBool )

    IMPORT_C voidSetAdjustsVerticalModel(TBoolaAdjusts)

    Not implemented.

    ParameterDescription
    aAdjustsNot used.

    SetParentWindow ( CCoeControl * )

    voidSetParentWindow(CCoeControl *aParentWindow)[protected]

    Sets parent window.

    ParameterDescription
    aParentWindowA pointer to the parent window.

    SetScrollBarFrameFlags ( TInt )

    voidSetScrollBarFrameFlags(TIntaMask)[inline]

    Sets scrollbar frame flags.

    ParameterDescription
    aMaskBitmask of the bits that are to be set.

    SetScrollBarFrameObserver ( MEikScrollBarObserver * )

    IMPORT_C voidSetScrollBarFrameObserver(MEikScrollBarObserver *aObserver)

    Sets scrollbar observers.

    ParameterDescription
    aObserverThe scroll bar observer.

    SetScrollBarVisibilityL ( TScrollBarVisibility, TScrollBarVisibility )

    IMPORT_C voidSetScrollBarVisibilityL(TScrollBarVisibilityaHVisibility,
    TScrollBarVisibilityaVVisibility
    )

    Sets the visibility state for both the horizontal and the vertical scroll bars. This is used when tiling.

    ParameterDescription
    aHVisibilityHorizontal scroll bar visibility.
    aVVisibilityVertical scroll bar visibility.

    SetTypeOfHScrollBar ( TScrollBarType )

    IMPORT_C voidSetTypeOfHScrollBar(TScrollBarTypeaType)

    Sets the type of horizontal scroll bar. Possible values are EArrowHead and EDoubleSpan.

    ParameterDescription
    aTypeType of the scrollbar.

    SetTypeOfVScrollBar ( TScrollBarType )

    IMPORT_C voidSetTypeOfVScrollBar(TScrollBarTypeaType)

    Sets the type of vertical scroll bar. Possible values are EArrowHead and EDoubleSpan.

    ParameterDescription
    aTypeType of the scrollbar.

    SetVFocusPosToThumbPos ( TInt )

    IMPORT_C voidSetVFocusPosToThumbPos(TIntaFocusPosition)

    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.

    ParameterDescription
    aFocusPositionThe required thumb position.

    Tile ( TEikScrollBarModel * )

    IMPORT_C TBoolTile(TEikScrollBarModel *aVModel)

    Sets the vertical scrollbar mode. Does not actually draw anything until the thumb or focus setting functions are called.

    ParameterDescription
    aVModelModel for the vertical scrollbar.

    Returns: EFalse.

    Tile ( TEikScrollBarModel *, TRect & )

    IMPORT_C voidTile(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.

    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);
    ParameterDescription
    aVModelVertical scrollbar model.
    aVScrollBarVertical scrollbar rectangle.

    Tile ( TEikScrollBarModel *, TEikScrollBarModel * )

    IMPORT_C voidTile(TEikScrollBarModel *aHModel,
    TEikScrollBarModel *aVModel
    )

    Sets the models of the scrollbars.

    Since
    S60 2.6
    ParameterDescription
    aHModelThe model of the horizontal scrollbar.
    aVModelThe model of the vertical scrollbar.

    TileL ( TEikScrollBarModel *, TEikScrollBarModel *, TRect &, TRect &, const TEikScrollBarFrameLayout & )

    IMPORT_C TBoolTileL(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);

    ParameterDescription
    aHModelHorizontal scroll bar model.
    aVModelVertical scroll bar model.
    aClientRectClient rectangle.
    aInclusiveRectA rectangle that includes the area to be scrolled and the scroll bars themselves.
    aLayoutTiling layout.

    Returns: ETrue if the non-constant rectangle is adjusted, otherwise EFalse.

    TypeOfHScrollBar ( )

    IMPORT_C TScrollBarTypeTypeOfHScrollBar()const

    Returns the control type of the horizontal scroll bar

    Returns: Type of the scrollbar.

    TypeOfVScrollBar ( )

    IMPORT_C TScrollBarTypeTypeOfVScrollBar()const

    Returns the control type of the vertical scroll bar

    Returns: Type of the scrollbar.

    VScrollBarVisibility ( )

    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.

    VerticalScrollBar ( )

    IMPORT_C CEikScrollBar *VerticalScrollBar()const

    Returns a pointer to the vertical scroll bar.

    Returns: A pointer to the vertical scroll bar.