]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiRef.h
cosmetics
[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 closeEvent(QCloseEvent * e);
46         /// parent controller
47         ControlRef & controller();
48         ///
49         bool isValid();
50         /// apply changes
51         void applyView();
52         /// update dialog
53         void updateContents();
54
55         /// is name allowed for this ?
56         bool nameAllowed();
57         /// is type allowed for this ?
58         bool typeAllowed();
59         /// go to current reference
60         void gotoRef();
61         /// set go back button
62         void setGoBack();
63         /// set goto ref button
64         void setGotoRef();
65         /// re-enter references
66         void redoRefs();
67         /// update references
68         void updateRefs();
69
70         /// sort or not persistent state
71         bool sort_;
72         /// went to a reference ?
73         bool at_ref_;
74         /// the last reference entered or examined
75         QString last_reference_;
76         /// store the buffer settings
77         int restored_buffer_;
78         /// the references
79         std::vector<docstring> refs_;
80 };
81
82 } // namespace frontend
83 } // namespace lyx
84
85 #endif // GUIREF_H