]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt/qt_helpers.h
Make code a bit easier to read
[lyx.git] / src / frontends / qt / qt_helpers.h
index 6c7c366f3d9d46d9813d36e79dfb2debcda63ca4..f3230b2d3212566b27fea9dd312877d0cc2c3fde 100644 (file)
@@ -5,7 +5,7 @@
  * Licence details can be found in the file COPYING.
  *
  * \author Dekel Tsur
- * \author Richard Heck
+ * \author Richard Kimberly Heck
  *
  * Full author contact details are available in file CREDITS.
  */
 
 class QComboBox;
 class QLineEdit;
-class QCheckBox;
 class QString;
 class QWidget;
-template <class T> class QList;
 
 namespace lyx {
 
 namespace support { class FileName; }
 
-class BufferParams;
-
 namespace frontend {
 
 class LengthCombo;
@@ -65,7 +61,7 @@ double widgetToDouble(QLineEdit const * input);
 /// method to get a double value from a localized widget (QLineEdit)
 std::string widgetToDoubleStr(QLineEdit const * input);
 /// method to set a (localized) double value in a widget (QLineEdit)
-void doubleToWidget(QLineEdit * input, double const & value,
+void doubleToWidget(QLineEdit * input, double value,
        char f = 'g', int prec = 6);
 /// method to set a (localized) double value in a widget (QLineEdit)
 void doubleToWidget(QLineEdit * input, std::string const & value,
@@ -93,17 +89,14 @@ void focusAndHighlight(QAbstractItemView * w);
 void setMessageColour(std::list<QWidget *> highlighted,
                       std::list<QWidget *> plain);
 
-/// Qt5 changed setSectionMode to setSectionResizeMode
-/// These wrappers work for Qt4 and Qt5
-void setSectionResizeMode(QHeaderView * view,
-    int logicalIndex, QHeaderView::ResizeMode mode);
-void setSectionResizeMode(QHeaderView * view,
-       QHeaderView::ResizeMode mode);
 /// Shows a directory in OSs file browser
 void showDirectory(support::FileName const & directory);
-/// handle request for showing citation content - shows pdf or 
-/// web page in target; external script can be used for pdf view
-void showTarget(std::string const & target);
+/// handle request for showing citation content - shows pdf/ps or
+/// web page in target; external script can be used for pdf/ps view
+/// \p pdfv takes a pad viewer, \p psv a ps viewer
+void showTarget(std::string const & target,
+               std::string const & pdfv,
+               std::string const & psv);
 
 } // namespace frontend
 
@@ -127,47 +120,6 @@ support::FileName imageLibFileSearch(QString & dir, QString const & name,
                                QString const & ext = QString(),
                                support::search_mode mode = support::must_exist);
 
-/** Wrappers around browseFile which try to provide a filename
-       relative to relpath.
-
-\param title: title for dialog
-
-\param filters: *.ps, etc
-
-\param save: whether to save dialog info (current path, etc) for next use.
-
-The \param labelN and \param dirN arguments provide for extra buttons
-in the dialog (e.g., "Templates" and a path to that directory).
-
-The difference between the functions concerns when we think we have a
-relative path.
-
-In \c browseRelToParent, we return a relative path only if it IS NOT of
-       the form "../../foo.txt".
-
-In \c browseRelToSub, we return a relative path only if it IS of the
- form "../../foo.txt".
-*/
-QString browseRelToParent(QString const & filename,
-       QString const & relpath,
-       QString const & title,
-       QStringList const & filters,
-       bool save = false,
-       QString const & label1 = QString(),
-       QString const & dir1 = QString(),
-       QString const & label2 = QString(),
-       QString const & dir2 = QString());
-
-QString browseRelToSub(QString const & filename,
-       QString const & relpath,
-       QString const & title,
-       QStringList const & filters,
-       bool save = false,
-       QString const & label1 = QString(),
-       QString const & dir1 = QString(),
-       QString const & label2 = QString(),
-       QString const & dir2 = QString());
-
 /** Build filelists of all available bst/cls/sty-files. Done through
 *  kpsewhich and an external script, saved in *Files.lst.
 *  \param arg: cls, sty, bst, or bib, as required by TeXFiles.py.
@@ -191,8 +143,8 @@ QString internalPath(QString const &);
 QString onlyFileName(QString const & str);
 QString onlyPath(QString const & str);
 QStringList fileFilters(QString const & description);
-
-QString changeExtension(QString const & oldname, QString const & extension);
+/// all files wildcard for filter in qt dialogs (crossplatform)
+QString wildcardAllFiles();
 
 /// Remove the extension from \p name
 QString removeExtension(QString const & name);
@@ -245,9 +197,9 @@ private:
 #endif
 
 
-// Check if qstr is understood as rich text (Qt HTML) and if so, produce a
+// Check if text is understood as rich text (Qt HTML) and if so, produce a
 // rendering in plain text.
-QString qtHtmlToPlainText(QString const & qstr);
+QString qtHtmlToPlainText(QString const & text);
 
 
 } // namespace lyx