williamr@2: /* williamr@2: * Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #if !defined(__EIKSBFRM_H__) williamr@2: #define __EIKSBFRM_H__ williamr@2: williamr@2: #include williamr@2: #if !defined(__AKNSCRLB_H__) williamr@2: #include williamr@2: #endif williamr@2: williamr@2: class CEikCba; williamr@2: williamr@2: /** williamr@2: * Enables setting of the frame layout for a scroll bar. williamr@2: */ williamr@2: class TEikScrollBarFrameLayout williamr@2: { williamr@2: williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Determines whether the client rectangle or the inclusive rectangle williamr@2: * remains constant. williamr@2: */ williamr@2: enum TTilingMode williamr@2: { williamr@2: williamr@2: /** The client rectangle remains constant. */ williamr@2: EClientRectConstant, williamr@2: williamr@2: /** The inclusive rectangle remains constant. */ williamr@2: EInclusiveRectConstant williamr@2: }; williamr@2: williamr@2: public: williamr@2: williamr@2: /** williamr@2: * C++ default constructor. williamr@2: */ williamr@2: IMPORT_C TEikScrollBarFrameLayout(); williamr@2: williamr@2: /** williamr@2: * Sets all inclusive margins. williamr@2: * williamr@2: * @param aMargin The value to use for all inclusive margins. williamr@2: */ williamr@2: IMPORT_C void SetInclusiveMargin(TInt aMargin); williamr@2: williamr@2: /** williamr@2: * Sets all client margins. These surround the client rectangle which is williamr@2: * the client area viewport onto the larger canvas to be scrolled. williamr@2: * williamr@2: * @param aMargin The value to use for all client margins. williamr@2: */ williamr@2: IMPORT_C void SetClientMargin(TInt aMargin); williamr@2: williamr@2: public: williamr@2: williamr@2: /** The inclusive margin (in twips or pixels). */ williamr@2: TMargins iInclusiveMargin; williamr@2: williamr@2: /** williamr@2: * The amount of screen movement performed when the nudge button is williamr@2: * pressed. williamr@2: */ williamr@2: TMargins iClientMargin; williamr@2: williamr@2: /** williamr@2: * The amount of screen movement performed when the nudge button is williamr@2: * pressed. williamr@2: */ williamr@2: TSize iClientAreaGranularity; williamr@2: williamr@2: /** williamr@2: * Determines whether the client rectangle, or the inclusive rectangle, williamr@2: * remains constant. williamr@2: */ williamr@2: TTilingMode iTilingMode; williamr@2: }; williamr@2: williamr@2: williamr@2: class CEikCornerWindow; williamr@2: class CEikScrollBarFrameExtension; williamr@2: williamr@2: /** williamr@2: * The scroll bar frame is a control assemblage manager that relates a control, williamr@2: * or control body, to two scroll bars and a corner window. A corner window is williamr@2: * that part of the screen that is common to both the horizontal, and the williamr@2: * vertical elements of a scroll bar. williamr@2: * williamr@2: * This class helps with access to, and set up of, scroll bars and also with williamr@2: * the layout of the scrolled control or control body. A scroll bar frame is williamr@2: * not a control, but it does implement the standard control composite pattern williamr@2: * to manage the assemblage. williamr@2: */ williamr@2: class CEikScrollBarFrame : public CBase williamr@2: { williamr@2: williamr@2: public: // enums williamr@2: williamr@2: DECLARE_TYPE_ID(0x101F8672) williamr@2: williamr@2: /** Defines the scroll bar’s visibility.*/ williamr@2: enum TScrollBarVisibility williamr@2: { williamr@2: /** Scroll bar not visible.*/ williamr@2: EOff, williamr@2: williamr@2: /** Scroll bar visible.*/ williamr@2: EOn, williamr@2: williamr@2: /** Scroll bar visible if required.*/ williamr@2: EAuto williamr@2: }; williamr@2: williamr@2: /** Defines the type of scroll bar.*/ williamr@2: enum TScrollBarType williamr@2: { williamr@2: /** Scroll bar complete with shaft. Not used.*/ williamr@2: ENormalScrollBar =0x0, williamr@2: williamr@2: /** Floating arrow head scroll bar, without shaft. Legacy type. */ williamr@2: EArrowHead =0x200, williamr@2: williamr@2: /** Spanned scroll bar. */ williamr@2: EDoubleSpan =0x400 williamr@2: }; williamr@2: williamr@2: /** Defines where the scroll bar is located. */ williamr@2: enum TScrollBarSide williamr@2: { williamr@2: /** williamr@2: * Scroll bar located at the bottom, or to the right of the scroll bar williamr@2: * frame. williamr@2: */ williamr@2: EBottomOrRight =0x0, williamr@2: williamr@2: /** williamr@2: * Scroll bar located at the top, or to the left of the scroll bar williamr@2: * frame. williamr@2: */ williamr@2: ETopOrLeft =0x800 williamr@2: }; williamr@2: williamr@2: /** Determines how the scroll bar frame manages scroll bars.*/ williamr@2: enum TScrollBarManagement williamr@2: { williamr@2: /** williamr@2: * The scroll bar frame creates, destroys and recreates, scroll bars williamr@2: * according to the visibility mode. The scroll bar frame also acts as williamr@2: * an intermediary with its owning control so that the scroll bars can williamr@2: * be treated as component controls. williamr@2: */ williamr@2: EComponent ,//=SLafScrollBarFrame::EComponent, williamr@2: williamr@2: /** williamr@2: * The scroll bar frame creates, destroys and recreates, scroll bars williamr@2: * according to the visibility mode. In this case, the scroll bars are williamr@2: * not treated as component controls. Instead, the scroll bars are williamr@2: * geometry managed in windows floating above the control window and williamr@2: * their position is determined in relation to the frame’s position on williamr@2: * the screen. williamr@2: */ williamr@2: EFloating ,//=SLafScrollBarFrame::EFloating, williamr@2: williamr@2: /** williamr@2: * The scroll bar frame uses the central application scroll bar as held williamr@2: * in the environment. This scroll bar is neither owned by the frame williamr@2: * nor treated as a component control of the frame’s owner. williamr@2: */ williamr@2: EApplicationScrollBar //=SLafScrollBarFrame::EApplicationScrollBar williamr@2: }; williamr@2: williamr@2: /** williamr@2: * Defines that is the horizontal or the vertical (spanned) scroll bar williamr@2: * visible. Applicaple only for spanned scroll bars. williamr@2: */ williamr@2: enum TScrollBarFrameFlags williamr@2: { williamr@2: /** Horizontal spanned scroll bar visible. */ williamr@2: EHVisible =0x01, williamr@2: williamr@2: /** Vertical spanned scroll bar visible. */ williamr@2: EVVisible =0x02, williamr@2: williamr@2: /** williamr@2: * Enables nudge buttons in touch devices. This flag MUST williamr@2: * be set before the creation of the doublespan scrollbar. williamr@2: */ williamr@2: EEnableNudgeButtons = 0x04, williamr@2: williamr@2: /** williamr@2: * Disables expanded touch area, which is on by default williamr@2: * in touch devices. This flag MUST be set before the williamr@2: * creation of the doublespan scrollbar. williamr@2: */ williamr@2: EDisableExpandedTouchArea = 0x08 williamr@2: }; williamr@2: private: williamr@2: enum TMarginsAdjustmentMode williamr@2: { williamr@2: EGrow, williamr@2: EShrink williamr@2: }; williamr@2: williamr@2: public: // specific williamr@2: williamr@2: /** williamr@2: * C++ default constructor. williamr@2: */ williamr@2: CEikScrollBarFrame(){} williamr@2: williamr@2: /** williamr@2: * Constructor. Constructs a scroll bar frame object. williamr@2: * williamr@2: * @param aParentWindow The scroll bar’s parent control. williamr@2: * @param aObserver The scroll bar observer. williamr@2: * @param aPreAlloc Not used. williamr@2: */ williamr@2: IMPORT_C CEikScrollBarFrame(CCoeControl* aParentWindow, williamr@2: MEikScrollBarObserver* aObserver, williamr@2: TBool aPreAlloc=EFalse); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C ~CEikScrollBarFrame(); williamr@2: williamr@2: /** williamr@2: * Constructor. Internal only to Eikcoctl.lib use. Parameter @c aDoubleSpan williamr@2: * offers possibility to optimize scroll bar loading (if @c ETrue, williamr@2: * arrowhead scroll bar will never be loaded). williamr@2: * williamr@2: * @since S60 3.0 williamr@2: * @param aParentWindow The scroll bar’s parent control. williamr@2: * @param aObserver The scroll bar observer. williamr@2: * @param aPreAlloc Not used. williamr@2: * @param aDoubleSpan If @c ETrue, spanned scroll bar is created. williamr@2: */ williamr@2: CEikScrollBarFrame(CCoeControl* aParentWindow, williamr@2: MEikScrollBarObserver* aObserver, williamr@2: TBool aPreAlloc, williamr@2: TBool aDoubleSpan); williamr@2: williamr@2: /** williamr@2: * Initializes a new @c CEikScrollBarFrameExtension object. williamr@2: * williamr@2: * @since S60 3.0 williamr@2: * @param aParentWindow The scroll bar’s parent control. williamr@2: * @param aObserver The scroll bar observer. williamr@2: */ williamr@2: void InitExtension(CCoeControl* aParentWindow, williamr@2: MEikScrollBarObserver* aObserver); williamr@2: williamr@2: /** williamr@2: * Forces any scroll bars and the corner window if it is visible to be williamr@2: * redrawn. williamr@2: */ williamr@2: IMPORT_C void DrawScrollBarsNow() const; williamr@2: williamr@2: /** williamr@2: * Tell scroll bars and the corner window to redraw if it is visible williamr@2: */ williamr@2: void DrawScrollBarsDeferred() const; williamr@2: williamr@2: /** williamr@2: * Sets the visibility state for both the horizontal and the vertical scroll williamr@2: * bars. This is used when tiling. williamr@2: * williamr@2: * @param aHVisibility Horizontal scroll bar visibility. williamr@2: * @param aVVisibility Vertical scroll bar visibility. williamr@2: */ williamr@2: IMPORT_C void SetScrollBarVisibilityL(TScrollBarVisibility aHVisibility, williamr@2: TScrollBarVisibility aVVisibility); williamr@2: williamr@2: /** williamr@2: * Determines the vertical scroll bar’s visibility. @c williamr@2: * CEikScrollBarFrame::ScrollBarVisibility @c williamr@2: * (CEikScrollBar::TOrientation aOrientation) can be used instead of this williamr@2: * method. williamr@2: * williamr@2: * @return Visibility for vertical scroll bar. williamr@2: */ williamr@2: inline TScrollBarVisibility VScrollBarVisibility() const; williamr@2: williamr@2: /** williamr@2: * Sets scrollbar observers. williamr@2: * williamr@2: * @param aObserver The scroll bar observer. williamr@2: */ williamr@2: IMPORT_C void SetScrollBarFrameObserver(MEikScrollBarObserver* aObserver); williamr@2: williamr@2: // Model setting. williamr@2: williamr@2: /** williamr@2: * Sets the vertical scrollbar mode. Does not actually draw anything until williamr@2: * the thumb or focus setting functions are called. williamr@2: * williamr@2: * @param aVModel Model for the vertical scrollbar. williamr@2: * @return @c EFalse. williamr@2: */ williamr@2: IMPORT_C TBool Tile(TEikScrollBarModel* aVModel); williamr@2: williamr@2: /** williamr@2: * Tiles the client area and the scroll bars managed by the frame. The williamr@2: * scroll bars are set up according to the scroll bar models; @c aHModel and williamr@2: * @c aVModel. Ownership is not transferred as a result of passing these williamr@2: * parameters as pointers. The result of tiling geometry management is williamr@2: * observable through the two rectangles @c aClientRect and @c williamr@2: * aInclusiveRect. Depending on the tiling layout @c aLayout and the scroll williamr@2: * bar visibility settings, either of these rectangles can be made constant williamr@2: * and the other rectangle adjusted accordingly. williamr@2: * williamr@2: * For @c EArrowhead type scrollbar the layout is always fixed, it cannot be williamr@2: * altered by using this method. williamr@2: * williamr@2: * For @c EDoublespan type scrollbar the layout can be set also with two williamr@2: * helper methods from the @c AknLayoutUtils class: williamr@2: * williamr@2: * @code williamr@2: * AknLayoutUtils::LayoutVerticalScrollBar( williamr@2: * CEikScrollBarFrame* aScrollBarFrame, williamr@2: * const TRect& aControlParent, williamr@2: * const TAknWindowLineLayout& aLayout); williamr@2: * AknLayoutUtils::LayoutHorizontalScrollBar( williamr@2: * CEikScrollBarFrame* aScrollBarFrame, williamr@2: * const TRect& aControlParent, williamr@2: * const TAknWindowLineLayout& aLayout); williamr@2: * @endcode williamr@2: * williamr@2: * @param aHModel Horizontal scroll bar model. williamr@2: * @param aVModel Vertical scroll bar model. williamr@2: * @param aClientRect Client rectangle. williamr@2: * @param aInclusiveRect A rectangle that includes the area to be scrolled williamr@2: * and the scroll bars themselves. williamr@2: * @param aLayout Tiling layout. williamr@2: * williamr@2: * @return @c ETrue if the non-constant rectangle is adjusted, otherwise @c williamr@2: * EFalse. williamr@2: */ williamr@2: IMPORT_C TBool TileL(TEikScrollBarModel* aHModel, williamr@2: TEikScrollBarModel* aVModel, williamr@2: TRect& aClientRect, williamr@2: TRect& aInclusiveRect, williamr@2: const TEikScrollBarFrameLayout& aLayout); williamr@2: williamr@2: /** williamr@2: * Moves the scroll bar thumbs by the specified amounts. This updates the williamr@2: * scroll bars after an external scroll. The values of the parameters should williamr@2: * be supplied in terms of the horizontal and vertical scrolling models williamr@2: * respectively. The scrolling models are presumed not to have changed williamr@2: * spans. williamr@2: * williamr@2: * @param aDeltaX The amount to move the horizontal scroll bar. williamr@2: * @param aDeltaY The amount to move the vertical scroll bar. williamr@2: */ williamr@2: IMPORT_C void MoveThumbsBy(TInt aDeltaX, TInt aDeltaY); williamr@2: williamr@2: /** williamr@2: * Moves the horizontal scroll bar thumb to the position @c aHorizThumbPos. williamr@2: * This function is used to update the scroll bar after an external scroll. williamr@2: * The value of @c aThumbPos should be supplied in terms of the scrolling williamr@2: * model, which is presumed not to have changed spans. williamr@2: * williamr@2: * @param aHorizThumbPos The required thumb position. williamr@2: */ williamr@2: IMPORT_C void MoveHorizThumbTo(TInt aHorizThumbPos); williamr@2: williamr@2: /** williamr@2: * Moves the vertical scroll bar thumb to the position @c aVertThumbPos. williamr@2: * This function is used to update the scroll bar after an external scroll. williamr@2: * The value of aThumbPos should be supplied in terms of the scrolling williamr@2: * model, which is presumed not to have changed spans. williamr@2: * williamr@2: * @param aVertThumbPos The required thumb position. williamr@2: */ williamr@2: IMPORT_C void MoveVertThumbTo(TInt aVertThumbPos); williamr@2: williamr@2: /** williamr@2: * Moves the vertical scroll bar thumb to the position @c aFocusPosition. williamr@2: * This function is used to update the scroll bar after an external scroll. williamr@2: * The value of @c aFocusPosition should be supplied in terms of the williamr@2: * scrolling model, which is presumed not to have changed spans. williamr@2: * williamr@2: * @param aFocusPosition The required thumb position. williamr@2: */ williamr@2: IMPORT_C void SetVFocusPosToThumbPos(TInt aFocusPosition); williamr@2: williamr@2: /** williamr@2: * Returns the breadth of the scroll bar idenitified by @c aOrientation, or williamr@2: * zero if none exists. williamr@2: * williamr@2: * @param aOrientation The orientation of the scroll bar for which you wish williamr@2: * to obtain the breadth. williamr@2: * williamr@2: * @return The specified scroll bar's breadth. This is zero if none exists. williamr@2: */ williamr@2: IMPORT_C TInt ScrollBarBreadth( williamr@2: CEikScrollBar::TOrientation aOrientation) const; williamr@2: williamr@2: // scroll bar frame behavior functions williamr@2: williamr@2: /** williamr@2: * Not implemented. williamr@2: * williamr@2: * @param aAdjusts Not used. williamr@2: */ williamr@2: IMPORT_C void SetAdjustsHorizontalModel(TBool aAdjusts); williamr@2: williamr@2: /** williamr@2: * Not implemented. williamr@2: * williamr@2: * @param aAdjusts Not used. williamr@2: */ williamr@2: IMPORT_C void SetAdjustsVerticalModel(TBool aAdjusts); williamr@2: williamr@2: /** williamr@2: * Sets scrollbar frame flags. williamr@2: * williamr@2: * @param aMask Bitmask of the bits that are to be set. williamr@2: */ williamr@2: inline void SetScrollBarFrameFlags(TInt aMask); williamr@2: williamr@2: /** williamr@2: * Determines whether the scroll bar specified by aOrientation exists williamr@2: * williamr@2: * @param aOrientation The scroll bar’s orientation. williamr@2: * @return @c ETrue if the specified scroll bar exists otherwise @c EFalse. williamr@2: */ williamr@2: IMPORT_C TBool ScrollBarExists( williamr@2: CEikScrollBar::TOrientation aOrientation) const; williamr@2: williamr@2: /** williamr@2: * From @c CCoeControl williamr@2: * williamr@2: * Gets the number of controls contained in a compound control. williamr@2: * williamr@2: * @return The number of component controls contained in this control. williamr@2: */ williamr@2: IMPORT_C TInt CountComponentControls() const; williamr@2: williamr@2: /** williamr@2: * From @c CCoeControl williamr@2: * williamr@2: * Gets the component specified by index. Within a compound control, each williamr@2: * component control is identified by an index, where the index depends on williamr@2: * the order the controls were added: the first is given an index of 0, the williamr@2: * next an index of 1, and so on. williamr@2: * williamr@2: * @return The component control with an index of aIndex williamr@2: */ williamr@2: IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const; williamr@2: williamr@2: /** williamr@2: * Returns a pointer to the scroll bar identified by orientation @c williamr@2: * aOrientation. williamr@2: * williamr@2: * @param aOrientation The orientation of the scroll bar for which you wish williamr@2: * to obtain a pointer. williamr@2: * @return A pointer to the scroll bar with orientation @c aOrientation if williamr@2: * the scrollbar is visible. williamr@2: */ williamr@2: IMPORT_C CEikScrollBar* GetScrollBarHandle( williamr@2: CEikScrollBar::TOrientation aOrientation) const; williamr@2: williamr@2: /** williamr@2: * Returns a pointer to the vertical scroll bar. williamr@2: * williamr@2: * @return A pointer to the vertical scroll bar. williamr@2: */ williamr@2: IMPORT_C CEikScrollBar* VerticalScrollBar() const; williamr@2: williamr@2: /** williamr@2: * Sets the type of horizontal scroll bar. Possible values are @c EArrowHead williamr@2: * and @c EDoubleSpan. williamr@2: * williamr@2: * @param aType Type of the scrollbar. williamr@2: */ williamr@2: IMPORT_C void SetTypeOfHScrollBar(TScrollBarType aType); williamr@2: williamr@2: /** williamr@2: * Sets the type of vertical scroll bar. Possible values are @c EArrowHead williamr@2: * and @c EDoubleSpan. williamr@2: * williamr@2: * @param aType Type of the scrollbar. williamr@2: */ williamr@2: IMPORT_C void SetTypeOfVScrollBar(TScrollBarType aType); williamr@2: williamr@2: /** williamr@2: * Returns the control type of the horizontal scroll bar williamr@2: * williamr@2: * @return Type of the scrollbar. williamr@2: */ williamr@2: IMPORT_C TScrollBarType TypeOfHScrollBar() const; williamr@2: williamr@2: /** williamr@2: * Returns the control type of the vertical scroll bar williamr@2: * williamr@2: * @return Type of the scrollbar. williamr@2: */ williamr@2: IMPORT_C TScrollBarType TypeOfVScrollBar() const; williamr@2: williamr@2: /** williamr@2: * Checks if the vertical scrollbar type is @c EArrowHead. williamr@2: * williamr@2: * @param aFlag Not used. williamr@2: * @return @c ETrue if the type of the scrollbar is @c EArrowHead. williamr@2: */ williamr@2: IMPORT_C TBool IsArrowHeadScrollBar(TInt aFlag) const; williamr@2: williamr@2: // application scroll bar utilities williamr@2: williamr@2: /** williamr@2: * This method is used only internally by the @c CEikScrollBar. Disconnects williamr@2: * externally connected scrollbar. williamr@2: * williamr@2: * @param aScrollBar Scrollbar to be disconnected. williamr@2: */ williamr@2: void DisconnectExternalScrollBar(CEikScrollBar* aScrollBar); williamr@2: williamr@2: /** williamr@2: * This method creates double span type scrollbars into this frame. Old williamr@2: * scrollbars are deleted or disconnected. williamr@2: * williamr@2: * @since S60 2.6 williamr@2: * @param aWindowOwning Tells wheter created scrollbar should be williamr@2: * a window owning control or not. Selection for this is williamr@2: * relevant especially because skinned scrollbar draws williamr@2: * @param aRemote @c True if this method should instead of creating own williamr@2: * scrollbar try to connect to a remote scrollbar frame and williamr@2: * start using its scrollbars. Connecting is done using williamr@2: * through object provider mechanism, so the object supply williamr@2: * chain must be valid. Also if true, then parameter @c williamr@2: * aWindowOwning will be ignored. williamr@2: * williamr@2: * Example of use: williamr@2: * williamr@2: * @code williamr@2: * iSBFrame=new(ELeave) CEikScrollBarFrame(this, NULL, ETrue); williamr@2: * iSBFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, williamr@2: * CEikScrollBarFrame::EAuto); williamr@2: * iSBFrame->CreateDoubleSpanScrollBarsL(ETrue, EFalse); williamr@2: * williamr@2: * Note that double span scrollbar types requires different model classes williamr@2: * to be used in places of @c TEikScrollBarModel of this scrollbar frame williamr@2: * API:s other method calls. williamr@2: * williamr@2: * Scrollbar type Required model (in places of TEikScrollBarModel) williamr@2: * --------------- ------------------------------------------------ williamr@2: * EDoubleSpan TAknDoubleSpanScrollBarModel williamr@2: * EArrowHead TEikScrollBarModel williamr@2: * williamr@2: * // model for double span type scrollbar williamr@2: * TAknDoubleSpanScrollBarModel vModel; williamr@2: * // model for double span type scrollbar williamr@2: * TAknDoubleSpanScrollBarModel hModel; williamr@2: * williamr@2: * iSBFrame->Tile(vModel, iVRect); williamr@2: * @endcode williamr@2: */ williamr@2: IMPORT_C void CreateDoubleSpanScrollBarsL(TBool aWindowOwning, williamr@2: TBool aRemote); williamr@2: williamr@2: /** williamr@2: * This method creates double span type scrollbars into this frame. Old williamr@2: * scrollbars are deleted or disconnected. williamr@2: * williamr@2: * @since S60 2.8 williamr@2: * @param aWindowOwning Tells wheter created scrollbar should be a window williamr@2: * owning control or not. Selection for this is relevant especially williamr@2: * because skinned scrollbar draws its background using its parent williamr@2: * windows background context. williamr@2: * @param aRemote True if this method should instead of creating own williamr@2: * scrollbar try to connect to a remote scrollbar frame and start williamr@2: * using its scrollbars. Connecting is done using through object williamr@2: * provider mechanism, so the object supply chain must be valid. Also williamr@2: * if true, then parameter @c aWindowOwning will be ignored. williamr@2: * @param aVertical If @c ETrue vertical scrollbar will be created to williamr@2: * scrollbar frame. williamr@2: * @param aHorizontal If @c ETrue horizontal scrollbar will be created to williamr@2: * scrollbar frame. williamr@2: * @leave KErrNotFound Parent object doesn't have scrollbar frame. williamr@2: */ williamr@2: IMPORT_C void CreateDoubleSpanScrollBarsL(TBool aWindowOwning, williamr@2: TBool aRemote, williamr@2: TBool aVertical, williamr@2: TBool aHorizontal); williamr@2: williamr@2: /** williamr@2: * Tiles the vertical @c EDouble span type scroll bar managed by the frame. williamr@2: * The scroll bar is set up according to the scroll bar model and given williamr@2: * rectangle which is relative to the parent window of the frame. williamr@2: * williamr@2: * @since S60 2.6 williamr@2: * @param aVModel Vertical scrollbar model. williamr@2: * @param aVScrollBar Vertical scrollbar rectangle. williamr@2: * williamr@2: * For @c EDoublespan type scrollbar the layout can be set also with a williamr@2: * helper method from the @c AknLayoutUtils class: williamr@2: * williamr@2: * @code williamr@2: * AknLayoutUtils::LayoutVerticalScrollBar( williamr@2: * CEikScrollBarFrame* aScrollBarFrame, williamr@2: * const TRect& aControlParent, williamr@2: * const TAknWindowLineLayout& aLayout); williamr@2: * @endcode williamr@2: */ williamr@2: IMPORT_C void Tile(TEikScrollBarModel* aVModel, TRect& aVScrollBar); williamr@2: williamr@2: /** williamr@2: * Sets the models of the scrollbars. williamr@2: * williamr@2: * @since S60 2.6 williamr@2: * @param aHModel The model of the horizontal scrollbar. williamr@2: * @param aVModel The model of the vertical scrollbar. williamr@2: * williamr@2: */ williamr@2: IMPORT_C void Tile(TEikScrollBarModel* aHModel, williamr@2: TEikScrollBarModel* aVModel); williamr@2: williamr@2: /** williamr@2: * Gets the visibility of given scrollbar orientation. williamr@2: * williamr@2: * This method should be used instead of a deprecated method @c williamr@2: * CEikScrollBarFrame::HScrollBarVisibility() and williamr@2: * also can be used instead of @c CEikScrollBarFrame::VScrollBarVisibility() williamr@2: * williamr@2: * @since S60 2.6 williamr@2: * @param aOrientation The orientation of a scrollbar in the frame. williamr@2: * @return The visibility of requested scrollbar. williamr@2: */ williamr@2: IMPORT_C TScrollBarVisibility ScrollBarVisibility( williamr@2: CEikScrollBar::TOrientation aOrientation) const; williamr@2: /** williamr@2: * Sets the background drawing for the double spanned scrollbars williamr@2: * williamr@2: * This method can be used to enable or disable the drawing of the scrollbar williamr@2: * background via mop chain. williamr@2: * williamr@2: * @since 3.0 williamr@2: * @param aDrawHorizontal sets the state of the background drawing of williamr@2: * the horizontal scrollbar. williamr@2: * @param aDrawVertical sets the state of the background drawing of williamr@2: * the vertical scrollbar. williamr@2: * @return Success of the call, KErrNotSupported if the scrollbars williamr@2: * are not doublespan scrollbars. williamr@2: * williamr@2: */ williamr@2: IMPORT_C TInt DrawBackground(TBool aDrawHorizontal, TBool aDrawVertical); williamr@2: williamr@2: /** williamr@2: * Gets the state of the background drawing for the double spanned scrollbars. williamr@2: * williamr@2: * This method can be used to get the state of drawing of the scrollbar williamr@2: * background via mop chain. williamr@2: * williamr@2: * @since 3.0 williamr@2: * @param aDrawHorizontal gets the state of the background drawing of williamr@2: * the horizontal scrollbar. williamr@2: * @param aDrawVertical gets the state of the background drawing of williamr@2: * the vertical scrollbar. williamr@2: * @return Success of the call, KErrNotSupported if the scrollbars williamr@2: * are not doublespan scrollbars. williamr@2: * williamr@2: */ williamr@2: IMPORT_C TInt DrawBackgroundState(TBool& aDrawHorizontal, TBool& aDrawVertical); williamr@2: williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Gets a pointer to the horizontal scroll bar. williamr@2: * williamr@2: * @return A pointer to the horizontal scroll bar. williamr@2: */ williamr@2: CEikScrollBar* HorizontalScrollBar() const; williamr@2: williamr@2: /** williamr@2: * Sets scrollbar observers. williamr@2: * williamr@2: * @param aObserver The scroll bar observer. williamr@2: */ williamr@2: MEikScrollBarObserver* ScrollBarFrameObserver(); williamr@2: williamr@2: protected: williamr@2: // Accessor methods williamr@2: williamr@2: /** williamr@2: * Sets parent window. williamr@2: * williamr@2: * @param aParentWindow A pointer to the parent window. williamr@2: */ williamr@2: void SetParentWindow(CCoeControl* aParentWindow); williamr@2: williamr@2: /** williamr@2: * Gets a pointer to the parent window. williamr@2: * williamr@2: * @return A pointer to the parent window. williamr@2: */ williamr@2: CCoeControl* ParentWindow() const; williamr@2: williamr@2: protected: williamr@2: williamr@2: /** Struct */ williamr@2: struct SBarData williamr@2: { williamr@2: williamr@2: /** Pointer to the @c CAknScrollBar class */ williamr@2: CAknScrollBar* iBar; williamr@2: williamr@2: /** Enum @c TEikScrollBarModel */ williamr@2: TEikScrollBarModel iModel; williamr@2: williamr@2: /** Enum @c TScrollBarVisibility. */ williamr@2: TScrollBarVisibility iVisibility; williamr@2: williamr@2: /** Boolean value if external scroll bar is attached. */ williamr@2: TBool iExternalScrollBarAttached; williamr@2: }; williamr@2: williamr@2: private: williamr@2: williamr@2: void CalcTheoreticalScrollBarVisibility(const TEikScrollBarModel* aVModel); williamr@2: void ApplyModel(SBarData& aSBar); williamr@2: void MakeSBarVisible(SBarData& aSBar, TBool aVisible); williamr@2: void GetScrollBars(TBool aDoubleSpan); williamr@2: CEikCba* GetCurrentCba(); williamr@2: void DeleteScrollBars(); williamr@2: void CreateArrowHeadScrollBarsL(); williamr@2: williamr@2: void CalcTheoreticalScrollBarVisibility(const TEikScrollBarModel* aVModel, williamr@2: const TEikScrollBarModel* aHModel); williamr@2: williamr@2: protected: williamr@2: williamr@2: /** Struct object.*/ williamr@2: SBarData iV; williamr@2: williamr@2: private: williamr@2: williamr@2: CEikScrollBarFrameExtension* iExtension; williamr@2: TInt iScrollBarFrameFlags; williamr@2: williamr@2: friend class CEikScrollBarFrameExtension; williamr@2: }; williamr@2: williamr@2: inline CEikScrollBarFrame::TScrollBarVisibility CEikScrollBarFrame::VScrollBarVisibility() const williamr@2: { return iV.iVisibility; } williamr@2: inline void CEikScrollBarFrame::SetScrollBarFrameFlags(TInt aMask) williamr@2: { iScrollBarFrameFlags|=aMask; } williamr@2: williamr@2: // Cba scroll bar frame (with it's own scrollbar creation methods) williamr@2: class CEikCbaScrollBarFrame : public CEikScrollBarFrame williamr@2: { williamr@2: public: williamr@2: CEikCbaScrollBarFrame(CCoeControl* aParentWindow, MEikScrollBarObserver* aObserver, TBool aPreAlloc=EFalse); williamr@2: void ConstructL(); williamr@2: void SwitchToArrowHeadScrollBarL(); // @since 3.0 williamr@2: }; williamr@2: williamr@2: #endif