]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/qt_helpers.h
use forward declaration...
[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  * \author Richard Heck
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef QTHELPERS_H
14 #define QTHELPERS_H
15
16 #include "Length.h"
17 #include "support/qstring_helpers.h"
18 #include "support/strfwd.h"
19
20 class QComboBox;
21 class QLineEdit;
22 class QCheckBox;
23 class QString;
24 class QWidget;
25
26 class LengthCombo;
27
28 namespace lyx {
29
30 /// method to get a Length from widgets (LengthCombo)
31 std::string widgetsToLength(QLineEdit const * input, LengthCombo const * combo);
32 /// method to get a Length from widgets (QComboBox)
33 Length widgetsToLength(QLineEdit const * input, QComboBox const * combo);
34
35 //FIXME It would be nice if defaultUnit were a default argument
36 /// method to set widgets from a Length
37 void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
38         Length const & len, Length::UNIT default_unit);
39 /// method to set widgets from a string
40 void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
41         std::string const & len, Length::UNIT default_unit);
42 /// method to set widgets from a Length with optional "auto" if zero
43 void lengthAutoToWidgets(QLineEdit * input, LengthCombo * combo,
44         Length const & len, Length::UNIT defaultUnit);
45
46 /// colors a widget red if invalid
47 void setValid(QWidget * widget, bool valid);
48
49
50 /**
51  * qt_ - i18nize string and convert to QString
52  *
53  * Use this in qt4/ instead of _()
54  */
55 QString const qt_(char const * str, const char * comment = 0);
56
57
58 /**
59  * qt_ - i18nize string and convert to QString
60  *
61  * Use this in qt4/ instead of _()
62  */
63 QString const qt_(std::string const & str);
64
65 } // namespace lyx
66
67 #endif // QTHELPERS_H