]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt/GuiRef.h
Make code a bit easier to read
[lyx.git] / src / frontends / qt / GuiRef.h
index d46bbad0a346ac8acdc282d12880b2b760fe02d8..7f8860bd5355c52b933619399bc0ce5244e52eba 100644 (file)
@@ -14,7 +14,6 @@
 
 #include "GuiDialog.h"
 #include "ui_RefUi.h"
-#include "FancyLineEdit.h"
 
 #include "insets/InsetCommandParams.h"
 
@@ -25,6 +24,8 @@ class QTreeWidgetItem;
 namespace lyx {
 namespace frontend {
 
+class FancyLineEdit;
+
 class GuiRef : public GuiDialog, public Ui::RefUi
 {
        Q_OBJECT
@@ -33,7 +34,7 @@ public:
        GuiRef(GuiView & lv);
        /// Dialog inherited methods
        //@{
-       void enableView(bool enable);
+       void enableView(bool enable) override;
        //@}
 
 private Q_SLOTS:
@@ -54,22 +55,22 @@ private Q_SLOTS:
 
 private:
        ///
-       bool isBufferDependent() const { return true; }
+       bool isBufferDependent() const override { return true; }
        /** disconnect from the inset when the Apply button is pressed.
         Allows easy insertion of multiple references. */
-       bool disconnectOnApply() const { return true; }
+       bool disconnectOnApply() const override { return true; }
        ///
        void gotoRef(std::string const &);
        ///
        void gotoBookmark();
        ///
-       void closeEvent(QCloseEvent * e);
+       void closeEvent(QCloseEvent * e) override;
        ///
-       bool isValid();
+       bool isValid() override;
        /// apply changes
-       void applyView();
+       void applyView() override;
        /// update dialog
-       void updateContents();
+       void updateContents() override;
        ///
        void enableBoxes();
 
@@ -84,11 +85,11 @@ private:
        /// update references
        void updateRefs();
        ///
-       bool initialiseParams(std::string const & data);
+       bool initialiseParams(std::string const & data) override;
        /// clean-up on hide.
-       void clearParams() { params_.clear(); }
+       void clearParams() override { params_.clear(); }
        /// clean-up on hide.
-       void dispatchParams();
+       void dispatchParams() override;
 
 private:
        ///
@@ -105,8 +106,10 @@ private:
        int restored_buffer_;
        /// store the last active buffer
        int active_buffer_;
-       /// the references
-       std::vector<docstring> refs_;
+       /// the references as three strings: plain label name, label as gui
+       /// string, and pretty dereferenced name ("Lemma 3")
+       /// FIXME: might be a good idea to use a custom struct
+       std::vector<std::tuple<docstring, docstring, docstring>> refs_;
 };
 
 } // namespace frontend