4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS.
15 #include "lengthcommon.h"
27 std::string const getLengthFromWidgets(
28 Gtk::Adjustment const & adj,
29 Gtk::ComboBoxText const & combo);
31 void setWidgetsFromLength(
32 Gtk::Adjustment & adj,
33 Gtk::ComboBoxText & combo,
34 LyXLength const & length);
36 int comboBoxTextSet(Gtk::ComboBoxText & combo, Glib::ustring target);
38 void populateUnitCombo(Gtk::ComboBoxText & combo, bool userelative);
40 // Get a GTK stockID from a lyx function id.
41 // Return Gtk::Stock::MISSING_IMAGE if no suitable stock found
42 Gtk::BuiltinStockID getGTKStockIcon(FuncRequest const & func);
44 std::string const getDefaultUnit();
46 void unitsComboFromLength(
47 Gtk::ComboBox * combo,
48 Gtk::TreeModelColumn<Glib::ustring> const & stringcol,
49 LyXLength const & len,
50 std::string const & defunit);
52 std::vector<std::string> const buildLengthUnitList(bool userelative);
54 /** name is the name of the glade file, without path or extension.
55 * Eg, "aboutlyx", "tableCreate".
57 std::string const findGladeFile(std::string const & name);
60 typename std::vector<A>::size_type
61 findPos(std::vector<A> const & vec, A const & val)
63 typename std::vector<A>::const_iterator it =
64 std::find(vec.begin(), vec.end(), val);
67 return std::distance(vec.begin(), it);
70 } // namespace frontend
73 #endif // NOT GHELPERS_H