]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormTabular.h
John's Layout Tabular UI improvements and Martins fixes to clearing the
[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-2001 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
26 class InsetTabular;
27 struct FD_form_tabular;
28 struct FD_form_tabular_options;
29 struct FD_form_column_options;
30 struct FD_form_cell_options;
31 struct FD_form_longtable_options;
32
33 /** This class provides an XForms implementation of the FormTabular Dialog.
34     The tabular dialog allows users to set/save their tabular.
35  */
36 class FormTabular : public FormInset {
37 public:
38         /// #FormTabular x(LyXFunc ..., Dialogs ...);#
39         FormTabular(LyXView *, Dialogs *);
40
41 private:
42         /// Pointer to the actual instantiation of the ButtonController.
43         virtual xformsBC & bc();
44         /** Redraw the form (on receipt of a Signal indicating, for example,
45             that the xforms colours have been re-mapped). */
46         virtual void redraw();
47         /// Disconnect signals. Also perform any necessary housekeeping.
48         virtual void disconnect();
49
50         /// Slot launching dialog to an existing inset
51         void showInset(InsetTabular *);
52         /// Slot launching dialog to an existing inset
53         void updateInset(InsetTabular *);
54         /// Update dialog before showing it
55         virtual void update();
56         /// Build the dialog
57         virtual void build();
58         /// Filter the inputs
59         virtual bool input(FL_OBJECT *, long);
60         /// Pointer to the actual instantiation of the xforms form
61         virtual FL_FORM * form() const;
62         ///
63         virtual int checkLongtableOptions(FL_OBJECT *, string &);
64
65         /// Fdesign generated methods
66         FD_form_tabular * build_tabular();
67         ///
68         FD_form_tabular_options * build_tabular_options();
69         ///
70         FD_form_column_options * build_column_options();
71         ///
72         FD_form_cell_options * build_cell_options();
73         ///
74         FD_form_longtable_options * build_longtable_options();
75
76         /// Real GUI implementation.
77         boost::scoped_ptr<FD_form_tabular> dialog_;
78         ///
79         boost::scoped_ptr<FD_form_tabular_options> tabular_options_;
80         ///
81         boost::scoped_ptr<FD_form_column_options> column_options_;
82         ///
83         boost::scoped_ptr<FD_form_cell_options> cell_options_;
84         ///
85         boost::scoped_ptr<FD_form_longtable_options> longtable_options_;
86
87         /// pointer to the inset passed through showInset
88         InsetTabular * inset_;
89         ///
90         int actCell_;
91         /// The ButtonController
92         ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
93         /// if we are applying stuff during a close of the dialog
94         bool closing_;
95 };
96
97
98 inline
99 xformsBC & FormTabular::bc()
100 {
101         return bc_;
102 }
103 #endif