]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/qt_helpers.h
Use QFontMetrics information for underlines (and friends) width and position
[lyx.git] / src / frontends / qt4 / qt_helpers.h
index 24ec4f7f3aa9320a4eb128375b0703825dfa4715..fcdcd53102e85a9dfcdd2230e180e9653d9cd44e 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "Length.h"
 #include "support/qstring_helpers.h"
+#include "support/filetools.h"
 #include "qt_i18n.h"
 
 #include <QHeaderView>
@@ -31,7 +32,7 @@ namespace lyx {
 namespace support { class FileName; }
 
 class BufferParams;
-
 namespace frontend {
 
 class LengthCombo;
@@ -41,13 +42,17 @@ std::string widgetsToLength(QLineEdit const * input, LengthCombo const * combo);
 /// method to get a Length from widgets (QComboBox)
 Length widgetsToLength(QLineEdit const * input, QComboBox const * combo);
 
-//FIXME It would be nice if defaultUnit were a default argument
 /// method to set widgets from a Length
+//FIXME Remove default_unit argument for the first form. FIXME Change
+// all the code to remove default_unit argument when equal to the
+// default.
 void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
-Length const & len, Length::UNIT default_unit);
+                    Length const & len, 
+                    Length::UNIT default_unit = Length::defaultUnit());
 /// method to set widgets from a string
 void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
-std::string const & len, Length::UNIT default_unit);
+                    std::string const & len, 
+                    Length::UNIT default_unit = Length::defaultUnit());
 /// method to set widgets from a docstring
 void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
 docstring const & len, Length::UNIT default_unit);
@@ -62,6 +67,11 @@ void doubleToWidget(QLineEdit * input, double const & value,
 /// method to set a (localized) double value in a widget (QLineEdit)
 void doubleToWidget(QLineEdit * input, std::string const & value,
        char f = 'g', int prec = 6);
+/**
+ * method to format localized floating point numbers without
+ * ever using scientific notation
+ */
+QString formatLocFPNumber(double d);
 
 /// colors a widget red if invalid
 void setValid(QWidget * widget, bool valid);
@@ -87,11 +97,13 @@ QString const qt_(QString const & qstr);
 
 ///
 support::FileName libFileSearch(QString const & dir, QString const & name,
-                               QString const & ext = QString());
+                               QString const & ext = QString(),
+                               support::search_mode mode = support::must_exist);
 
 ///
 support::FileName imageLibFileSearch(QString & dir, QString const & name,
-                                    QString const & ext = QString());
+                               QString const & ext = QString(),
+                               support::search_mode mode = support::must_exist);
 
 /** Wrappers around browseFile which try to provide a filename
        relative to relpath.