]> git.lyx.org Git - lyx.git/blob - src/frontends/gnome/FormIndex.h
Patches from Angus and Marko
[lyx.git] / src / frontends / gnome / FormIndex.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 FORMINDEX_H
13 #define FORMINDEX_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 <gnome--/entry.h>
26 #include <gtk--/label.h>
27
28 /** This class provides an Gnome implementation of the FormIndex Dialog.
29  */
30 class FormIndex : public DialogBase, public noncopyable {
31 public:
32   ///
33   FormIndex(LyXView *, Dialogs *);
34   ///
35   ~FormIndex();
36 private:
37   /// Slot launching dialog to (possibly) create a new inset
38   void createInset( string const & );
39   /// Slot launching dialog to an existing inset
40   void showInset( InsetCommand * const );
41   
42   /// Update dialog before showing it
43   virtual void update() { }
44   virtual void updateSlot(bool = false);
45   /// Apply from dialog (modify or create inset)
46   virtual void apply();
47   /// Explicitly free the dialog.
48   void free();
49   /// Create the dialog if necessary, update it and display it.
50   void show();
51   /// Hide the dialog.
52   void hide();
53   
54   /** Which LyXFunc do we use?
55       We could modify Dialogs to have a visible LyXFunc* instead and
56       save a couple of bytes per dialog.
57   */
58   LyXView * lv_;
59   /** Which Dialogs do we belong to?
60       Used so we can get at the signals we have to connect to.
61   */
62   Dialogs * d_;
63   /// pointer to the inset passed through showInset (if any)
64   InsetCommand * inset_;
65   /// the nitty-griity. What is modified and passed back
66   InsetCommandParams params;
67   /// Update connection.
68   Connection u_;
69   /// Hide connection.
70   Connection h_;
71   /// inset::hide connection.
72   Connection ih_;
73
74   /// Real GUI implementation.
75   Gtk::Container * dialog_;
76   Gnome::Entry * keyword_;
77   Gtk::Button * b_ok;
78   Gtk::Button * b_cancel;
79 };
80
81 #endif