]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/FormRef.h
A few tweaks needed by cxx
[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 "support/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         /// select a ref
38         void select(const char *);
39         /// set sort
40         void set_sort(bool);
41         /// goto a ref (or back)
42         void goto_ref(); 
43         /// update dialog
44         void update(); 
45         /// Apply changes
46         void apply();
47         /// close the connections
48         void close();
49  
50 private: 
51         enum Type {
52                 REF, PAGEREF, VREF, VPAGEREF, PRETTYREF,
53         }; 
54
55         enum GotoType {
56                 GOTOREF, GOTOBACK,
57         };
58  
59         /// Create the dialog if necessary, update it and display it.
60         void show();
61         /// Hide the dialog.
62         void hide();
63  
64         /// create a Reference inset
65         void createRef(string const &);
66         /// edit a Reference inset
67         void showRef(InsetCommand * const);
68  
69         /// update the keys list
70         void updateRefs(void);
71  
72         /// Real GUI implementation.
73         FormRefDialog * dialog_;
74
75         /// the LyXView we belong to
76         LyXView * lv_;
77  
78         /** Which Dialogs do we belong to?
79             Used so we can get at the signals we have to connect to.
80         */
81         Dialogs * d_;
82         /// pointer to the inset if any
83         InsetCommand * inset_;
84         /// insets params
85         InsetCommandParams params;
86         /// is the inset we are reading from a readonly buffer ?
87         bool readonly;
88         
89         /// Hide connection.
90         Connection h_;
91         /// Update connection.
92         Connection u_;
93         /// Inset hide connection.
94         Connection ih_;
95
96         /// to sort or not to sort
97         bool sort;
98  
99         /// where to go
100         GotoType gotowhere;
101  
102         /// current type
103         Type type;
104  
105         /// available references
106         std::vector< string > refs;
107 };
108
109 #endif