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