]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/qt_helpers.h
fix math fonts with LyX/Mac
[lyx.git] / src / frontends / qt2 / 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 <utility>
16
17 #include "lyxlength.h"
18
19 class LengthCombo;
20 class QLineEdit;
21 class QString;
22
23 std::string makeFontName(std::string const & family, std::string const & foundry);
24
25 std::pair<std::string,std::string> parseFontName(std::string const & name);
26
27 /// method to get a LyXLength from widgets
28 std::string widgetsToLength(QLineEdit const * input, LengthCombo const * combo);
29
30 /// method to set widgets from a LyXLength
31 void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
32         std::string const & len, LyXLength::UNIT default_unit);
33
34 /// format a string to the given width
35 std::string const formatted(std::string const & text, int w = 80);
36
37 /**
38  * toqstr - convert char * into unicode
39  *
40  * Use this whenever there's a user-visible string that is encoded
41  * for the locale (menus, dialogs etc.)
42  */
43 QString const toqstr(char const * str);
44
45
46 /**
47  * toqstr - convert string into unicode
48  *
49  * Use this whenever there's a user-visible string that is encoded
50  * for the locale (menus, dialogs etc.)
51  */
52 QString const toqstr(std::string const & str);
53
54
55 /**
56  * qt_ - i18nize string and convert to unicode
57  *
58  * Use this in qt2/ instead of qt_()
59  */
60 QString const qt_(char const * str);
61
62
63 /**
64  * qt_ - i18nize string and convert to unicode
65  *
66  * Use this in qt2/ instead of qt_()
67  */
68 QString const qt_(std::string const & str);
69
70
71 /**
72  * fromqstr - convert QString into std::string in locale
73  *
74  * Return the QString encoded in the locale
75  */
76 std::string const fromqstr(QString const & str);
77
78 #endif // QTHELPERS_H