]> git.lyx.org Git - lyx.git/blob - src/frontends/qt/GuiRef.h
Improve some debug messages
[lyx.git] / src / frontends / qt / GuiRef.h
1 // -*- C++ -*-
2 /**
3  * \file GuiRef.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef GUIREF_H
13 #define GUIREF_H
14
15 #include "GuiDialog.h"
16 #include "ui_RefUi.h"
17
18 #include "insets/InsetCommandParams.h"
19
20 #include <vector>
21
22 class QTreeWidgetItem;
23
24 namespace lyx {
25 namespace frontend {
26
27 class FancyLineEdit;
28
29 class GuiRef : public GuiDialog, public Ui::RefUi
30 {
31         Q_OBJECT
32
33 public:
34         GuiRef(GuiView & lv);
35         /// Dialog inherited methods
36         //@{
37         void enableView(bool enable) override;
38         //@}
39
40 private Q_SLOTS:
41         void changed_adaptor();
42         void gotoClicked();
43         void filterLabels();
44         void resetFilter();
45         void refHighlighted(QTreeWidgetItem *);
46         void selectionChanged();
47         void refTextChanged(QString const &);
48         void refSelected(QTreeWidgetItem *);
49         void sortToggled();
50         void groupToggled();
51         void on_buttonBox_clicked(QAbstractButton *);
52         void updateClicked();
53         void resetDialog();
54         void dialogRejected();
55
56 private:
57         ///
58         bool isBufferDependent() const override { return true; }
59         /** disconnect from the inset when the Apply button is pressed.
60          Allows easy insertion of multiple references. */
61         bool disconnectOnApply() const override { return true; }
62         ///
63         void gotoRef(std::string const &);
64         ///
65         void gotoBookmark();
66         ///
67         void closeEvent(QCloseEvent * e) override;
68         ///
69         bool isValid() override;
70         /// apply changes
71         void applyView() override;
72         /// update dialog
73         void updateContents() override;
74         ///
75         void enableBoxes();
76
77         /// go to current reference
78         void gotoRef();
79         /// set go back button
80         void setGoBack();
81         /// set goto ref button
82         void setGotoRef();
83         /// re-enter references
84         void redoRefs();
85         /// update references
86         void updateRefs();
87         ///
88         bool initialiseParams(std::string const & data) override;
89         /// clean-up on hide.
90         void clearParams() override { params_.clear(); }
91         /// clean-up on hide.
92         void dispatchParams() override;
93
94 private:
95         ///
96         InsetCommandParams params_;
97
98         /// contains the search box
99         FancyLineEdit * filter_;
100
101         /// went to a reference ?
102         bool at_ref_;
103         /// the last reference entered or examined
104         QString last_reference_;
105         /// store the buffer settings
106         int restored_buffer_;
107         /// store the last active buffer
108         int active_buffer_;
109         /// the references
110         std::vector<docstring> refs_;
111 };
112
113 } // namespace frontend
114 } // namespace lyx
115
116 #endif // GUIREF_H