4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
17 #include "lyxlength.h"
18 //#include "lengthcombo.h"
20 #include "support/types.h"
30 std::string makeFontName(std::string const & family, std::string const & foundry);
32 std::pair<std::string,std::string> parseFontName(std::string const & name);
34 /// method to get a LyXLength from widgets (LengthCombo)
35 std::string widgetsToLength(QLineEdit const * input, LengthCombo const * combo);
36 /// method to get a LyXLength from widgets (QComboBox)
37 LyXLength widgetsToLength(QLineEdit const * input, QComboBox const * combo);
39 /// method to set widgets from a LyXLength
40 void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
41 std::string const & len, LyXLength::UNIT default_unit);
43 /// format a string to the given width
44 std::string const formatted(std::string const & text, int w = 80);
47 * toqstr - convert char * into unicode
49 * Use this whenever there's a user-visible string that is encoded
50 * for the locale (menus, dialogs etc.)
52 QString const toqstr(char const * str);
56 * toqstr - convert string into unicode
58 * Use this whenever there's a user-visible string that is encoded
59 * for the locale (menus, dialogs etc.)
61 QString const toqstr(std::string const & str);
65 * toqstr - convert ucs4 into QString
67 * QString uses ucs2 (a.k.a utf16) internally.
69 QString const ucs4_to_qstring(lyx::char_type const * str, size_t ls);
71 QString const ucs4_to_qstring(std::vector<lyx::char_type> const & ucs4);
73 std::vector<lyx::char_type> qstring_to_ucs4(QString const & qstr);
75 void qstring_to_ucs4(QString const & qstr, std::vector<lyx::char_type> & ucs4);
77 lyx::char_type const qchar_to_ucs4(QChar const & qchar);
79 QChar const ucs4_to_qchar(lyx::char_type const & ucs4);
83 * qt_ - i18nize string and convert to unicode
85 * Use this in qt4/ instead of qt_()
87 QString const qt_(char const * str);
91 * qt_ - i18nize string and convert to unicode
93 * Use this in qt4/ instead of qt_()
95 QString const qt_(std::string const & str);
99 * fromqstr - convert QString into std::string in locale
101 * Return the QString encoded in the locale
103 std::string const fromqstr(QString const & str);
105 #endif // QTHELPERS_H