2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2001 The LyX Team.
10 *======================================================*/
12 * FormTabular Interface Class
18 #include <boost/smart_ptr.hpp>
24 #include "FormInset.h"
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;
33 /** This class provides an XForms implementation of the FormTabular Dialog.
34 The tabular dialog allows users to set/save their tabular.
36 class FormTabular : public FormInset {
38 /// #FormTabular x(LyXFunc ..., Dialogs ...);#
39 FormTabular(LyXView *, Dialogs *);
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();
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();
59 virtual bool input(FL_OBJECT *, long);
60 /// Pointer to the actual instantiation of the xforms form
61 virtual FL_FORM * form() const;
63 virtual int checkLongtableOptions(FL_OBJECT *, string &);
65 /// Fdesign generated methods
66 FD_form_tabular * build_tabular();
68 FD_form_tabular_options * build_tabular_options();
70 FD_form_column_options * build_column_options();
72 FD_form_cell_options * build_cell_options();
74 FD_form_longtable_options * build_longtable_options();
76 /// Real GUI implementation.
77 boost::scoped_ptr<FD_form_tabular> dialog_;
79 boost::scoped_ptr<FD_form_tabular_options> tabular_options_;
81 boost::scoped_ptr<FD_form_column_options> column_options_;
83 boost::scoped_ptr<FD_form_cell_options> cell_options_;
85 boost::scoped_ptr<FD_form_longtable_options> longtable_options_;
87 /// pointer to the inset passed through showInset
88 InsetTabular * inset_;
91 /// The ButtonController
92 ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
93 /// if we are applying stuff during a close of the dialog
99 xformsBC & FormTabular::bc()