]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiRef.h
Add missing initialization
[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 #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 updateClicked();
51         void resetDialog();
52         void dialogRejected();
53
54 private:
55         ///
56         bool isBufferDependent() const { return true; }
57         /** disconnect from the inset when the Apply button is pressed.
58          Allows easy insertion of multiple references. */
59         bool disconnectOnApply() const { return true; }
60         ///
61         void gotoRef(std::string const &);
62         ///
63         void gotoBookmark();
64         ///
65         void closeEvent(QCloseEvent * e);
66         ///
67         bool isValid();
68         /// apply changes
69         void applyView();
70         /// update dialog
71         void updateContents();
72         ///
73         void enableBoxes();
74
75         /// is name allowed for this ?
76         bool nameAllowed();
77         /// is type allowed for this ?
78         bool typeAllowed();
79         /// go to current reference
80         void gotoRef();
81         /// set go back button
82         void setGoBack();
83         /// set goto ref button
84         void setGotoRef();
85         /// re-enter references
86         void redoRefs();
87         /// update references
88         void updateRefs();
89         ///
90         bool initialiseParams(std::string const & data);
91         /// clean-up on hide.
92         void clearParams() { params_.clear(); }
93         /// clean-up on hide.
94         void dispatchParams();
95
96 private:
97         ///
98         InsetCommandParams params_;
99
100         /// contains the search box
101         FancyLineEdit * filter_;
102
103         /// went to a reference ?
104         bool at_ref_;
105         /// the last reference entered or examined
106         QString last_reference_;
107         /// store the buffer settings
108         int restored_buffer_;
109         /// store the last active buffer
110         int active_buffer_;
111         /// the references
112         std::vector<docstring> refs_;
113 };
114
115 } // namespace frontend
116 } // namespace lyx
117
118 #endif // GUIREF_H