]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormTabular.h
Yet more dialog tweaking from Rob.
[lyx.git] / src / frontends / xforms / FormTabular.h
1 // -*- C++ -*-
2 /**
3  * \file FormTabular.h
4  * Copyright 1995 Matthias Ettrich
5  * This file is part of LyX, the document processor.
6  * Licence details can be found in the file COPYING.
7  *
8  * \author Jürgen Vigna
9  *
10  * Full author contact details are available in file CREDITS
11  */
12
13 #ifndef FORMTABULAR_H
14 #define FORMTABULAR_H
15
16 #include <boost/scoped_ptr.hpp>
17
18 #ifdef __GNUG__
19 #pragma interface
20 #endif
21
22 #include "FormInset.h"
23
24 class InsetTabular;
25 struct FD_tabular;
26 struct FD_tabular_options;
27 struct FD_tabular_column;
28 struct FD_tabular_cell;
29 struct FD_tabular_longtable;
30
31 /** This class provides an XForms implementation of the FormTabular Dialog.
32     The tabular dialog allows users to set/save their tabular.
33  */
34 class FormTabular : public FormInset {
35 public:
36         /// #FormTabular x(LyXFunc ..., Dialogs ...);#
37         FormTabular(LyXView &, Dialogs &);
38
39         /// Slot launching dialog to an existing inset
40         void showInset(InsetTabular *);
41         /// Slot launching dialog to an existing inset
42         void updateInset(InsetTabular *);
43
44 private:
45         /// Pointer to the actual instantiation of the ButtonController.
46         virtual xformsBC & bc();
47         /** Redraw the form (on receipt of a Signal indicating, for example,
48             that the xforms colours have been re-mapped). */
49         virtual void redraw();
50         /// Disconnect signals. Also perform any necessary housekeeping.
51         virtual void disconnect();
52
53         /// Update dialog before showing it
54         virtual void update();
55         /// Build the dialog
56         virtual void build();
57         /// Filter the inputs
58         virtual bool input(FL_OBJECT *, long);
59         /// Pointer to the actual instantiation of the xforms form
60         virtual FL_FORM * form() const;
61         ///
62         virtual int checkLongtableOptions(FL_OBJECT *, string &);
63
64         /// Real GUI implementation.
65         boost::scoped_ptr<FD_tabular> dialog_;
66         ///
67         boost::scoped_ptr<FD_tabular_options> tabular_options_;
68         ///
69         boost::scoped_ptr<FD_tabular_column> column_options_;
70         ///
71         boost::scoped_ptr<FD_tabular_cell> cell_options_;
72         ///
73         boost::scoped_ptr<FD_tabular_longtable> longtable_options_;
74
75         /// pointer to the inset passed through showInset
76         InsetTabular * inset_;
77         ///
78         int actCell_;
79         /// The ButtonController
80         ButtonController<OkCancelReadOnlyPolicy, xformsBC> bc_;
81         /// if we are applying stuff during a close of the dialog
82         bool closing_;
83 };
84
85
86 inline
87 xformsBC & FormTabular::bc()
88 {
89         return bc_;
90 }
91 #endif