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