]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormTabular.h
15051e752c45b64ce421ef90be285c12f0f9e534
[lyx.git] / src / frontends / xforms / FormTabular.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  * 
5  *           LyX, The Document Processor
6  *       
7  *          Copyright 1995 Matthias Ettrich
8  *          Copyright 1995-2000 The LyX Team.
9  *
10  *======================================================*/
11 /* FormTabular.h
12  * FormTabular Interface Class
13  */
14
15 #ifndef FORMTABULAR_H
16 #define FORMTABULAR_H
17
18 #include <boost/smart_ptr.hpp>
19
20 #ifdef __GNUG__
21 #pragma interface
22 #endif
23
24 #include "FormInset.h"
25 #include "xformsBC.h"
26
27 class InsetTabular;
28 struct FD_form_tabular;
29 struct FD_form_tabular_options;
30 struct FD_form_column_options;
31 struct FD_form_cell_options;
32 struct FD_form_longtable_options;
33
34 /** This class provides an XForms implementation of the FormTabular Dialog.
35     The tabular dialog allows users to set/save their tabular.
36  */
37 class FormTabular : public FormInset {
38 public:
39         /// #FormTabular x(LyXFunc ..., Dialogs ...);#
40         FormTabular(LyXView *, Dialogs *);
41
42 private:
43         /// Pointer to the actual instantiation of the ButtonController.
44         virtual xformsBC & bc();
45         /** Redraw the form (on receipt of a Signal indicating, for example,
46             that the xforms colours have been re-mapped). */
47         virtual void redraw();
48         /// Disconnect signals. Also perform any necessary housekeeping.
49         virtual void disconnect();
50
51         /// Slot launching dialog to an existing inset
52         void showInset(InsetTabular *);
53         /// Slot launching dialog to an existing inset
54         void updateInset(InsetTabular *);
55         /// Update dialog before showing it
56         virtual void update();
57         /// Build the dialog
58         virtual void build();
59         /// Filter the inputs
60         virtual bool input(FL_OBJECT *, long);
61         /// Pointer to the actual instantiation of the xforms form
62         virtual FL_FORM * form() const;
63
64         /// Fdesign generated methods
65         FD_form_tabular * build_tabular();
66         ///
67         FD_form_tabular_options * build_tabular_options();
68         ///
69         FD_form_column_options * build_column_options();
70         ///
71         FD_form_cell_options * build_cell_options();
72         ///
73         FD_form_longtable_options * build_longtable_options();
74
75         /// Real GUI implementation.
76         boost::scoped_ptr<FD_form_tabular> dialog_;
77         ///
78         boost::scoped_ptr<FD_form_tabular_options> tabular_options_;
79         ///
80         boost::scoped_ptr<FD_form_column_options> column_options_;
81         ///
82         boost::scoped_ptr<FD_form_cell_options> cell_options_;
83         ///
84         boost::scoped_ptr<FD_form_longtable_options> longtable_options_;
85
86         /// pointer to the inset passed through showInset
87         InsetTabular * inset_;
88         ///
89         int actCell_;
90         /// The ButtonController
91         ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
92 };
93
94
95 inline
96 xformsBC & FormTabular::bc()
97 {
98         return bc_;
99 }
100 #endif