]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/qt_helpers.h
Fix several filename and environment variable encoding problems
[lyx.git] / src / frontends / qt4 / qt_helpers.h
1 // -*- C++ -*-
2 /**
3  * \file qt_helpers.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Dekel Tsur
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef QTHELPERS_H
13 #define QTHELPERS_H
14
15 #include "lyxlength.h"
16 #include "support/docstring.h"
17 #include "support/qstring_helpers.h"
18
19 #include <QString>
20
21 #include <utility>
22
23 class QComboBox;
24 class QLineEdit;
25
26 class LengthCombo;
27
28 namespace lyx {
29
30 std::string makeFontName(std::string const & family, std::string const & foundry);
31
32 std::pair<std::string,std::string> parseFontName(std::string const & name);
33
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);
38
39 /// method to set widgets from a LyXLength
40 void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
41         std::string const & len, LyXLength::UNIT default_unit);
42
43 /// format a string to the given width
44 docstring const formatted(docstring const & text, int w = 80);
45
46
47 /**
48  * qt_ - i18nize string and convert to QString
49  *
50  * Use this in qt4/ instead of _()
51  */
52 QString const qt_(char const * str, const char * comment = 0);
53
54
55 /**
56  * qt_ - i18nize string and convert to QString
57  *
58  * Use this in qt4/ instead of _()
59  */
60 QString const qt_(std::string const & str);
61
62 } // namespace lyx
63
64 #endif // QTHELPERS_H