]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiRef.h
move GuiCommand into hedar of its own. InsetCommandParams.h is expensive
[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 "GuiCommand.h"
16 #include "ui_RefUi.h"
17
18 #include <vector>
19
20 class QListWidgetItem;
21
22 namespace lyx {
23 namespace frontend {
24
25 class GuiRef : public GuiCommand, public Ui::RefUi
26 {
27         Q_OBJECT
28
29 public:
30         GuiRef(GuiView & lv);
31
32 private Q_SLOTS:
33         void changed_adaptor();
34         void gotoClicked();
35         void refHighlighted(QListWidgetItem *);
36         void selectionChanged();
37         void refSelected(QListWidgetItem *);
38         void sortToggled(bool);
39         void updateClicked();
40         void reset_dialog();
41
42 private:
43         ///
44         bool isBufferDependent() const { return true; }
45         /** disconnect from the inset when the Apply button is pressed.
46          Allows easy insertion of multiple references. */
47         bool disconnectOnApply() const { return true; }
48         ///
49         void gotoRef(std::string const &);
50         ///
51         void gotoBookmark();
52         ///
53         void closeEvent(QCloseEvent * e);
54         ///
55         bool isValid();
56         /// apply changes
57         void applyView();
58         /// update dialog
59         void updateContents();
60
61         /// is name allowed for this ?
62         bool nameAllowed();
63         /// is type allowed for this ?
64         bool typeAllowed();
65         /// go to current reference
66         void gotoRef();
67         /// set go back button
68         void setGoBack();
69         /// set goto ref button
70         void setGotoRef();
71         /// re-enter references
72         void redoRefs();
73         /// update references
74         void updateRefs();
75
76         /// sort or not persistent state
77         bool sort_;
78         /// went to a reference ?
79         bool at_ref_;
80         /// the last reference entered or examined
81         QString last_reference_;
82         /// store the buffer settings
83         int restored_buffer_;
84         /// the references
85         std::vector<docstring> refs_;
86 };
87
88 } // namespace frontend
89 } // namespace lyx
90
91 #endif // GUIREF_H