4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
10 * Full author contact details are available in file CREDITS.
17 #include "support/docstring.h"
18 #include "support/qstring_helpers.h"
31 std::string makeFontName(std::string const & family, std::string const & foundry);
33 std::pair<std::string,std::string> parseFontName(std::string const & name);
35 /// method to get a Length from widgets (LengthCombo)
36 std::string widgetsToLength(QLineEdit const * input, LengthCombo const * combo);
37 /// method to get a Length from widgets (QComboBox)
38 Length widgetsToLength(QLineEdit const * input, QComboBox const * combo);
40 //FIXME It would be nice if defaultUnit were a default argument
41 /// method to set widgets from a Length
42 void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
43 Length const & len, Length::UNIT default_unit);
44 /// method to set widgets from a string
45 void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
46 std::string const & len, Length::UNIT default_unit);
47 /// method to set widgets from a Length with optional "auto" if zero
48 void lengthAutoToWidgets(QLineEdit * input, LengthCombo * combo,
49 Length const & len, Length::UNIT defaultUnit);
51 //FIXME setAutoTextCB should really take an argument, as indicated, that
52 //determines what text is to be written for "auto". But making
53 //that work involves more extensive revisions than we now want
54 //to make, since "auto" also appears in updateContents() (see
56 //The right way to do this, I think, would be to define a class
57 //checkedLengthSet (and a partnering labeledLengthSete) that encapsulated
58 //the checkbox, line edit, and length combo together, and then made e.g.
59 //lengthToWidgets, widgetsToLength, etc, all public methods of that class.
60 //Perhaps even the validator could be exposed through it.
62 * sets a checkbox-line edit-length combo group, using "text" if the
63 * checkbox is unchecked and clearing the line edit if it previously
66 void setAutoTextCB(QCheckBox * checkBox, QLineEdit * lineEdit,
67 LengthCombo * lengthCombo/*, string text = "auto"*/);
70 /// format a string to the given width
71 docstring const formatted(docstring const & text, int w = 80);
75 * qt_ - i18nize string and convert to QString
77 * Use this in qt4/ instead of _()
79 QString const qt_(char const * str, const char * comment = 0);
83 * qt_ - i18nize string and convert to QString
85 * Use this in qt4/ instead of _()
87 QString const qt_(std::string const & str);