| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2008, 2009, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, 2009, 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 21 matching lines...) Expand all Loading... |
| 32 #define FramelessScrollView_h | 32 #define FramelessScrollView_h |
| 33 | 33 |
| 34 #include "ScrollView.h" | 34 #include "ScrollView.h" |
| 35 | 35 |
| 36 namespace WebCore { | 36 namespace WebCore { |
| 37 | 37 |
| 38 class FramelessScrollViewClient; | 38 class FramelessScrollViewClient; |
| 39 class PlatformGestureEvent; | 39 class PlatformGestureEvent; |
| 40 class PlatformKeyboardEvent; | 40 class PlatformKeyboardEvent; |
| 41 class PlatformMouseEvent; | 41 class PlatformMouseEvent; |
| 42 #if ENABLE(TOUCH_EVENTS) | |
| 43 class PlatformTouchEvent; | 42 class PlatformTouchEvent; |
| 44 #endif | |
| 45 class PlatformWheelEvent; | 43 class PlatformWheelEvent; |
| 46 | 44 |
| 47 // A FramelessScrollView is a ScrollView that can be used to render custom | 45 // A FramelessScrollView is a ScrollView that can be used to render custom |
| 48 // content, which does not have an associated Frame. | 46 // content, which does not have an associated Frame. |
| 49 // | 47 // |
| 50 // NOTE: It may be better to just develop a custom subclass of Widget that | 48 // NOTE: It may be better to just develop a custom subclass of Widget that |
| 51 // can have scroll bars for this instead of trying to reuse ScrollView. | 49 // can have scroll bars for this instead of trying to reuse ScrollView. |
| 52 // | 50 // |
| 53 class FramelessScrollView : public ScrollView { | 51 class FramelessScrollView : public ScrollView { |
| 54 public: | 52 public: |
| 55 FramelessScrollView() : m_client(0) {} | 53 FramelessScrollView() : m_client(0) {} |
| 56 ~FramelessScrollView(); | 54 ~FramelessScrollView(); |
| 57 | 55 |
| 58 FramelessScrollViewClient* client() const { return m_client; } | 56 FramelessScrollViewClient* client() const { return m_client; } |
| 59 void setClient(FramelessScrollViewClient* client) { m_client = client; } | 57 void setClient(FramelessScrollViewClient* client) { m_client = client; } |
| 60 | 58 |
| 61 // Event handlers that subclasses must implement. | 59 // Event handlers that subclasses must implement. |
| 62 virtual bool handleMouseDownEvent(const PlatformMouseEvent&) = 0; | 60 virtual bool handleMouseDownEvent(const PlatformMouseEvent&) = 0; |
| 63 virtual bool handleMouseMoveEvent(const PlatformMouseEvent&) = 0; | 61 virtual bool handleMouseMoveEvent(const PlatformMouseEvent&) = 0; |
| 64 virtual bool handleMouseReleaseEvent(const PlatformMouseEvent&) = 0; | 62 virtual bool handleMouseReleaseEvent(const PlatformMouseEvent&) = 0; |
| 65 virtual bool handleWheelEvent(const PlatformWheelEvent&) = 0; | 63 virtual bool handleWheelEvent(const PlatformWheelEvent&) = 0; |
| 66 virtual bool handleKeyEvent(const PlatformKeyboardEvent&) = 0; | 64 virtual bool handleKeyEvent(const PlatformKeyboardEvent&) = 0; |
| 67 #if ENABLE(TOUCH_EVENTS) | |
| 68 virtual bool handleTouchEvent(const PlatformTouchEvent&) = 0; | 65 virtual bool handleTouchEvent(const PlatformTouchEvent&) = 0; |
| 69 #endif | |
| 70 virtual bool handleGestureEvent(const PlatformGestureEvent&) = 0; | 66 virtual bool handleGestureEvent(const PlatformGestureEvent&) = 0; |
| 71 | 67 |
| 72 // ScrollableArea public methods: | 68 // ScrollableArea public methods: |
| 73 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) OVERRID
E; | 69 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) OVERRID
E; |
| 74 virtual bool isActive() const OVERRIDE; | 70 virtual bool isActive() const OVERRIDE; |
| 75 virtual ScrollableArea* enclosingScrollableArea() const OVERRIDE; | 71 virtual ScrollableArea* enclosingScrollableArea() const OVERRIDE; |
| 76 virtual bool scrollbarsCanBeActive() const OVERRIDE; | 72 virtual bool scrollbarsCanBeActive() const OVERRIDE; |
| 77 virtual IntRect scrollableAreaBoundingBox() const OVERRIDE; | 73 virtual IntRect scrollableAreaBoundingBox() const OVERRIDE; |
| 78 | 74 |
| 79 // Widget public methods: | 75 // Widget public methods: |
| 80 virtual void invalidateRect(const IntRect&); | 76 virtual void invalidateRect(const IntRect&); |
| 81 | 77 |
| 82 // ScrollView public methods: | 78 // ScrollView public methods: |
| 83 virtual HostWindow* hostWindow() const; | 79 virtual HostWindow* hostWindow() const; |
| 84 virtual IntRect windowClipRect(bool clipToContents = true) const; | 80 virtual IntRect windowClipRect(bool clipToContents = true) const; |
| 85 | 81 |
| 86 protected: | 82 protected: |
| 87 // ScrollView protected methods: | 83 // ScrollView protected methods: |
| 88 virtual void paintContents(GraphicsContext*, const IntRect&); | 84 virtual void paintContents(GraphicsContext*, const IntRect&); |
| 89 virtual void contentsResized(); | 85 virtual void contentsResized(); |
| 90 virtual void visibleContentsResized(); | 86 virtual void visibleContentsResized(); |
| 91 | 87 |
| 92 private: | 88 private: |
| 93 FramelessScrollViewClient* m_client; | 89 FramelessScrollViewClient* m_client; |
| 94 }; | 90 }; |
| 95 | 91 |
| 96 } // namespace WebCore | 92 } // namespace WebCore |
| 97 | 93 |
| 98 #endif | 94 #endif |
| OLD | NEW |