]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QRef.h
The big renaming. Yowser.
[lyx.git] / src / frontends / qt2 / QRef.h
1 // -*- C++ -*-
2 /**
3  * \file QRef.h
4  * Copyright 2001 the LyX Team
5  * Read the file COPYING
6  *
7  * \author John Levon <moz@compsoc.man.ac.uk>
8  * \author Kalle Dalheimer <kalle@klaralvdalens-datakonsult.se>
9  */
10
11 #ifndef QREF_H
12 #define QREF_H
13
14 #include "DialogBase.h"
15 #include "LString.h"
16 #include "boost/utility.hpp"
17 #include "insets/insetcommand.h"
18
19 class Dialogs;
20 class LyXView;
21 class QRefDialog;
22
23 class QRef : public DialogBase {
24 public: 
25         QRef(LyXView *, Dialogs *);
26         ~QRef();
27
28         /// double-click a ref
29         void select(const char *);
30         /// highlight a ref
31         void highlight(const char *);
32         /// set sort
33         void set_sort(bool);
34         /// goto a ref (or back)
35         void goto_ref(); 
36         /// update dialog
37         void update(); 
38         /// update just the refs
39         void do_ref_update();
40         /// Apply changes
41         void apply();
42         /// close the connections
43         void close();
44  
45 private: 
46         enum Type {
47                 REF, PAGEREF, VREF, VPAGEREF, PRETTYREF
48         };
49
50         enum GotoType {
51                 GOTOREF, GOTOBACK
52         };
53  
54         /// Create the dialog if necessary, update it and display it.
55         void show();
56         /// Hide the dialog.
57         void hide();
58  
59         /// create a Reference inset
60         void createRef(string const &);
61         /// edit a Reference inset
62         void showRef(InsetCommand * const);
63  
64         /// update the keys list
65         void updateRefs(void);
66  
67         /// Real GUI implementation.
68         QRefDialog * dialog_;
69
70         /// the LyXView we belong to
71         LyXView * lv_;
72  
73         /** Which Dialogs do we belong to?
74             Used so we can get at the signals we have to connect to.
75         */
76         Dialogs * d_;
77         /// pointer to the inset if any
78         InsetCommand * inset_;
79         /// insets params
80         InsetCommandParams params;
81         /// is the inset we are reading from a readonly buffer ?
82         bool readonly;
83         
84         /// Hide connection.
85         SigC::Connection h_;
86         /// Update connection.
87         SigC::Connection u_;
88         /// Inset hide connection.
89         SigC::Connection ih_;
90
91         /// to sort or not to sort
92         bool sort;
93  
94         /// where to go
95         GotoType gotowhere;
96  
97         /// current type
98         Type type;
99  
100         /// available references
101         std::vector< string > refs;
102 };
103
104 #endif // QREF_H