4 * Copyright 2000-2002 the LyX Team
5 * Read the file COPYING
7 * \author Jürgen Vigna, jug@sad.it
10 #ifndef FORM_DOCUMENT_H
11 #define FORM_DOCUMENT_H
17 #include "FormBaseDeprecated.h"
19 #include <boost/scoped_ptr.hpp>
26 struct FD_form_tabbed_document;
27 struct FD_form_doc_paper;
28 struct FD_form_doc_class;
29 struct FD_form_doc_language;
30 struct FD_form_doc_options;
31 struct FD_form_doc_bullet;
33 /** This class provides an XForms implementation of the FormDocument dialog.
34 The table-layout-form here changes values for latex-tabulars
36 class FormDocument : public FormBaseBD {
38 FormDocument(LyXView *, Dialogs *);
40 static void ComboInputCB(int, void *, Combox *);
75 /// Pointer to the actual instantiation of the ButtonController.
76 virtual xformsBC & bc();
77 /** Redraw the form (on receipt of a Signal indicating, for example,
78 that the xforms colours have been re-mapped). */
79 virtual void redraw();
83 virtual bool input( FL_OBJECT *, long);
84 /// Update the dialog.
85 virtual void update();
88 /// Cancel from dialog
89 virtual void cancel();
92 virtual FL_FORM * form() const;
95 bool CheckDocumentInput(FL_OBJECT * ob, long);
97 void ChoiceBulletSize(FL_OBJECT * ob, long);
99 void InputBulletLaTeX(FL_OBJECT * ob, long);
101 void BulletDepth(FL_OBJECT * ob, State);
103 void BulletPanel(FL_OBJECT * ob, State);
105 void BulletBMTable(FL_OBJECT * ob, long);
107 void checkReadOnly();
109 void CheckChoiceClass(FL_OBJECT * ob, long);
111 void UpdateLayoutDocument(BufferParams const & params);
113 void UpdateClassParams(BufferParams const & params);
116 void paper_update(BufferParams const &);
118 void class_update(BufferParams const &);
120 void language_update(BufferParams const &);
122 void options_update(BufferParams const &);
124 void bullets_update(BufferParams const &);
127 void paper_apply(BufferParams &);
129 bool class_apply(BufferParams &);
131 bool language_apply(BufferParams &);
133 bool options_apply(BufferParams &);
135 void bullets_apply(BufferParams &);
142 bool language_apply();
144 bool options_apply();
146 void bullets_apply();
148 /// Fdesign generated methods
149 FD_form_tabbed_document * build_tabbed_document();
151 FD_form_doc_paper * build_doc_paper();
153 FD_form_doc_class * build_doc_class();
155 FD_form_doc_language * build_doc_language();
157 FD_form_doc_options * build_doc_options();
159 FD_form_doc_bullet * build_doc_bullet();
161 /// Real GUI implementation.
162 boost::scoped_ptr<FD_form_tabbed_document> dialog_;
164 boost::scoped_ptr<FD_form_doc_paper> paper_;
166 boost::scoped_ptr<FD_form_doc_class> class_;
168 boost::scoped_ptr<FD_form_doc_language> language_;
170 boost::scoped_ptr<FD_form_doc_options> options_;
172 boost::scoped_ptr<FD_form_doc_bullet> bullets_;
178 int current_bullet_panel;
180 int current_bullet_depth;
184 boost::scoped_ptr<Combox> combo_language;
186 boost::scoped_ptr<Combox> combo_doc_class;
187 /// The ButtonController
188 ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_;
190 std::vector<string> lang_;
195 xformsBC & FormDocument::bc()