]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/FormRef.h
The usual small monday fixes
[lyx.git] / src / frontends / kde / FormRef.h
1 /* FormRef.h
2  * (C) 2000 LyX Team
3  * John Levon, moz@compsoc.man.ac.uk
4  */
5
6 /***************************************************************************
7  *                                                                         *
8  *   This program is free software; you can redistribute it and/or modify  *
9  *   it under the terms of the GNU General Public License as published by  *
10  *   the Free Software Foundation; either version 2 of the License, or     *
11  *   (at your option) any later version.                                   *
12  *                                                                         *
13  ***************************************************************************/
14
15 #ifndef FORMREF_H
16 #define FORMREF_H
17
18 #include "DialogBase.h"
19 #include "LString.h"
20 #include "boost/utility.hpp"
21 #include "insets/insetcommand.h"
22
23 class Dialogs;
24 class LyXView;
25 class FormRefDialog;
26
27 class FormRef : public DialogBase, public noncopyable {
28 public: 
29         /**@name Constructors and Destructors */
30         //@{
31         ///
32         FormRef(LyXView *, Dialogs *);
33         /// 
34         ~FormRef();
35         //@}
36
37         /// double-click a ref
38         void select(const char *);
39         /// highlight a ref
40         void highlight(const char *);
41         /// set sort
42         void set_sort(bool);
43         /// goto a ref (or back)
44         void goto_ref(); 
45         /// update dialog
46         void update(); 
47         /// update just the refs
48         void do_ref_update();
49         /// Apply changes
50         void apply();
51         /// close the connections
52         void close();
53  
54 private: 
55         enum Type {
56                 REF, PAGEREF, VREF, VPAGEREF, PRETTYREF
57         }; 
58
59         enum GotoType {
60                 GOTOREF, GOTOBACK
61         };
62  
63         /// Create the dialog if necessary, update it and display it.
64         void show();
65         /// Hide the dialog.
66         void hide();
67  
68         /// create a Reference inset
69         void createRef(string const &);
70         /// edit a Reference inset
71         void showRef(InsetCommand * const);
72  
73         /// update the keys list
74         void updateRefs(void);
75  
76         /// Real GUI implementation.
77         FormRefDialog * dialog_;
78
79         /// the LyXView we belong to
80         LyXView * lv_;
81  
82         /** Which Dialogs do we belong to?
83             Used so we can get at the signals we have to connect to.
84         */
85         Dialogs * d_;
86         /// pointer to the inset if any
87         InsetCommand * inset_;
88         /// insets params
89         InsetCommandParams params;
90         /// is the inset we are reading from a readonly buffer ?
91         bool readonly;
92         
93         /// Hide connection.
94         Connection h_;
95         /// Update connection.
96         Connection u_;
97         /// Inset hide connection.
98         Connection ih_;
99
100         /// to sort or not to sort
101         bool sort;
102  
103         /// where to go
104         GotoType gotowhere;
105  
106         /// current type
107         Type type;
108  
109         /// available references
110         std::vector< string > refs;
111 };
112
113 #endif