]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GtkLengthEntry.h
Extracted from r14281
[lyx.git] / src / frontends / gtk / GtkLengthEntry.h
1
2 // -*- C++ -*-
3 /**
4  * \file GtkLengthEntry.h
5  * This file is part of LyX, the document processor.
6  * Licence details can be found in the file COPYING.
7  *
8  * \author John Spray
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef GLENGTHENTRY_H
14 #define GLENGTHENTRY_H
15
16
17 #include "lengthcommon.h"
18
19 #include <gtkmm.h>
20 #include <libglademm.h>
21
22
23 class FuncRequest;
24
25 namespace lyx {
26 namespace frontend {
27
28 class GtkLengthEntry : public Gtk::HBox {
29 public:
30         GtkLengthEntry(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
31
32         void set_length(LyXLength const & length);
33         void set_length(std::string const & length);
34         LyXLength const get_length();
35         std::string const get_length_string();
36         void set_relative(bool rel);
37
38         Gtk::SpinButton *get_spin();
39         Gtk::ComboBoxText *get_combo();
40
41         Gtk::SpinButton const *const get_spin() const;
42         Gtk::ComboBoxText const *const get_combo() const;
43
44         sigc::signal<void> &signal_changed();
45
46 protected:
47         // spin_ construction depends on adj_, so it must come first
48         Gtk::Adjustment adj_;
49         Gtk::SpinButton spin_;
50         Gtk::ComboBoxText combo_;
51         sigc::signal<void> changedsignal_;
52         void emit_changed();
53         bool relative_;
54 };
55
56 } // namespace frontend
57 } // namespace lyx
58
59 #endif // NOT GTKLENGTHENTRY_H