OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 IncludeScrollbars, | 53 IncludeScrollbars, |
54 }; | 54 }; |
55 | 55 |
56 class PLATFORM_EXPORT ScrollableArea { | 56 class PLATFORM_EXPORT ScrollableArea { |
57 WTF_MAKE_NONCOPYABLE(ScrollableArea); | 57 WTF_MAKE_NONCOPYABLE(ScrollableArea); |
58 public: | 58 public: |
59 static int pixelsPerLineStep(); | 59 static int pixelsPerLineStep(); |
60 static float minFractionToStepWhenPaging(); | 60 static float minFractionToStepWhenPaging(); |
61 static int maxOverlapBetweenPages(); | 61 static int maxOverlapBetweenPages(); |
62 | 62 |
63 // The window that hosts the ScrollView. The ScrollView will communicate scr
olls and repaints to the | 63 // The window that hosts the ScrollableArea. The ScrollableArea will communi
cate scrolls and repaints to the |
64 // host window in the window's coordinate space. | 64 // host window in the window's coordinate space. |
65 virtual HostWindow* hostWindow() const { return 0; }; | 65 virtual HostWindow* hostWindow() const { return 0; }; |
66 | 66 |
67 bool scroll(ScrollDirection, ScrollGranularity, float delta = 1); | 67 bool scroll(ScrollDirection, ScrollGranularity, float delta = 1); |
68 void scrollToOffsetWithoutAnimation(const FloatPoint&); | 68 void scrollToOffsetWithoutAnimation(const FloatPoint&); |
69 void scrollToOffsetWithoutAnimation(ScrollbarOrientation, float offset); | 69 void scrollToOffsetWithoutAnimation(ScrollbarOrientation, float offset); |
70 | 70 |
71 void programmaticallyScrollSmoothlyToOffset(const FloatPoint&); | 71 void programmaticallyScrollSmoothlyToOffset(const FloatPoint&); |
72 | 72 |
73 // Should be called when the scroll position changes externally, for example
if the scroll layer position | 73 // Should be called when the scroll position changes externally, for example
if the scroll layer position |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 { | 151 { |
152 return scrollbar->Widget::convertToContainingView(scrollbarPoint); | 152 return scrollbar->Widget::convertToContainingView(scrollbarPoint); |
153 } | 153 } |
154 virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar* scrol
lbar, const IntPoint& parentPoint) const | 154 virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar* scrol
lbar, const IntPoint& parentPoint) const |
155 { | 155 { |
156 return scrollbar->Widget::convertFromContainingView(parentPoint); | 156 return scrollbar->Widget::convertFromContainingView(parentPoint); |
157 } | 157 } |
158 | 158 |
159 virtual Scrollbar* horizontalScrollbar() const { return 0; } | 159 virtual Scrollbar* horizontalScrollbar() const { return 0; } |
160 virtual Scrollbar* verticalScrollbar() const { return 0; } | 160 virtual Scrollbar* verticalScrollbar() const { return 0; } |
161 virtual bool isScrollViewScrollbar(const Widget* child) const { return false
; } | |
162 | 161 |
163 // scrollPosition is relative to the scrollOrigin. i.e. If the page is RTL | 162 // scrollPosition is relative to the scrollOrigin. i.e. If the page is RTL |
164 // then scrollPosition will be negative. By default, scrollPositionDouble() | 163 // then scrollPosition will be negative. By default, scrollPositionDouble() |
165 // just call into scrollPosition(). Subclass can override scrollPositionDoub
le() | 164 // just call into scrollPosition(). Subclass can override scrollPositionDoub
le() |
166 // to return floating point precision scrolloffset. | 165 // to return floating point precision scrolloffset. |
167 // FIXME: Remove scrollPosition(). crbug.com/414283. | 166 // FIXME: Remove scrollPosition(). crbug.com/414283. |
168 virtual IntPoint scrollPosition() const = 0; | 167 virtual IntPoint scrollPosition() const = 0; |
169 virtual DoublePoint scrollPositionDouble() const { return DoublePoint(scroll
Position()); } | 168 virtual DoublePoint scrollPositionDouble() const { return DoublePoint(scroll
Position()); } |
170 virtual IntPoint minimumScrollPosition() const = 0; | 169 virtual IntPoint minimumScrollPosition() const = 0; |
171 virtual IntPoint maximumScrollPosition() const = 0; | 170 virtual IntPoint maximumScrollPosition() const = 0; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 // vertical-lr / ltr NO NO | 308 // vertical-lr / ltr NO NO |
310 // vertical-lr / rtl NO YES | 309 // vertical-lr / rtl NO YES |
311 // vertical-rl / ltr YES NO | 310 // vertical-rl / ltr YES NO |
312 // vertical-rl / rtl YES YES | 311 // vertical-rl / rtl YES YES |
313 IntPoint m_scrollOrigin; | 312 IntPoint m_scrollOrigin; |
314 }; | 313 }; |
315 | 314 |
316 } // namespace blink | 315 } // namespace blink |
317 | 316 |
318 #endif // ScrollableArea_h | 317 #endif // ScrollableArea_h |
OLD | NEW |