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