]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiRef.h
Add search and grouping facility to Crossref dialog (bug #6304).
[lyx.git] / src / frontends / qt4 / 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 GuiRef : public GuiDialog, public Ui::RefUi
28 {
29         Q_OBJECT
30
31 public:
32         GuiRef(GuiView & lv);
33
34 private Q_SLOTS:
35         void changed_adaptor();
36         void gotoClicked();
37         void on_findLE_textChanged(const QString &);
38         void on_searchPB_clicked();
39         void refHighlighted(QTreeWidgetItem *);
40         void selectionChanged();
41         void refSelected(QTreeWidgetItem *);
42         void sortToggled();
43         void caseSensitiveToggled();
44         void groupToggled();
45         void updateClicked();
46         void resetDialog();
47         void dialogRejected();
48
49 private:
50         ///
51         bool isBufferDependent() const { return true; }
52         /** disconnect from the inset when the Apply button is pressed.
53          Allows easy insertion of multiple references. */
54         bool disconnectOnApply() const { return true; }
55         ///
56         void gotoRef(std::string const &);
57         ///
58         void gotoBookmark();
59         ///
60         void closeEvent(QCloseEvent * e);
61         ///
62         bool isValid();
63         /// apply changes
64         void applyView();
65         /// update dialog
66         void updateContents();
67
68         /// is name allowed for this ?
69         bool nameAllowed();
70         /// is type allowed for this ?
71         bool typeAllowed();
72         /// go to current reference
73         void gotoRef();
74         /// set go back button
75         void setGoBack();
76         /// set goto ref button
77         void setGotoRef();
78         /// re-enter references
79         void redoRefs();
80         /// update references
81         void updateRefs();
82         ///
83         bool initialiseParams(std::string const & data);
84         /// clean-up on hide.
85         void clearParams() { params_.clear(); }
86         /// clean-up on hide.
87         void dispatchParams();
88
89 private:
90         ///
91         InsetCommandParams params_;
92
93         /// went to a reference ?
94         bool at_ref_;
95         /// the last reference entered or examined
96         QString last_reference_;
97         /// store the buffer settings
98         int restored_buffer_;
99         /// store the last active buffer
100         int active_buffer_;
101         /// the references
102         std::vector<docstring> refs_;
103 };
104
105 } // namespace frontend
106 } // namespace lyx
107
108 #endif // GUIREF_H