OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 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 16 matching lines...) Expand all Loading... |
27 #define ScrollElasticityController_h | 27 #define ScrollElasticityController_h |
28 | 28 |
29 #if USE(RUBBER_BANDING) | 29 #if USE(RUBBER_BANDING) |
30 | 30 |
31 #include "platform/PlatformExport.h" | 31 #include "platform/PlatformExport.h" |
32 #include "platform/geometry/FloatPoint.h" | 32 #include "platform/geometry/FloatPoint.h" |
33 #include "platform/geometry/FloatSize.h" | 33 #include "platform/geometry/FloatSize.h" |
34 #include "platform/scroll/ScrollTypes.h" | 34 #include "platform/scroll/ScrollTypes.h" |
35 #include "wtf/Noncopyable.h" | 35 #include "wtf/Noncopyable.h" |
36 | 36 |
37 namespace WebCore { | 37 namespace blink { |
38 | 38 |
39 class PlatformWheelEvent; | 39 class PlatformWheelEvent; |
40 | 40 |
41 class ScrollElasticityControllerClient { | 41 class ScrollElasticityControllerClient { |
42 protected: | 42 protected: |
43 virtual ~ScrollElasticityControllerClient() { } | 43 virtual ~ScrollElasticityControllerClient() { } |
44 | 44 |
45 public: | 45 public: |
46 virtual bool allowsHorizontalStretching() = 0; | 46 virtual bool allowsHorizontalStretching() = 0; |
47 virtual bool allowsVerticalStretching() = 0; | 47 virtual bool allowsVerticalStretching() = 0; |
48 // The amount that the view is stretched past the normal allowable bounds. | 48 // The amount that the view is stretched past the normal allowable bounds. |
49 // The "overhang" amount. | 49 // The "overhang" amount. |
50 virtual IntSize stretchAmount() = 0; | 50 virtual IntSize stretchAmount() = 0; |
51 virtual bool pinnedInDirection(const FloatSize&) = 0; | 51 virtual bool pinnedInDirection(const FloatSize&) = 0; |
52 virtual bool canScrollHorizontally() = 0; | 52 virtual bool canScrollHorizontally() = 0; |
53 virtual bool canScrollVertically() = 0; | 53 virtual bool canScrollVertically() = 0; |
54 | 54 |
55 // Return the absolute scroll position, not relative to the scroll origin. | 55 // Return the absolute scroll position, not relative to the scroll origin. |
56 virtual WebCore::IntPoint absoluteScrollPosition() = 0; | 56 virtual blink::IntPoint absoluteScrollPosition() = 0; |
57 | 57 |
58 virtual void immediateScrollBy(const FloatSize&) = 0; | 58 virtual void immediateScrollBy(const FloatSize&) = 0; |
59 virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&
) = 0; | 59 virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&
) = 0; |
60 virtual void startSnapRubberbandTimer() = 0; | 60 virtual void startSnapRubberbandTimer() = 0; |
61 virtual void stopSnapRubberbandTimer() = 0; | 61 virtual void stopSnapRubberbandTimer() = 0; |
62 | 62 |
63 // If the current scroll position is within the overhang area, this function
will cause | 63 // If the current scroll position is within the overhang area, this function
will cause |
64 // the page to scroll to the nearest boundary point. | 64 // the page to scroll to the nearest boundary point. |
65 virtual void adjustScrollPositionToBoundsIfNecessary() = 0; | 65 virtual void adjustScrollPositionToBoundsIfNecessary() = 0; |
66 }; | 66 }; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 // Rubber band state. | 128 // Rubber band state. |
129 CFTimeInterval m_startTime; | 129 CFTimeInterval m_startTime; |
130 FloatSize m_startStretch; | 130 FloatSize m_startStretch; |
131 FloatPoint m_origOrigin; | 131 FloatPoint m_origOrigin; |
132 FloatSize m_origVelocity; | 132 FloatSize m_origVelocity; |
133 | 133 |
134 bool m_snapRubberbandTimerIsActive; | 134 bool m_snapRubberbandTimerIsActive; |
135 }; | 135 }; |
136 | 136 |
137 } // namespace WebCore | 137 } // namespace blink |
138 | 138 |
139 #endif // USE(RUBBER_BANDING) | 139 #endif // USE(RUBBER_BANDING) |
140 | 140 |
141 #endif // ScrollElasticityController_h | 141 #endif // ScrollElasticityController_h |
OLD | NEW |