]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormDocument.h
mathed compilation fix
[lyx.git] / src / frontends / xforms / FormDocument.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  * 
5  *           LyX, The Document Processor
6  *       
7  *           Copyright 2000-2001 The LyX Team.
8  *
9  *           @author Jürgen Vigna
10  *
11  *======================================================*/
12
13 #ifndef FORM_DOCUMENT_H
14 #define FORM_DOCUMENT_H
15
16 #include <vector>
17 #include <boost/smart_ptr.hpp>
18
19 #ifdef __GNUG_
20 #pragma interface
21 #endif
22
23 #include "FormBaseDeprecated.h"
24
25 class Combox;
26 class BufferParams;
27
28 struct FD_form_tabbed_document;
29 struct FD_form_doc_paper;
30 struct FD_form_doc_class;
31 struct FD_form_doc_language;
32 struct FD_form_doc_options;
33 struct FD_form_doc_bullet;
34
35 /** This class provides an XForms implementation of the FormDocument dialog.
36     The table-layout-form here changes values for latex-tabulars
37     @author Jürgen Vigna
38  */
39 class FormDocument : public FormBaseBD {
40 public:
41         FormDocument(LyXView *, Dialogs *);
42         ///
43         static void ComboInputCB(int, void *, Combox *);
44 private:
45         ///
46         enum State {
47                 ///
48                 INPUT,
49                 ///
50                 CHECKCHOICECLASS,
51                 ///
52                 CHOICEBULLETSIZE,
53                 ///
54                 INPUTBULLETLATEX,
55                 ///
56                 BULLETDEPTH1,
57                 ///
58                 BULLETDEPTH2,
59                 ///
60                 BULLETDEPTH3,
61                 ///
62                 BULLETDEPTH4,
63                 ///
64                 BULLETPANEL1,
65                 ///
66                 BULLETPANEL2,
67                 ///
68                 BULLETPANEL3,
69                 ///
70                 BULLETPANEL4,
71                 ///
72                 BULLETPANEL5,
73                 ///
74                 BULLETPANEL6,
75                 ///
76                 BULLETBMTABLE
77         };
78         /// Pointer to the actual instantiation of the ButtonController.
79         virtual xformsBC & bc();
80         /** Redraw the form (on receipt of a Signal indicating, for example,
81             that the xforms colours have been re-mapped). */
82         virtual void redraw();
83         /// Build the dialog
84         virtual void build();
85         /// Filter the inputs
86         virtual bool input( FL_OBJECT *, long );
87         /// Update the dialog.
88         virtual void update();
89         /// Apply from dialog
90         virtual void apply();
91         /// Cancel from dialog
92         virtual void cancel();
93
94         ///
95         virtual FL_FORM * form() const;
96
97         ///
98         bool CheckDocumentInput(FL_OBJECT * ob, long);
99         ///
100         void ChoiceBulletSize(FL_OBJECT * ob, long);
101         ///
102         void InputBulletLaTeX(FL_OBJECT * ob, long);
103         ///
104         void BulletDepth(FL_OBJECT * ob, State);
105         ///
106         void BulletPanel(FL_OBJECT * ob, State);
107         ///
108         void BulletBMTable(FL_OBJECT * ob, long);
109         ///
110         void checkReadOnly();
111         ///
112         void CheckChoiceClass(FL_OBJECT * ob, long);
113         ///
114         void UpdateLayoutDocument(BufferParams const & params);
115
116         ///
117         void paper_update(BufferParams const &);
118         ///
119         void class_update(BufferParams const &);
120         ///
121         void language_update(BufferParams const &);
122         ///
123         void options_update(BufferParams const &);
124         ///
125         void bullets_update(BufferParams const &);
126
127         ///
128         void paper_apply(BufferParams &);
129         ///
130         bool class_apply(BufferParams &);
131         ///
132         bool language_apply(BufferParams &);
133         ///
134         bool options_apply(BufferParams &);
135         ///
136         void bullets_apply(BufferParams &);
137
138         ///
139         void paper_apply();
140         ///
141         bool class_apply();
142         ///
143         bool language_apply();
144         ///
145         bool options_apply();
146         ///
147         void bullets_apply();
148
149         /// Fdesign generated methods
150         FD_form_tabbed_document * build_tabbed_document();
151         ///
152         FD_form_doc_paper * build_doc_paper();
153         ///
154         FD_form_doc_class * build_doc_class();
155         ///
156         FD_form_doc_language * build_doc_language();
157         ///
158         FD_form_doc_options * build_doc_options();
159         ///
160         FD_form_doc_bullet * build_doc_bullet();
161
162         /// Real GUI implementation.
163         boost::scoped_ptr<FD_form_tabbed_document> dialog_;
164         ///
165         boost::scoped_ptr<FD_form_doc_paper>       paper_;
166         ///
167         boost::scoped_ptr<FD_form_doc_class>       class_;
168         ///
169         boost::scoped_ptr<FD_form_doc_language>    language_;
170         ///
171         boost::scoped_ptr<FD_form_doc_options>     options_;
172         ///
173         boost::scoped_ptr<FD_form_doc_bullet>      bullets_;
174         ///
175         int ActCell;
176         ///
177         int Confirmed;
178         ///
179         int current_bullet_panel;
180         ///
181         int current_bullet_depth;
182         ///
183         FL_OBJECT * fbullet;
184         ///
185         boost::scoped_ptr<Combox> combo_language;
186         ///
187         boost::scoped_ptr<Combox> combo_doc_class;
188         /// The ButtonController
189         ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_;
190 };
191
192
193 inline
194 xformsBC & FormDocument::bc()
195 {
196         return bc_;
197 }
198
199 #endif