OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef VIEWS_CONTROLS_SCROLLBAR_SCROLLBAR_H_ | 5 #ifndef VIEWS_CONTROLS_SCROLLBAR_SCROLLBAR_H_ |
6 #define VIEWS_CONTROLS_SCROLLBAR_SCROLLBAR_H_ | 6 #define VIEWS_CONTROLS_SCROLLBAR_SCROLLBAR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "views/events/event.h" | 9 #include "views/events/event.h" |
10 #include "views/view.h" | 10 #include "views/view.h" |
11 | 11 |
12 namespace views { | 12 namespace views { |
13 | 13 |
14 class ScrollBar; | 14 class ScrollBar; |
15 | 15 |
16 ///////////////////////////////////////////////////////////////////////////// | 16 ///////////////////////////////////////////////////////////////////////////// |
17 // | 17 // |
18 // ScrollBarController | 18 // ScrollBarController |
19 // | 19 // |
20 // ScrollBarController defines the method that should be implemented to | 20 // ScrollBarController defines the method that should be implemented to |
21 // receive notification from a scrollbar | 21 // receive notification from a scrollbar |
22 // | 22 // |
23 ///////////////////////////////////////////////////////////////////////////// | 23 ///////////////////////////////////////////////////////////////////////////// |
24 class VIEWS_API ScrollBarController { | 24 class VIEWS_EXPORT ScrollBarController { |
25 public: | 25 public: |
26 | 26 |
27 // Invoked by the scrollbar when the scrolling position changes | 27 // Invoked by the scrollbar when the scrolling position changes |
28 // This method typically implements the actual scrolling. | 28 // This method typically implements the actual scrolling. |
29 // | 29 // |
30 // The provided position is expressed in pixels. It is the new X or Y | 30 // The provided position is expressed in pixels. It is the new X or Y |
31 // position which is in the GetMinPosition() / GetMaxPosition range. | 31 // position which is in the GetMinPosition() / GetMaxPosition range. |
32 virtual void ScrollToPosition(ScrollBar* source, int position) = 0; | 32 virtual void ScrollToPosition(ScrollBar* source, int position) = 0; |
33 | 33 |
34 // Returns the amount to scroll. The amount to scroll may be requested in | 34 // Returns the amount to scroll. The amount to scroll may be requested in |
(...skipping 13 matching lines...) Expand all Loading... |
48 ///////////////////////////////////////////////////////////////////////////// | 48 ///////////////////////////////////////////////////////////////////////////// |
49 // | 49 // |
50 // ScrollBar | 50 // ScrollBar |
51 // | 51 // |
52 // A View subclass to wrap to implement a ScrollBar. Our current windows | 52 // A View subclass to wrap to implement a ScrollBar. Our current windows |
53 // version simply wraps a native windows scrollbar. | 53 // version simply wraps a native windows scrollbar. |
54 // | 54 // |
55 // A scrollbar is either horizontal or vertical | 55 // A scrollbar is either horizontal or vertical |
56 // | 56 // |
57 ///////////////////////////////////////////////////////////////////////////// | 57 ///////////////////////////////////////////////////////////////////////////// |
58 class VIEWS_API ScrollBar : public View { | 58 class VIEWS_EXPORT ScrollBar : public View { |
59 public: | 59 public: |
60 virtual ~ScrollBar(); | 60 virtual ~ScrollBar(); |
61 | 61 |
62 // Overridden from View: | 62 // Overridden from View: |
63 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 63 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
64 | 64 |
65 // Return whether this scrollbar is horizontal | 65 // Return whether this scrollbar is horizontal |
66 bool IsHorizontal() const; | 66 bool IsHorizontal() const; |
67 | 67 |
68 // Set / Get the controller | 68 // Set / Get the controller |
(...skipping 29 matching lines...) Expand all Loading... |
98 ScrollBarController* controller_; | 98 ScrollBarController* controller_; |
99 | 99 |
100 // properties | 100 // properties |
101 int max_pos_; | 101 int max_pos_; |
102 }; | 102 }; |
103 | 103 |
104 } // namespace views | 104 } // namespace views |
105 | 105 |
106 #endif // VIEWS_CONTROLS_SCROLLBAR_SCROLLBAR_H_ | 106 #endif // VIEWS_CONTROLS_SCROLLBAR_SCROLLBAR_H_ |
107 | 107 |
OLD | NEW |