]> git.lyx.org Git - features.git/blob - src/frontends/qt/GuiRef.h
#10571 improved handling of WM's signal when switching from or to full-screen window
[features.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 #include "FancyLineEdit.h"
18
19 #include "insets/InsetCommandParams.h"
20
21 #include <vector>
22
23 class QTreeWidgetItem;
24
25 namespace lyx {
26 namespace frontend {
27
28 class GuiRef : public GuiDialog, public Ui::RefUi
29 {
30         Q_OBJECT
31
32 public:
33         GuiRef(GuiView & lv);
34         /// Dialog inherited methods
35         //@{
36         void enableView(bool enable);
37         //@}
38
39 private Q_SLOTS:
40         void changed_adaptor();
41         void gotoClicked();
42         void filterLabels();
43         void resetFilter();
44         void refHighlighted(QTreeWidgetItem *);
45         void selectionChanged();
46         void refTextChanged(QString const &);
47         void refSelected(QTreeWidgetItem *);
48         void sortToggled();
49         void groupToggled();
50         void on_buttonBox_clicked(QAbstractButton *);
51         void updateClicked();
52         void resetDialog();
53         void dialogRejected();
54
55 private:
56         ///
57         bool isBufferDependent() const { return true; }
58         /** disconnect from the inset when the Apply button is pressed.
59          Allows easy insertion of multiple references. */
60         bool disconnectOnApply() const { return true; }
61         ///
62         void gotoRef(std::string const &);
63         ///
64         void gotoBookmark();
65         ///
66         void closeEvent(QCloseEvent * e);
67         ///
68         bool isValid();
69         /// apply changes
70         void applyView();
71         /// update dialog
72         void updateContents();
73         ///
74         void enableBoxes();
75
76         /// go to current reference
77         void gotoRef();
78         /// set go back button
79         void setGoBack();
80         /// set goto ref button
81         void setGotoRef();
82         /// re-enter references
83         void redoRefs();
84         /// update references
85         void updateRefs();
86         ///
87         bool initialiseParams(std::string const & data);
88         /// clean-up on hide.
89         void clearParams() { params_.clear(); }
90         /// clean-up on hide.
91         void dispatchParams();
92
93 private:
94         ///
95         InsetCommandParams params_;
96
97         /// contains the search box
98         FancyLineEdit * filter_;
99
100         /// went to a reference ?
101         bool at_ref_;
102         /// the last reference entered or examined
103         QString last_reference_;
104         /// store the buffer settings
105         int restored_buffer_;
106         /// store the last active buffer
107         int active_buffer_;
108         /// the references
109         std::vector<docstring> refs_;
110 };
111
112 } // namespace frontend
113 } // namespace lyx
114
115 #endif // GUIREF_H