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