OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef VIEWS_CONTROLS_SLIDER_NATIVE_SLIDER_GTK_H_ |
| 6 #define VIEWS_CONTROLS_SLIDER_NATIVE_SLIDER_GTK_H_ |
| 7 |
| 8 #include <gtk/gtk.h> |
| 9 |
| 10 #include "views/controls/native_control_gtk.h" |
| 11 #include "views/controls/slider/native_slider_wrapper.h" |
| 12 |
| 13 namespace views { |
| 14 |
| 15 class NativeSliderGtk : public NativeControlGtk, |
| 16 public NativeSliderWrapper { |
| 17 public: |
| 18 explicit NativeSliderGtk(Slider* parent); |
| 19 ~NativeSliderGtk(); |
| 20 |
| 21 // Overridden from NativeSliderWrapper: |
| 22 virtual void UpdateEnabled(); |
| 23 virtual double GetValue(); |
| 24 virtual void SetValue(double value); |
| 25 virtual void SetFocus(); |
| 26 virtual gfx::Size GetPreferredSize(); |
| 27 virtual View* GetView(); |
| 28 virtual gfx::NativeView GetTestingHandle() const; |
| 29 |
| 30 // Overridden from NativeControlGtk: |
| 31 virtual void CreateNativeControl(); |
| 32 virtual void NativeControlCreated(GtkWidget* widget); |
| 33 |
| 34 private: |
| 35 // The slider we are bound to. |
| 36 Slider* slider_; |
| 37 |
| 38 // The preferred size from the last size_request. See |
| 39 // NativeButtonGtk::preferred_size_ for more detail why we need this. |
| 40 gfx::Size preferred_size_; |
| 41 |
| 42 // Callback when the slider value changes. |
| 43 static gboolean OnValueChangedHandler(GtkWidget* entry, |
| 44 NativeSliderGtk* slider); |
| 45 gboolean OnValueChanged(); |
| 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(NativeSliderGtk); |
| 48 }; |
| 49 |
| 50 } // namespace views |
| 51 |
| 52 #endif // VIEWS_CONTROLS_SLIDER_NATIVE_SLIDER_GTK_H_ |
OLD | NEW |