1 /* 2 * Copyright 2012, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Marc Flerackers (mflerackers@androme.be) 7 * Stefano Ceccherini (stefano.ceccherini@gmail.com) 8 * John Scipione (jscipione@gmail.com) 9 */ 10 #ifndef INLINE_SCROLL_VIEW_H 11 #define INLINE_SCROLL_VIEW_H 12 13 14 #include <View.h> 15 16 17 class BLayout; 18 class BPoint; 19 class ScrollArrow; 20 21 class TInlineScrollView : public BView { 22 public: 23 TInlineScrollView(BRect frame, BView* target, 24 enum orientation orientation = B_VERTICAL); 25 virtual ~TInlineScrollView(); 26 27 virtual void AttachedToWindow(); 28 virtual void DetachedFromWindow(); 29 30 virtual void Draw(BRect updateRect); 31 32 void AttachScrollers(); 33 void DetachScrollers(); 34 bool HasScrollers() const; 35 36 void SetSmallStep(float step); 37 void GetSteps(float* _smallStep, 38 float* _largeStep) const; 39 void ScrollBy(const float& step); 40 41 private: 42 BView* fTarget; 43 ScrollArrow* fBeginScrollArrow; 44 ScrollArrow* fEndScrollArrow; 45 46 float fScrollStep; 47 float fScrollValue; 48 float fScrollLimit; 49 50 int32 fOrientation; 51 }; 52 53 54 #endif // INLINE_SCROLL_VIEW_H 55