]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiRef.h
Complete the removal of the embedding stuff. Maybe. It's hard to be sure we got every...
[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 "Dialog.h"
17 #include "ui_RefUi.h"
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 GuiCommand, 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
44 private:
45         ///
46         bool isBufferDependent() const { return true; }
47         /** disconnect from the inset when the Apply button is pressed.
48          Allows easy insertion of multiple references. */
49         bool disconnectOnApply() const { return true; }
50         ///
51         void gotoRef(std::string const &);
52         ///
53         void gotoBookmark();
54         ///
55         void closeEvent(QCloseEvent * e);
56         ///
57         bool isValid();
58         /// apply changes
59         void applyView();
60         /// update dialog
61         void updateContents();
62
63         /// is name allowed for this ?
64         bool nameAllowed();
65         /// is type allowed for this ?
66         bool typeAllowed();
67         /// go to current reference
68         void gotoRef();
69         /// set go back button
70         void setGoBack();
71         /// set goto ref button
72         void setGotoRef();
73         /// re-enter references
74         void redoRefs();
75         /// update references
76         void updateRefs();
77
78         /// sort or not persistent state
79         bool sort_;
80         /// went to a reference ?
81         bool at_ref_;
82         /// the last reference entered or examined
83         QString last_reference_;
84         /// store the buffer settings
85         int restored_buffer_;
86         /// the references
87         std::vector<docstring> refs_;
88 };
89
90 } // namespace frontend
91 } // namespace lyx
92
93 #endif // GUIREF_H