2 * Copyright (c) 1997-2006 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #if !defined(__EIKSCRLB_H__)
20 #define __EIKSCRLB_H__
22 #if !defined(__EIKBCTRL_H__)
26 #if !defined(__EIKSBOBS_H__)
30 #if !defined(__AKNSCBUT_H__)
37 class CAknDoubleSpanScrollIndicator;
38 class CEikScrollBarExtensionImpl;
39 class CEikScrollBarExtension;
40 class CAknDoubleSpanScrollBarExtension;
42 const TInt KEikScrollEventFromVBar=0;
43 const TInt KEikScrollEventFromHBar=0x01;
44 const TInt KEikScrollEventBarMask=0x01;
46 // sets all bits in EButtonsXxx range
47 const TInt KButtonPositionMask=KLafScrollBarButtonPositionMask;
49 // sets all bits in determining which components exist
50 const TInt KDisplayComponentsMask=0x1f;
54 * Scroll bar models encapsulate the range of integers which a scroll bar can
55 * represent, from zero to n, and the current position of the scroll bar thumb
58 * Supported from Symbian 5.0.
60 class TEikScrollBarModel
66 * C++ default constructor. Creates, allocates and initialises a new @c
69 inline TEikScrollBarModel();
72 * Constructor. Creates, allocates and initialises a new @c
75 * @param aScrollSpan The span of this model, numbered from zero.
76 * @param aThumbSpan Number of positions spanned by the thumb.In default
78 * @param aThumbPosition Position of the thumb within the model span. In
79 * default this is zero.
81 IMPORT_C TEikScrollBarModel(TInt aScrollSpan,
83 TInt aThumbPosition=0);
86 * Tests two models for equality. The two models are the current model and
87 * the model specified by @c aModel.
89 * @param The model against which the current model is tested.
91 * @return @c ETrue if the two models are equal.
93 IMPORT_C TBool operator==(const TEikScrollBarModel aModel) const;
96 * Tests two models for inequality. The two models are the current model
97 * and the model specified by @c aModel.
99 * @param The model against which the current model is tested.
100 * @return @c ETrue if the two models are not equal.
102 inline TBool operator!=(const TEikScrollBarModel aModel) const;
107 * Tests whether the scroll bar model is useful. Scroll bar models are only
108 * useful if their thumb span is smaller than their entire span.
110 * @return Whether this scroll bar can be used.
112 IMPORT_C TBool ScrollBarUseful() const;
115 * Gets the maximum position possible for the low edge of the thumb within
118 * @return Maximum value possible for @c iThumbPosition.
120 IMPORT_C TInt MaxThumbPos() const;
123 * Ensures that the thumb position remains within its valid range by
124 * altering it if necessary.
126 IMPORT_C void CheckBounds();
129 * Type of scroll bar model. The different models store the scrolling
130 * information in different way, so correct model must be used with correct
133 enum TEikScrollBarModelType
136 /** This model type is for storing data for the arrowhead scrollbar. */
137 EEikScrollBarModel = 0x00000000,
139 /** This model type is for storing data for the spanned scrollbar. */
140 EAknDoubleSpanScrollBarModel = 0x80000000
144 * Gets type of scroll bar model which is one of the enum values from @c
145 * TEikScrollBarModelType enum.
147 TEikScrollBarModel::TEikScrollBarModelType ScrollBarModelType() const;
151 /** Entire range of integers for this model. */
154 /** Range spanned by the thumb. */
157 /** Position of the low edge of the thumb within 0...@c iScrollSpan. */
161 inline TEikScrollBarModel::TEikScrollBarModel() {}
162 inline TBool TEikScrollBarModel::operator!=(const TEikScrollBarModel aModel) const { return !(*this==aModel); }
166 // TAknDoubleSpanScrollBarModel class
168 // This class is binary compatible with TEikScrollBarModel and can
169 // be used in places where TEikScrollBarModel is used but few restrictions exist:
171 // - Base class (TEikScrollBarModel) public members must NOT be accessed directly.
172 // - Base class (TEikScrollBarModel) public methods must NOT be called.
174 // If this model is not supported by the scrollbar system, then values are stored
175 // as in the base class for compatibility resons. See ModelIsSupported()-method
176 // documentation for more information.
178 class TAknDoubleSpanScrollBarModel : public TEikScrollBarModel
184 * Default constructor.
186 IMPORT_C TAknDoubleSpanScrollBarModel();
189 * Constructor which converts TEikScrollBarModel into TAknDoubleSpanScrollBarModel.
192 * @param aEikModel a model that will be converted.
194 * Allowed range for TEikScrollBarModel values is from 0x1FFF7FFF to -0x1FFF7FFF.
195 * Values outside the allowed range will be truncated to max or min value.
196 * Value will be internally stored with 15 bit accuracy, this means
197 * that the actual stored value may differ from the value given as parameter.
199 * Values will be converted as:
201 * TEikScrollBarModel TAknDoubleSpanScrollBarModel
202 * ------------------ ----------------------------
203 * iScrollSpan -> ScrollSpan
204 * iThumbPosition -> FocusPosition
205 * iThumbSpan -> WindowSize
210 * Values will be internally stored with 15 bit accuracy, this means that the
211 * actual stored value may differ from the value given inside parameter.
214 IMPORT_C TAknDoubleSpanScrollBarModel(const TEikScrollBarModel& aEikModel);
218 * Set methods for model attributes. These MUST be used instead of setting
219 * base class model values directly.
222 * @param aValue Value to be stored. Allowed range 0x1FFF7FFF to -0x1FFF7FFF.
223 * Value outside the allowed range will be truncated to max
224 * or min value. Value will be internally stored with
225 * 15 bit accuracy, this means that the actual stored value
226 * may differ from the value given as parameter.
228 * This inaccuracy means that e.g. following can happen:
229 * TInt value1 = 23456789;
232 * model.SetScrollSpan(value1);
233 * value2 = model.ScrollSpan();
234 * if (value1 != value2)
236 * // we can end up here !!!!
240 IMPORT_C void SetScrollSpan(TInt aValue); // Size of the scrolled list.
241 IMPORT_C void SetFocusPosition(TInt aValue); // Position of the current field in the list.
242 IMPORT_C void SetWindowSize(TInt aValue); // Size of the visible part of the list.
243 IMPORT_C void SetFieldSize(TInt aValue); // Size of the current field. (Optional double span)
244 IMPORT_C void SetFieldPosition(TInt aValue); // Position inside the current field. (Optional double span)
248 * Get methods for model attributes. These MUST be used instead of getting
249 * base class model values directly.
252 * @return Values from range 0x1FFF7FFF to -0x1FFF7FFF.
253 * Values are internally stored with 15 bit accuracy, this means that
254 * the returned value may differ from the value which was set using the
255 * corresponding set method. Difference can be about 0x3FFF in the high
259 IMPORT_C TInt ScrollSpan() const; // Size of the scrolled list.
260 IMPORT_C TInt FocusPosition() const; // Position of the current field in the list.
261 IMPORT_C TInt WindowSize() const; // Size of the visible part of the list.
262 IMPORT_C TInt FieldSize() const; // Size of the current field. (Optional double span)
263 IMPORT_C TInt FieldPosition() const; // Position inside the current field. (Optional double span)
267 * This method can be used to query if this model type is supported by the device. If model
268 * is not supported then this model and the behaviour of ALL methods defaults to TEikScrollBarModel
269 * behaviour with following rules:
271 * TAknDoubleSpanScrollBarModel TEikScrollBarModel
272 * ---------------------------- ------------------
273 * ScrollSpan methods -> iScrollSpan
274 * FocusPosition methods -> iThumbPosition
275 * WindowSize methods -> iThumbSize
276 * FieldPosition methods -> N/A
277 * FieldSize methods -> N/A
280 * @return ETrue if this model is supported by the devices scrollbar system. Otherwise EFalse is
284 static TBool ModelIsSupported();
288 * Gets the internal scale value.
291 * @return Internal scaling value.
294 TUint16 Scale() const;
297 * Sets the internal scale value.
300 * @param aScale New internal scaling value.
303 void SetScale(TUint16 aScale);
307 * Get methods for model attributes values without scaling.
310 * @return Stored value without scaling.
313 TInt16 ScrollSpanValue() const;
314 TInt16 FocusPositionValue() const;
315 TInt16 FieldPositionValue() const;
316 TInt16 FieldSizeValue() const;
317 TInt16 WindowSizeValue() const;
320 * Set methods for model attributes values without scaling.
323 * @param aValue Value without scaling to be stored.
326 void SetScrollSpanValue(TInt16 aValue);
327 void SetFocusPositionValue(TInt16 aValue);
328 void SetFieldPositionValue(TInt16 aValue);
329 void SetFieldSizeValue(TInt16 aValue);
330 void SetWindowSizeValue(TInt16 aValue);
333 * Gets two lowest bytes from TInt and constructs TInt16 from those.
336 * @param aInt Value from which the lowest bytes are extracted.
337 * @return TInt16 constructed from two lowest bytes.
339 TInt16 LowBytes(TInt aInt) const;
342 * Gets two highest bytes from TInt and constructs TInt16 from those.
345 * @param aInt Value from which the highest bytes are extracted.
346 * @return TInt16 constructed from two highest bytes.
348 TInt16 HighBytes(TInt aInt) const;
352 * Sets two lowest bytes of TInt.
355 * @param aInt TInt of which the lowest bytes are set.
356 * @param aValue Value for the lowest bytes.
358 void SetLowBytes(TInt& aInt, TInt16 aValue);
361 * Sets two highest bytes of TInt.
364 * @param aInt TInt of which the highest bytes are set.
365 * @param aValue Value for the highest bytes.
367 void SetHighBytes(TInt& aInt, TInt16 aValue);
371 * Constructs a scaled TInt16 value from given TInt value. Changes
372 * internal member variable values using ReScale()-method if needed.
375 * @param aNonScaledValue Value which will be changed to scaled one.
376 * @return Scaled value.
378 TInt16 PrepareScaledValue(TInt aNonScaledValue);
381 * Changes the used scale value and updates all stored attribute values
385 * @param aNewScale New value to be used scaling.
388 void ReScale(TUint16 aNewScale);
391 * Sets the scrollbar type.
394 * @param aModelType Scrollbar type. Supported types are
395 * EEikScrollBarModel and EAknDoubleSpanScrollBarModel.
398 void SetScrollBarModelType(TEikScrollBarModelType aModelType);
401 * Checks if given parameter is between internal min and max values.
404 * @param aValue Value to be checked.
405 * @return Checked value which will be between internal min
409 TInt CheckMinMaxValue(TInt aValue);
417 class CEikScrollThumb;
418 class CEikScrollBarFrame;
421 * The CEikScrollBar class implements a scroll bar. Scroll bars are used when
422 * the contents of a view require a greater area than can be physically
423 * displayed. Scroll bars allow a user to move different parts of the content
424 * into the view and to indicate what proportion of the total contents are
425 * visible at any one time.
427 class CEikScrollBar : public CEikBorderedControl, public MCoeControlObserver
429 friend class CEikScrollBarExtension;
430 friend class CAknDoubleSpanScrollBarExtension;
434 /** Scroll bar orientation. */
437 /** Scroll bar is oriented vertically. */
438 EVertical = SLafScrollBar::EVertical,
440 /** Scroll bar is oriented horizontally. */
441 EHorizontal = SLafScrollBar::EHorizontal
444 /** Type of the scroll bar.*/
447 /** Normal scrollbar. */
448 ENormalScrollBar =0x0,
450 /** Used scrollbar type is an old one. (arrows in the CBA-area) */
454 * The created scrollbar is the current and commonly used in Series 60
455 * platform, spanned scrollbar. (scrollable bar on the right side of
456 * the control, like in windows etc.).
462 * Scroll bar initialisation flags. The default is for the scroll bar
463 * to have both a shaft and a thumb.
465 enum TEikScrollBarFlags
468 EEikScrollBarDefaultBehaviour =
469 SLafScrollBar::EEikScrollBarDefaultBehaviour,
471 /** Does not display nudge buttons.*/
472 EEikScrollBarNoNudgeButtons =
473 SLafScrollBar::EEikScrollBarNoNudgeButtons,
475 /** Has buttons which move it a page at a time. */
476 EEikScrollBarHasPageButtons =
477 SLafScrollBar::EEikScrollBarHasPageButtons,
479 /** Has buttons which move it its entire extent. */
480 EEikScrollBarHasHomeEndButtons =
481 SLafScrollBar::EEikScrollBarHasHomeEndButtons,
483 /** Central area is empty. */
484 EEikScrollBarNoShaftOrThumb =
485 SLafScrollBar::EEikScrollBarNoShaftOrThumb,
487 /** Central area has no scroll thumb. */
488 EEikScrollBarShaftButNoThumb =
489 SLafScrollBar::EEikScrollBarShaftButNoThumb,
491 /** Buttons are placed at the start of the bar. */
492 EButtonsAtStartOfShaft =
493 SLafScrollBar::EButtonsAtStartOfShaft,
495 /** Buttons are placed at the end of the bar. */
496 EButtonsAtEndOfShaft =
497 SLafScrollBar::EButtonsAtEndOfShaft,
500 * Buttons are placed at either end of the bar @c
501 * (EButtonsAtStartOfShaft | @c EButtonsAtEndOfShaft).
503 EButtonsEitherSideOfShaft =
504 SLafScrollBar::EButtonsEitherSideOfShaft,
507 * Buttons do not automatically dim when scroll bar is at its maximum
511 SLafScrollBar::ENoAutoDimming,
513 /** Enable the nudge buttons. */
514 EEnableNudgeButtons = 0x0200,
516 /** Disable the expanded touch area. */
517 EDisableExpandedTouchArea = 0x0400
520 /** Type of the scroll extension area.*/
521 enum TScrollBarExtensionAreaType
523 /** Normal scrollbar extension area. */
524 ENormalExpandedTouchArea,
526 /** Scale scrollbar extension area. */
527 EScaleExpandedTouchArea,
529 /** none scrollbar extension area. */
533 typedef TEikScrollBarFlags TAknScrollBarFlags;
540 IMPORT_C ~CEikScrollBar();
543 * C++ default constructor.
545 IMPORT_C CEikScrollBar();
550 * Second phase constructor of the scroll bar.
552 * @param aScrollBarObserver The scroll bar observer which is to be
553 * informed of scroll events by this scroll bar.
554 * @param aParent Parent control for this new scroll bar.
555 * @param aOrientation Orientation of the new scroll bar.
556 * @param aLength Not used.
557 * @param aScrollBarFlags Not used.
559 IMPORT_C virtual void ConstructL(
560 MEikScrollBarObserver* aScrollBarObserver,
561 const CCoeControl* aParent,
562 TOrientation aOrientation,
564 TInt aScrollBarFlags=EEikScrollBarDefaultBehaviour);
569 * @param aLength Not used.
571 IMPORT_C void SetLengthL(TInt aLength);
574 * Change the scrollbar model.
576 * @param aModel The new model to use.
578 IMPORT_C void SetModelL(const TEikScrollBarModel* aModel);
581 * Change the scrollbar model.
583 * @param aModel The new model to use.
585 IMPORT_C void SetModel(const TEikScrollBarModel* aModel);
588 * Change the model at once to avoid a double update of the scroll bar.
590 * @param aLength Not used.
591 * @param aModel New scroll bar model.
593 IMPORT_C void SetLengthAndModelL(TInt aLength,
594 const TEikScrollBarModel* aModel);
599 * @param aThumbPos Not used.
601 IMPORT_C void SetModelThumbPosition(TInt aThumbPos);
606 * @param aFocusPosition Not used.
608 IMPORT_C void SetFocusPosToThumbPos(TInt aFocusPosition);
611 * Gets the default width of the scroll bar.
613 * @return Default scroll bar breadth.
615 IMPORT_C static TInt DefaultScrollBarBreadth();
618 * Allows scroll bar observer to be changed also after the construction.
619 * This function is not exported, but the applications can use it via
620 * @c CEikScrollBarFrame::SetScrollBarFrameObserver function.
622 * @param aScrollBarObserver New observer replacing the previous (if any).
624 void SetScrollBarObserver(MEikScrollBarObserver* aScrollBarObserver);
627 * Gets the scroll bar model used by this scroll bar.
629 inline const TEikScrollBarModel* Model() const;
632 * Gets the position within the scroll bar model. This function would
633 * normally be called by an @c MEikScrollBarObserver implementation in
634 * response to a scroll bar event.
636 * @return Current position within the scroll bar model’s range.
638 IMPORT_C TInt ThumbPosition() const;
641 * Gets the height of a horizontal scrollbar or width of a vertical
644 * @return Scroll bar breadth.
646 IMPORT_C TInt ScrollBarBreadth() const;
651 * @param aScrollBarFlags Not used.
655 IMPORT_C static TInt MinVisibleLength(const TInt aScrollBarFlags);
660 * @param aDimmed Not used.
662 IMPORT_C void SetDecreaseButtonsDimmed(TBool aDimmed);
667 * @param aDimmed Not used.
669 IMPORT_C void SetIncreaseButtonsDimmed(TBool aDimmed);
674 * @param aDimmed Not used.
676 IMPORT_C void SetAllButtonsDimmed(TBool aDimmed);
679 * Gets handle to the controls that draw arrows in the both ends of spanned
680 * scrollbar. These arrows are for pen support to enable exact moving of
681 * the scrollbar with pen. The arrow is tapped with the pen to move the
682 * scrollbar with one step.
684 * @return Pointer to the increace button.
686 inline CAknScrollButton* IncreaseNudgeButton() const;
689 * Gets handle to the controls that draw arrows in the both ends of spanned
690 * scrollbar. These arrows are for pen support to enable exact moving of
691 * the scrollbar with pen. The arrow is tapped with the pen to move the
692 * scrollbar with one step.
694 * @return Pointer to the decreace button.
696 inline CAknScrollButton* DecreaseNudgeButton() const;
698 // This function should only be used by CEikCba
700 * Sets command button area. This function should only be used by @c
703 * @param aCba Command button area.
704 * @panic EEikPanicScrollBarExtensionNotCreated Extension of
705 * the scroll bar not created.
707 IMPORT_C void SetContainingCba(CEikCba* aCba);
710 * From @c CCoeControl.
712 * Sets this control as visible or invisible.
714 * If @c MakeVisible() is used to make a component visible, and the control
715 * captures the pointer (see @c CapturesPointer()), @c MakeVisible() throws
716 * away any pending pointer events for that control.
718 * @param aVisible @c ETrue to make the control visible, @c EFalse to make
721 IMPORT_C void MakeVisible(TBool aVisible);
725 * From @c CCoeControl
727 * Called by the framework to handle pointer events.
729 * @param aPointerEvent A pointer event.
731 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
736 * @param aType The extension area to use.
739 IMPORT_C void SetExtensionAreaType(TScrollBarExtensionAreaType aType);
743 * From @c CCoeControl
745 * Gets the specified scrollbar component. Each component control is
746 * identified by an index, where the index depends on the order the
747 * controls were added: the first is given an index of 0, the next an index
750 * @param aIndex The index of the control to get.
752 * @return The component control with an index of aIndex.
754 IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const;
757 * From @cCCoeControl.
759 * Gets the number of controls contained in this scrollbar.
761 * @return The number of component controls contained by this scrollbar.
763 IMPORT_C TInt CountComponentControls() const;
765 private: // from MCoeControlObserver
766 IMPORT_C virtual void HandleControlEventL(CCoeControl* aControl,
767 TCoeEvent aEventType);
768 private: // virtual - reserved from CCoeControl
769 IMPORT_C virtual void Reserved_2();
774 IMPORT_C void* ExtensionInterface( TUid aInterface );
779 * The scroll bar frame is a control assemblage manager that relates a
780 * control, or control body, to two scroll bars and a corner window. A
781 * corner window is that part of the screen that is common to both the
782 * horizontal, and the vertical elements of a scroll bar.
784 * This class helps with access to, and set up of, scroll bars and also
785 * with the layout of the scrolled control or control body. A scroll bar
786 * frame is not a control, but it does implement the standard control
787 * composite pattern to manage the assemblage.
789 friend class CEikScrollBarFrame;
793 * Flags to determine whether there are visible components and whether to
794 * dim the increase, or decrease, buttons.
796 enum TPrivateScrollBarFlags
799 /** There are no visible components in the scroll bar. */
800 ENoComponentsToDisplay =0x10000,
802 /** Dim the increase buttons. */
803 EIncreaseButtonsDimmed =0x20000,
805 /** Dim the decrease buttons. */
806 EDecreaseButtonsDimmed =0x40000
809 /** Determines where on a scroll bar a pointer down event occurred. */
812 /** No pointer down event occurred on the scroll bar. */
815 /** A pointer down event occurred on the home button. */
818 /** A pointer down event occurred on the decrease page button. */
821 /** A pointer down event occurred on the decrease nudge button. */
822 EDecreaseNudgeButton,
824 /** A pointer down event occurred on the decrease shaft button. */
827 /** A pointer down event occurred on the scroll bar thumb. */
830 /** A pointer down event occurred on the increase shaft button. */
833 /** A pointer down event occurred on the increase nudge button. */
834 EIncreaseNudgeButton,
836 /** A pointer down event occurred on the increase page button. */
839 /** A pointer down event occurred on the end button. */
843 /** Determines whether to redraw the scroll bar shaft. */
844 enum TShaftRedrawRequired
846 /** Do not redraw the scroll bar shaft. */
849 /** Redraw the scroll bar shaft. */
853 /** Determines which buttons are displayed. */
856 /** Display the increase buttons only. */
859 /** Display the decrease buttons only. */
862 /** Display all buttons. */
867 * Encapsulates pointers to the scroll bar buttons. A maximum of three
868 * pairs of buttons are available, you may choose to use only one pair or
871 struct SEikScrollBarButtons
873 /** Pointer to the decrease nudge button. */
874 CAknScrollButton* iDecreaseNudge;
876 /** Pointer to the increase nudge button. */
877 CAknScrollButton* iIncreaseNudge;
882 // construction/destruction
883 IMPORT_C virtual void CreateButtonL(CAknScrollButton*& aButton,
884 CAknScrollButton::TType aType);
888 // set state functions
889 void DoSetModel(const TEikScrollBarModel* aModel);
891 CEikCba* Cba() const;
893 // These functions are for use only be CEikScrollBarFrame (a friend class)
894 void AddExternalFrameL(CEikScrollBarFrame* aFrame);
895 void RemoveExternalFrame(CEikScrollBarFrame* aFrame);
897 void DisconnectExternalFrames();
902 * Allocates and constructs all the required components of the scrollbar.
904 void CreateRequiredComponentsL();
909 * @param aButton A button that will be destroyed.
911 void DestroyButton(CAknScrollButton*& aButton);
916 * @param aButton Not used.
918 IMPORT_C virtual void SetButtonPositionL(CAknScrollButton* aButton);
923 * Gets the scroll bar type.
925 * @return Value of the enum @c TScrollBarType.
927 TScrollBarType ScrollBarType();
931 /** Not used, but cannot be removed due binary compatibility issues. */
936 /** Scroll bar buttons struct. */
937 SEikScrollBarButtons iButtons;
939 /** Scroll bar orientation. */
940 TOrientation iOrientation;
943 TEikScrollBarModel iModel;
947 /** A pointer to @c CEikScrollBarExtensionImpl class. */
948 CEikScrollBarExtensionImpl* iExtension;
953 * The CEikArrowHeadScrollBar class is a scroll bar which uses only
954 * two small nudge button arrows to scroll up and down. It has no shaft.
955 * It therefore takes up very little space.
959 * Internal to Symbian
962 class CEikArrowHeadScrollBar : public CEikScrollBar
965 IMPORT_C CEikArrowHeadScrollBar(CCoeControl* aParentWindow);
966 IMPORT_C ~CEikArrowHeadScrollBar();
967 public: // from CEikScrollBar
968 IMPORT_C void ConstructL(MEikScrollBarObserver* aScrollBarObserver,const CCoeControl* aParent,
969 TOrientation aOrientation,TInt aLength,TInt aScrollBarFlags=EEikScrollBarDefaultBehaviour);
970 public: // From CCoeControl
971 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
972 private: // from CEikScrollBar
973 void CreateButtonL(CAknScrollButton*& aButton,CAknScrollButton::TType aType);
974 void SetButtonPositionL(CAknScrollButton* aButton);
980 IMPORT_C void* ExtensionInterface( TUid aInterface );
982 CCoeControl* iParentControl;
988 * The CAknDoubleSpanScrollBar class is a scroll bar without buttons,
989 * but it has a shaft. Additionally it has in its shaft a double
990 * span feature which means that there can be another thumb inside the thumb
993 * This class uses TAknDoubleSpanScrollBarModel instead of TEikScrollBarModel
994 * as its internal scrollbar model. TAknDoubleSpanScrollBarModel in binary
995 * compatible with TEikScrollBarModel. User must take care that TAknDoubleSpanScrollBarModel
996 * is really used in API calls in places where TEikScrollBarModel is declared.
1001 class CAknDoubleSpanScrollBar : public CEikScrollBar
1004 IMPORT_C CAknDoubleSpanScrollBar(CCoeControl* aParentWindow);
1005 IMPORT_C ~CAknDoubleSpanScrollBar();
1008 * Sets fixed layout to scrollbar. If set, then scrollbar size
1009 * changes done by the CEikScrollBarFrame class are disabled.
1012 * @param aScrollBarRect Scrollbar rectangle.
1015 IMPORT_C void SetFixedLayoutRect(TRect aScrollBarRect);
1018 * Method for constructing the object.
1021 * @param aWindowOwning True if scrollbar is to be a window owning control.
1022 * @param aScrollBarObserver Same as in CEikScrollBar::ConstructL()
1023 * @param aParent Same as in CEikScrollBar::ConstructL()
1024 * @param aOrientation Same as in CEikScrollBar::ConstructL()
1025 * @param aLength Same as in CEikScrollBar::ConstructL()
1026 * @param aScrollBarFlags Same as in CEikScrollBar::ConstructL()
1029 IMPORT_C void ConstructL(TBool aWindowOwning, MEikScrollBarObserver* aScrollBarObserver,const CCoeControl* aParent,
1030 TOrientation aOrientation,TInt aLength,TInt aScrollBarFlags=EEikScrollBarDefaultBehaviour);
1033 * Sets scroll popup info text to be shown while dragging with stylus.
1034 * Popup is shown until next pointer up event.
1035 * KNullDesC parameter can be used to hide popup earlier.
1038 * @param aText Text to be shown
1041 IMPORT_C void SetScrollPopupInfoTextL( const TDesC& aText );
1044 * Gets the fixed layoutrect of the scrollbar.
1046 * @return Scrollbar rectangle.
1049 TRect FixedLayoutRect();
1051 public: // from CEikScrollBar
1052 IMPORT_C void ConstructL(MEikScrollBarObserver* aScrollBarObserver,const CCoeControl* aParent,
1053 TOrientation aOrientation,TInt aLength,TInt aScrollBarFlags=EEikScrollBarDefaultBehaviour);
1054 IMPORT_C void MakeVisible(TBool aVisible);
1056 public: // from CCoeControl
1057 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
1059 protected: // from CCoeControl
1060 IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const;
1061 IMPORT_C TInt CountComponentControls() const;
1063 private: // from CCoeControl
1064 IMPORT_C void SizeChanged();
1068 TBool DrawBackgroundState();
1070 void DrawBackground(TBool aDrawHorizontal);
1073 * Resets pressed down highlight so that default highlight is used when
1074 * the scrollbar is drawn.
1078 void ResetPressedDownHighlight();
1084 IMPORT_C void* ExtensionInterface( TUid aInterface );
1085 private: // from CEikScrollBar
1086 void CreateButtonL(CAknScrollButton*& aButton,CAknScrollButton::TType aType);
1087 void SetButtonPositionL(CAknScrollButton* aButton);
1090 * Sets scrollbar background transparency as given in the parameter.
1092 * @param aTransparentBackground If ETrue then scrollbar will have transparent background.
1096 void SetTransparentBackground(TBool aTransparentBackground);
1099 * Calculates scrollbar's extension area relative to its own position.
1101 TRect ExtensionArea() const;
1103 CCoeControl* iParentControl;
1113 inline const TEikScrollBarModel* CEikScrollBar::Model() const
1116 inline CAknScrollButton* CEikScrollBar::IncreaseNudgeButton() const
1117 { return iButtons.iIncreaseNudge; }
1119 inline CAknScrollButton* CEikScrollBar::DecreaseNudgeButton() const
1120 { return iButtons.iDecreaseNudge; }