| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebScrollbarImpl_h | 31 #ifndef WebScrollbarImpl_h |
| 32 #define WebScrollbarImpl_h | 32 #define WebScrollbarImpl_h |
| 33 | 33 |
| 34 #include "ScrollableArea.h" | |
| 35 #include "WebScrollbar.h" | 34 #include "WebScrollbar.h" |
| 36 | 35 |
| 37 #include <wtf/RefPtr.h> | 36 #include <wtf/RefPtr.h> |
| 37 #include <wtf/Vector.h> |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 class IntPoint; |
| 41 class IntRect; |
| 40 class Scrollbar; | 42 class Scrollbar; |
| 41 } | 43 } |
| 42 | 44 |
| 43 namespace WebKit { | 45 namespace WebKit { |
| 44 | 46 |
| 45 class WebScrollbarImpl : public WebScrollbar, | 47 class ScrollbarGroup; |
| 46 public WebCore::ScrollableArea { | 48 |
| 49 class WebScrollbarImpl : public WebScrollbar { |
| 47 public: | 50 public: |
| 48 WebScrollbarImpl(WebScrollbarClient*, Orientation orientation); | 51 WebScrollbarImpl(Orientation, |
| 52 ScrollbarGroup*, |
| 53 WebScrollbarClient*); |
| 49 ~WebScrollbarImpl(); | 54 ~WebScrollbarImpl(); |
| 50 | 55 |
| 56 void setScrollOffset(int scrollOffset); |
| 57 void invalidateScrollbarRect(const WebCore::IntRect&); |
| 58 void getTickmarks(Vector<WebCore::IntRect>&) const; |
| 59 WebCore::IntPoint convertFromContainingViewToScrollbar(const WebCore::IntPoi
nt& parentPoint) const; |
| 60 void scrollbarStyleChanged(); |
| 61 |
| 62 int scrollOffset() { return m_scrollOffset; } |
| 63 WebCore::Scrollbar* scrollbar() { return m_scrollbar.get(); } |
| 64 |
| 51 // WebKit::WebScrollbar methods | 65 // WebKit::WebScrollbar methods |
| 66 virtual bool isOverlay(); |
| 52 virtual void setLocation(const WebRect&); | 67 virtual void setLocation(const WebRect&); |
| 53 virtual int value() const; | 68 virtual int value() const; |
| 54 virtual void setValue(int position); | 69 virtual void setValue(int position); |
| 55 virtual void setDocumentSize(int size); | 70 virtual void setDocumentSize(int size); |
| 56 virtual void scroll(ScrollDirection, ScrollGranularity, float multiplier); | 71 virtual void scroll(ScrollDirection, ScrollGranularity, float multiplier); |
| 57 virtual void paint(WebCanvas*, const WebRect&); | 72 virtual void paint(WebCanvas*, const WebRect&); |
| 58 virtual bool handleInputEvent(const WebInputEvent&); | 73 virtual bool handleInputEvent(const WebInputEvent&); |
| 59 | 74 |
| 60 // WebCore::ScrollableArea methods | |
| 61 virtual int scrollSize(WebCore::ScrollbarOrientation) const; | |
| 62 virtual int scrollPosition(WebCore::Scrollbar*) const; | |
| 63 virtual void setScrollOffset(const WebCore::IntPoint&); | |
| 64 virtual void invalidateScrollbarRect(WebCore::Scrollbar*, const WebCore::Int
Rect&); | |
| 65 virtual void invalidateScrollCornerRect(const WebCore::IntRect&); | |
| 66 virtual bool isActive() const; | |
| 67 virtual ScrollableArea* enclosingScrollableArea() const; | |
| 68 virtual WebCore::IntRect scrollCornerRect() const { return WebCore::IntRect(
); } | |
| 69 virtual bool isScrollCornerVisible() const; | |
| 70 virtual void getTickmarks(Vector<WebCore::IntRect>&) const; | |
| 71 virtual WebCore::Scrollbar* horizontalScrollbar() const; | |
| 72 virtual WebCore::Scrollbar* verticalScrollbar() const; | |
| 73 virtual int visibleHeight() const; | |
| 74 virtual int visibleWidth() const; | |
| 75 virtual WebCore::IntSize contentsSize() const; | |
| 76 virtual WebCore::IntSize overhangAmount() const; | |
| 77 | |
| 78 private: | 75 private: |
| 79 bool onMouseDown(const WebInputEvent& event); | 76 bool onMouseDown(const WebInputEvent& event); |
| 80 bool onMouseUp(const WebInputEvent& event); | 77 bool onMouseUp(const WebInputEvent& event); |
| 81 bool onMouseMove(const WebInputEvent& event); | 78 bool onMouseMove(const WebInputEvent& event); |
| 82 bool onMouseLeave(const WebInputEvent& event); | 79 bool onMouseLeave(const WebInputEvent& event); |
| 83 bool onMouseWheel(const WebInputEvent& event); | 80 bool onMouseWheel(const WebInputEvent& event); |
| 84 bool onKeyDown(const WebInputEvent& event); | 81 bool onKeyDown(const WebInputEvent& event); |
| 85 | 82 |
| 83 ScrollbarGroup* m_group; |
| 86 WebScrollbarClient* m_client; | 84 WebScrollbarClient* m_client; |
| 87 | 85 |
| 88 int m_scrollOffset; | 86 int m_scrollOffset; |
| 89 RefPtr<WebCore::Scrollbar> m_scrollbar; | 87 RefPtr<WebCore::Scrollbar> m_scrollbar; |
| 90 }; | 88 }; |
| 91 | 89 |
| 92 } // namespace WebKit | 90 } // namespace WebKit |
| 93 | 91 |
| 94 #endif | 92 #endif |
| OLD | NEW |