| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_BUTTON_CUSTOM_BUTTON_H_ | 5 #ifndef VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ |
| 6 #define VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ | 6 #define VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ |
| 7 | 7 |
| 8 #include "app/animation.h" | 8 #include "app/animation.h" |
| 9 #include "views/controls/button/button.h" | 9 #include "views/controls/button/button.h" |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // Get/sets the current display state of the button. | 34 // Get/sets the current display state of the button. |
| 35 ButtonState state() const { return state_; } | 35 ButtonState state() const { return state_; } |
| 36 void SetState(ButtonState state); | 36 void SetState(ButtonState state); |
| 37 | 37 |
| 38 // Starts throbbing. See HoverAnimation for a description of cycles_til_stop. | 38 // Starts throbbing. See HoverAnimation for a description of cycles_til_stop. |
| 39 void StartThrobbing(int cycles_til_stop); | 39 void StartThrobbing(int cycles_til_stop); |
| 40 | 40 |
| 41 // Set how long the hover animation will last for. | 41 // Set how long the hover animation will last for. |
| 42 void SetAnimationDuration(int duration); | 42 void SetAnimationDuration(int duration); |
| 43 | 43 |
| 44 // Sets whether or not to show the highlighed (i.e. hot) state. Default true. |
| 45 void SetShowHighlighted(bool show_highlighted); |
| 46 |
| 44 // Overridden from View: | 47 // Overridden from View: |
| 45 virtual void SetEnabled(bool enabled); | 48 virtual void SetEnabled(bool enabled); |
| 46 virtual bool IsEnabled() const; | 49 virtual bool IsEnabled() const; |
| 47 virtual bool IsFocusable() const; | 50 virtual bool IsFocusable() const; |
| 48 | 51 |
| 49 void set_triggerable_event_flags(int triggerable_event_flags) { | 52 void set_triggerable_event_flags(int triggerable_event_flags) { |
| 50 triggerable_event_flags_ = triggerable_event_flags; | 53 triggerable_event_flags_ = triggerable_event_flags; |
| 51 } | 54 } |
| 52 | 55 |
| 53 int triggerable_event_flags() const { | 56 int triggerable_event_flags() const { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 void SetHighlighted(bool highlighted); | 101 void SetHighlighted(bool highlighted); |
| 99 bool IsHighlighted() const; | 102 bool IsHighlighted() const; |
| 100 | 103 |
| 101 // Returns whether the button is pushed. | 104 // Returns whether the button is pushed. |
| 102 bool IsPushed() const; | 105 bool IsPushed() const; |
| 103 | 106 |
| 104 // Should we animate when the state changes? Defaults to true, but false while | 107 // Should we animate when the state changes? Defaults to true, but false while |
| 105 // throbbing. | 108 // throbbing. |
| 106 bool animate_on_state_change_; | 109 bool animate_on_state_change_; |
| 107 | 110 |
| 111 // Whether or not to show the highlighted (i.e. hot) state. |
| 112 bool show_highlighted_; |
| 113 |
| 108 // Mouse event flags which can trigger button actions. | 114 // Mouse event flags which can trigger button actions. |
| 109 int triggerable_event_flags_; | 115 int triggerable_event_flags_; |
| 110 | 116 |
| 111 DISALLOW_COPY_AND_ASSIGN(CustomButton); | 117 DISALLOW_COPY_AND_ASSIGN(CustomButton); |
| 112 }; | 118 }; |
| 113 | 119 |
| 114 } // namespace views | 120 } // namespace views |
| 115 | 121 |
| 116 #endif // VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ | 122 #endif // VIEWS_CONTROLS_BUTTON_CUSTOM_BUTTON_H_ |
| OLD | NEW |