]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormTabular.h
Small fix from Angus
[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 "DialogBase.h"
19 #include <boost/utility.hpp>
20
21 #ifdef SIGC_CXX_NAMESPACES
22 using SigC::Connection;
23 #endif
24
25 class LyXView;
26 class Dialogs;
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 struct FD_form_create_tabular;
34
35 /** This class provides an XForms implementation of the FormTabular Dialog.
36     The tabular dialog allows users to set/save their tabular.
37  */
38 class FormTabular : public DialogBase, public noncopyable {
39 public:
40     /// #FormTabular x(LyXFunc ..., Dialogs ...);#
41     FormTabular(LyXView *, Dialogs *);
42     ///
43     ~FormTabular();
44     ///
45     static  int WMHideCB(FL_FORM *, void *);
46     ///
47     static void CloseCB(FL_OBJECT *, long);
48     ///
49     static void OKCB(FL_OBJECT *, long);
50     ///
51     static void CancelCB(FL_OBJECT *, long);
52     ///
53     static void ApplyCB(FL_OBJECT *, long);
54     ///
55     static void InputCB(FL_OBJECT *, long);
56
57 private:
58     /// Create the dialog if necessary, update it and display it.
59     void show();
60     ///
61     void show_create();
62     ///
63     void showInset(InsetTabular *);
64     /// Hide the dialog.
65     void hide();
66     ///
67     void hide_create();
68     ///
69     void hideInset(InsetTabular *);
70     /// Update the dialog.
71     void update(bool = false);
72     ///
73     void updateInset(InsetTabular *);
74     ///
75     bool local_update(bool);
76     
77     /// Apply from dialog
78     void apply_create();
79     /// Build the dialog
80     void build();
81     ///
82     void SetTabularOptions(FL_OBJECT *, long);
83     ///
84     FD_form_tabular * build_tabular();
85     ///
86     FD_form_tabular_options * build_tabular_options();
87     ///
88     FD_form_column_options * build_column_options();
89     ///
90     FD_form_cell_options * build_cell_options();
91     ///
92     FD_form_longtable_options * build_longtable_options();
93     ///
94     FD_form_create_tabular * build_create_tabular();
95
96     /// Real GUI implementation.
97     FD_form_tabular * dialog_;
98     ///
99     FD_form_tabular_options * tabular_options_;
100     ///
101     FD_form_column_options * column_options_;
102     ///
103     FD_form_cell_options * cell_options_;
104     ///
105     FD_form_longtable_options * longtable_options_;
106     ///
107     FD_form_create_tabular * create_tabular_;
108
109     /// Which LyXView do we belong to?
110     LyXView * lv_;
111     ///
112     Dialogs * d_;
113     /// Update connection.
114     Connection u_;
115     /// Hide connection.
116     Connection h_;
117     ///
118     InsetTabular * inset_;
119     ///
120     int actCell_;
121 };
122
123 #endif