]> git.lyx.org Git - lyx.git/blob - src/frontends/gnome/FormRef.h
try this for distinguishing inner and outer tabs
[lyx.git] / src / frontends / gnome / FormRef.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  *
5  *           LyX, The Document Processor
6  *
7  *           Copyright 2000 The LyX Team.
8  *
9  * ======================================================
10  */
11
12 #ifndef FORMREF_H
13 #define FORMREF_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "DialogBase.h"
20 #include "LString.h"
21 #include "boost/utility.hpp"
22 #include "insets/insetcommand.h"
23
24 #include <gtk--/container.h>
25 #include <gtk--/clist.h>
26 #include <gtk--/button.h>
27 #include <gnome--/entry.h>
28 #include <gtk--/optionmenu.h>
29 #include <gtk--/menu.h>
30 #include "pixbutton.h"
31
32 /** This class provides an Gnome implementation of the FormRef Dialog.
33  */
34 class FormRef : public DialogBase, public noncopyable {
35 public:
36   ///
37   FormRef(LyXView *, Dialogs *);
38   ///
39   ~FormRef();
40 private:
41   ///
42   enum Type{
43     ///
44     REF,
45     ///
46     PAGEREF,
47     ///
48     VREF,
49     ///
50     VPAGEREF,
51     ///
52     PRETTYREF
53   };
54   ///
55   enum Goto{
56     ///
57     GOREF,
58     ///
59     GOBACK
60   };
61   ///
62   enum ActionType {
63     ///
64     INSERT,
65     ///
66     EDIT
67   };
68
69   /// Slot launching dialog to (possibly) create a new inset
70   void createInset( string const & );
71   /// Slot launching dialog to an existing inset
72   void showInset( InsetCommand * const );
73   
74   /// Update dialog before showing it (not used in this implementation)
75   virtual void update() { } 
76   virtual void updateSlot(bool = false);
77   /// Apply from dialog (modify or create inset)
78   virtual void apply();
79   /// Explicitly free the dialog.
80   void free();
81   /// dummy function
82   virtual void show() { }
83   /// Show selection of the references
84   void showStageSelect();
85   /// Edit properties
86   void showStageAction();
87   /// Error (no labels)
88   void showStageError(string const & mess);
89   /// Hide the dialog.
90   void hide();
91   /// Go to reference or return back
92   void gotoRef();
93   
94   /// moves from Search to Select "stage"
95   void moveFromSelectToAction();
96
97   /// changes the type of the reference
98   void changeType(Type);
99   ///
100   Type getType() const;
101   ///
102   string getName( Type type ) const;
103
104   /** Which LyXFunc do we use?
105       We could modify Dialogs to have a visible LyXFunc* instead and
106       save a couple of bytes per dialog.
107   */
108   LyXView * lv_;
109   /** Which Dialogs do we belong to?
110       Used so we can get at the signals we have to connect to.
111   */
112   Dialogs * d_;
113   /// pointer to the inset passed through showInset (if any)
114   InsetCommand * inset_;
115   /// the nitty-griity. What is modified and passed back
116   InsetCommandParams params;
117   /// Update connection.
118   Connection u_;
119   /// Hide connection.
120   Connection h_;
121   /// inset::hide connection.
122   Connection ih_;
123   /// 
124   std::vector<string> refs;
125   ///
126   Type reftype_;
127   ///
128   Goto gototype_;
129   ///
130   ActionType acttype_;
131   
132   /// Real GUI implementation.
133   Gtk::Container * dialog_;
134   Gtk::CList * list_;
135   Gtk::Button * b_ok;
136   Gtk::Button * b_cancel;
137   Gnome::Entry * name_;
138   Gtk::OptionMenu * choice_;
139   Gnome::PixButton * b_goto;
140 };
141
142 #endif