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
14 #include <boost/smart_ptr.hpp>
20 #include "FormBaseDeprecated.h"
25 struct FD_form_tabbed_document;
26 struct FD_form_doc_paper;
27 struct FD_form_doc_class;
28 struct FD_form_doc_language;
29 struct FD_form_doc_options;
30 struct FD_form_doc_bullet;
32 /** This class provides an XForms implementation of the FormDocument dialog.
33 The table-layout-form here changes values for latex-tabulars
35 class FormDocument : public FormBaseBD {
37 FormDocument(LyXView *, Dialogs *);
39 static void ComboInputCB(int, void *, Combox *);
74 /// Pointer to the actual instantiation of the ButtonController.
75 virtual xformsBC & bc();
76 /** Redraw the form (on receipt of a Signal indicating, for example,
77 that the xforms colours have been re-mapped). */
78 virtual void redraw();
82 virtual bool input( FL_OBJECT *, long);
83 /// Update the dialog.
84 virtual void update();
87 /// Cancel from dialog
88 virtual void cancel();
91 virtual FL_FORM * form() const;
94 bool CheckDocumentInput(FL_OBJECT * ob, long);
96 void ChoiceBulletSize(FL_OBJECT * ob, long);
98 void InputBulletLaTeX(FL_OBJECT * ob, long);
100 void BulletDepth(FL_OBJECT * ob, State);
102 void BulletPanel(FL_OBJECT * ob, State);
104 void BulletBMTable(FL_OBJECT * ob, long);
106 void checkReadOnly();
108 void CheckChoiceClass(FL_OBJECT * ob, long);
110 void UpdateLayoutDocument(BufferParams const & params);
112 void UpdateClassParams(BufferParams const & params);
115 void paper_update(BufferParams const &);
117 void class_update(BufferParams const &);
119 void language_update(BufferParams const &);
121 void options_update(BufferParams const &);
123 void bullets_update(BufferParams const &);
126 void paper_apply(BufferParams &);
128 bool class_apply(BufferParams &);
130 bool language_apply(BufferParams &);
132 bool options_apply(BufferParams &);
134 void bullets_apply(BufferParams &);
141 bool language_apply();
143 bool options_apply();
145 void bullets_apply();
147 /// Fdesign generated methods
148 FD_form_tabbed_document * build_tabbed_document();
150 FD_form_doc_paper * build_doc_paper();
152 FD_form_doc_class * build_doc_class();
154 FD_form_doc_language * build_doc_language();
156 FD_form_doc_options * build_doc_options();
158 FD_form_doc_bullet * build_doc_bullet();
160 /// Real GUI implementation.
161 boost::scoped_ptr<FD_form_tabbed_document> dialog_;
163 boost::scoped_ptr<FD_form_doc_paper> paper_;
165 boost::scoped_ptr<FD_form_doc_class> class_;
167 boost::scoped_ptr<FD_form_doc_language> language_;
169 boost::scoped_ptr<FD_form_doc_options> options_;
171 boost::scoped_ptr<FD_form_doc_bullet> bullets_;
177 int current_bullet_panel;
179 int current_bullet_depth;
183 boost::scoped_ptr<Combox> combo_language;
185 boost::scoped_ptr<Combox> combo_doc_class;
186 /// The ButtonController
187 ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_;
192 xformsBC & FormDocument::bc()