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/qstring_helpers.h"
18 #include "support/strfwd.h"
32 namespace support { class FileFilterList; }
36 /// method to get a Length from widgets (LengthCombo)
37 std::string widgetsToLength(QLineEdit const * input, LengthCombo const * combo);
38 /// method to get a Length from widgets (QComboBox)
39 Length widgetsToLength(QLineEdit const * input, QComboBox const * combo);
41 //FIXME It would be nice if defaultUnit were a default argument
42 /// method to set widgets from a Length
43 void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
44 Length const & len, Length::UNIT default_unit);
45 /// method to set widgets from a string
46 void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
47 std::string const & len, Length::UNIT default_unit);
48 /// method to set widgets from a Length with optional "auto" if zero
49 void lengthAutoToWidgets(QLineEdit * input, LengthCombo * combo,
50 Length const & len, Length::UNIT defaultUnit);
52 /// colors a widget red if invalid
53 void setValid(QWidget * widget, bool valid);
55 } // namespace frontend
59 * qt_ - i18nize string and convert to QString
61 * Use this in qt4/ instead of _()
63 QString const qt_(char const * str, const char * comment = 0);
67 * qt_ - i18nize string and convert to QString
69 * Use this in qt4/ instead of _()
71 QString const qt_(std::string const & str);
74 typedef std::pair<docstring, std::string> LanguagePair;
76 /** If the caller is the character dialog, add "No change" and "Reset"
79 std::vector<LanguagePair> const getLanguageData(bool character_dlg);
81 /** Wrapper around browseFile which tries to provide a filename
82 relative to relpath. If the relative path is of the form "foo.txt"
83 or "bar/foo.txt", then it is returned as relative. OTOH, if it is
84 of the form "../baz/foo.txt", an absolute path is returned. This is
85 intended to be useful for insets which encapsulate files/
87 docstring browseRelFile(docstring const & filename,
88 docstring const & refpath,
89 docstring const & title,
90 support::FileFilterList const & filters,
92 docstring const & label1 = docstring(),
93 docstring const & dir1 = docstring(),
94 docstring const & label2 = docstring(),
95 docstring const & dir2 = docstring());
98 /** Build filelists of all availabe bst/cls/sty-files. Done through
99 * kpsewhich and an external script, saved in *Files.lst.
101 void rescanTexStyles();
103 /** Fill \c contents from one of the three texfiles.
104 * Each entry in the file list is returned as a name_with_path
106 void getTexFileList(std::string const & filename, std::vector<std::string> & contents);
108 // wrapper around the docstring versions
109 QString internalPath(const QString &);
110 QString onlyFilename(const QString & str);
111 QString onlyPath(const QString & str);
115 #endif // QTHELPERS_H