]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/QRef.h
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / qt4 / QRef.h
1 // -*- C++ -*-
2 /**
3  * \file QRef.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 QREF_H
13 #define QREF_H
14
15 #include "QDialogView.h"
16
17 #include <vector>
18
19 namespace lyx {
20 namespace frontend {
21
22 class ControlRef;
23 class QRefDialog;
24
25
26 // full qualification because qt4 has also a ControlRef type
27 class QRef
28         : public QController<lyx::frontend::ControlRef, QView<QRefDialog> >
29 {
30 public:
31         friend class QRefDialog;
32
33         QRef(Dialog &);
34
35 protected:
36         virtual bool isValid();
37
38 private:
39         /// apply changes
40         virtual void apply();
41         /// build dialog
42         virtual void build_dialog();
43         /// update dialog
44         virtual void update_contents();
45
46         /// is name allowed for this ?
47         bool nameAllowed();
48
49         /// is type allowed for this ?
50         bool typeAllowed();
51
52         /// go to current reference
53         void gotoRef();
54
55         /// set go back button
56         void setGoBack();
57
58         /// set goto ref button
59         void setGotoRef();
60
61         /// re-enter references
62         void redoRefs();
63
64         /// update references
65         void updateRefs();
66
67         /// sort or not persistent state
68         bool sort_;
69
70         /// at a reference ?
71         bool at_ref_;
72
73         /// store the buffer settings
74         int restored_buffer_;
75
76         /// the references
77         std::vector<std::string> refs_;
78 };
79
80 } // namespace frontend
81 } // namespace lyx
82
83 #endif // QREF_H