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