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