OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006 Apple Computer, 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 23 matching lines...) Expand all Loading... |
34 #include "wtf/PassRefPtr.h" | 34 #include "wtf/PassRefPtr.h" |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 class GraphicsContext; | 38 class GraphicsContext; |
39 class IntRect; | 39 class IntRect; |
40 class PlatformGestureEvent; | 40 class PlatformGestureEvent; |
41 class PlatformMouseEvent; | 41 class PlatformMouseEvent; |
42 class ScrollableArea; | 42 class ScrollableArea; |
43 class ScrollbarTheme; | 43 class ScrollbarTheme; |
44 class ScrollView; | |
45 | 44 |
46 class PLATFORM_EXPORT Scrollbar : public Widget, | 45 class PLATFORM_EXPORT Scrollbar : public Widget, |
47 public ScrollbarThemeClient { | 46 public ScrollbarThemeClient { |
48 | 47 |
49 public: | 48 public: |
50 static PassRefPtr<Scrollbar> create(ScrollableArea*, ScrollbarOrientation, S
crollbarControlSize); | 49 static PassRefPtr<Scrollbar> create(ScrollableArea*, ScrollbarOrientation, S
crollbarControlSize); |
51 | 50 |
52 virtual ~Scrollbar(); | 51 virtual ~Scrollbar(); |
53 | 52 |
54 // ScrollbarThemeClient implementation. | 53 // ScrollbarThemeClient implementation. |
55 virtual int x() const OVERRIDE { return Widget::x(); } | 54 virtual int x() const OVERRIDE { return Widget::x(); } |
56 virtual int y() const OVERRIDE { return Widget::y(); } | 55 virtual int y() const OVERRIDE { return Widget::y(); } |
57 virtual int width() const OVERRIDE { return Widget::width(); } | 56 virtual int width() const OVERRIDE { return Widget::width(); } |
58 virtual int height() const OVERRIDE { return Widget::height(); } | 57 virtual int height() const OVERRIDE { return Widget::height(); } |
59 virtual IntSize size() const OVERRIDE { return Widget::size(); } | 58 virtual IntSize size() const OVERRIDE { return Widget::size(); } |
60 virtual IntPoint location() const OVERRIDE { return Widget::location(); } | 59 virtual IntPoint location() const OVERRIDE { return Widget::location(); } |
61 | 60 |
62 virtual Widget* parent() const OVERRIDE { return Widget::parent(); } | 61 virtual Widget* parent() const OVERRIDE { return Widget::parent(); } |
63 virtual Widget* root() const OVERRIDE { return Widget::root(); } | 62 virtual Widget* root() const OVERRIDE { return Widget::root(); } |
64 | 63 |
65 void removeFromParent(); | 64 virtual void setFrameRect(const IntRect& frameRect) OVERRIDE { Widget::setFr
ameRect(frameRect); } |
66 ScrollView* parentScrollView() const; | |
67 | |
68 virtual void setFrameRect(const IntRect&) OVERRIDE; | |
69 virtual IntRect frameRect() const OVERRIDE { return Widget::frameRect(); } | 65 virtual IntRect frameRect() const OVERRIDE { return Widget::frameRect(); } |
70 | 66 |
71 virtual void invalidate() OVERRIDE { Widget::invalidate(); } | 67 virtual void invalidate() OVERRIDE { Widget::invalidate(); } |
72 virtual void invalidateRect(const IntRect&) OVERRIDE; | 68 virtual void invalidateRect(const IntRect&) OVERRIDE; |
73 | 69 |
74 virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const OVERRIDE; | 70 virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const OVERRIDE; |
75 virtual void getTickmarks(Vector<IntRect>&) const OVERRIDE; | 71 virtual void getTickmarks(Vector<IntRect>&) const OVERRIDE; |
76 virtual bool isScrollableAreaActive() const OVERRIDE; | 72 virtual bool isScrollableAreaActive() const OVERRIDE; |
77 virtual bool isScrollViewScrollbar() const OVERRIDE; | 73 virtual bool isScrollViewScrollbar() const OVERRIDE; |
78 | 74 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 void mouseMoved(const PlatformMouseEvent&); | 122 void mouseMoved(const PlatformMouseEvent&); |
127 void mouseEntered(); | 123 void mouseEntered(); |
128 void mouseExited(); | 124 void mouseExited(); |
129 | 125 |
130 // Used by some platform scrollbars to know when they've been released from
capture. | 126 // Used by some platform scrollbars to know when they've been released from
capture. |
131 void mouseUp(const PlatformMouseEvent&); | 127 void mouseUp(const PlatformMouseEvent&); |
132 void mouseDown(const PlatformMouseEvent&); | 128 void mouseDown(const PlatformMouseEvent&); |
133 | 129 |
134 ScrollbarTheme* theme() const { return m_theme; } | 130 ScrollbarTheme* theme() const { return m_theme; } |
135 | 131 |
136 virtual void setParent(Widget*) OVERRIDE; | |
137 | |
138 bool suppressInvalidation() const { return m_suppressInvalidation; } | 132 bool suppressInvalidation() const { return m_suppressInvalidation; } |
139 void setSuppressInvalidation(bool s) { m_suppressInvalidation = s; } | 133 void setSuppressInvalidation(bool s) { m_suppressInvalidation = s; } |
140 | 134 |
141 virtual IntRect convertToContainingView(const IntRect&) const OVERRIDE; | 135 virtual IntRect convertToContainingView(const IntRect&) const OVERRIDE; |
142 virtual IntRect convertFromContainingView(const IntRect&) const OVERRIDE; | 136 virtual IntRect convertFromContainingView(const IntRect&) const OVERRIDE; |
143 | 137 |
144 virtual IntPoint convertToContainingView(const IntPoint&) const OVERRIDE; | 138 virtual IntPoint convertToContainingView(const IntPoint&) const OVERRIDE; |
145 virtual IntPoint convertFromContainingView(const IntPoint&) const OVERRIDE; | 139 virtual IntPoint convertFromContainingView(const IntPoint&) const OVERRIDE; |
146 | 140 |
147 void moveThumb(int pos, bool draggingDocument = false); | 141 void moveThumb(int pos, bool draggingDocument = false); |
148 | 142 |
149 virtual bool isAlphaLocked() const OVERRIDE { return m_isAlphaLocked; } | 143 virtual bool isAlphaLocked() const OVERRIDE { return m_isAlphaLocked; } |
150 virtual void setIsAlphaLocked(bool flag) OVERRIDE { m_isAlphaLocked = flag;
} | 144 virtual void setIsAlphaLocked(bool flag) OVERRIDE { m_isAlphaLocked = flag;
} |
151 | 145 |
| 146 bool overlapsResizer() const { return m_overlapsResizer; } |
| 147 void setOverlapsResizer(bool overlapsResizer) { m_overlapsResizer = overlaps
Resizer; } |
| 148 |
152 protected: | 149 protected: |
153 Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, Scrol
lbarTheme* = 0); | 150 Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, Scrol
lbarTheme* = 0); |
154 | 151 |
155 void updateThumb(); | 152 void updateThumb(); |
156 virtual void updateThumbPosition(); | 153 virtual void updateThumbPosition(); |
157 virtual void updateThumbProportion(); | 154 virtual void updateThumbProportion(); |
158 | 155 |
159 void autoscrollTimerFired(Timer<Scrollbar>*); | 156 void autoscrollTimerFired(Timer<Scrollbar>*); |
160 void startTimerIfNeeded(double delay); | 157 void startTimerIfNeeded(double delay); |
161 void stopTimerIfNeeded(); | 158 void stopTimerIfNeeded(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 virtual bool isScrollbar() const OVERRIDE { return true; } | 190 virtual bool isScrollbar() const OVERRIDE { return true; } |
194 | 191 |
195 float scrollableAreaCurrentPos() const; | 192 float scrollableAreaCurrentPos() const; |
196 }; | 193 }; |
197 | 194 |
198 DEFINE_TYPE_CASTS(Scrollbar, Widget, widget, widget->isScrollbar(), widget.isScr
ollbar()); | 195 DEFINE_TYPE_CASTS(Scrollbar, Widget, widget, widget->isScrollbar(), widget.isScr
ollbar()); |
199 | 196 |
200 } // namespace blink | 197 } // namespace blink |
201 | 198 |
202 #endif // Scrollbar_h | 199 #endif // Scrollbar_h |
OLD | NEW |