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