2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright (C) 2000 The LyX Team.
11 *======================================================*/
13 #ifndef FORM_DOCUMENT_H
14 #define FORM_DOCUMENT_H
17 #include <boost/smart_ptr.hpp>
18 #include "FormBaseDeprecated.h"
30 struct FD_form_tabbed_document;
31 struct FD_form_doc_paper;
32 struct FD_form_doc_class;
33 struct FD_form_doc_language;
34 struct FD_form_doc_options;
35 struct FD_form_doc_bullet;
37 /** This class provides an XForms implementation of the FormDocument Popup.
38 The table-layout-form here changes values for latex-tabulars
41 class FormDocument : public FormBaseBD {
43 /// #FormDocument x(Communicator ..., Popups ...);#
44 FormDocument(LyXView *, Dialogs *);
46 static void ComboInputCB(int, void *, Combox *);
81 /// Pointer to the actual instantiation of the ButtonController.
82 virtual xformsBC & bc();
83 /** Redraw the form (on receipt of a Signal indicating, for example,
84 that the xforms colours have been re-mapped). */
85 virtual void redraw();
89 virtual bool input( FL_OBJECT *, long );
91 virtual void update();
95 virtual void cancel();
98 virtual FL_FORM * form() const;
101 bool CheckDocumentInput(FL_OBJECT * ob, long);
103 void ChoiceBulletSize(FL_OBJECT * ob, long);
105 void InputBulletLaTeX(FL_OBJECT * ob, long);
107 void BulletDepth(FL_OBJECT * ob, State);
109 void BulletPanel(FL_OBJECT * ob, State);
111 void BulletBMTable(FL_OBJECT * ob, long);
113 void checkMarginValues();
115 void checkReadOnly();
117 void CheckChoiceClass(FL_OBJECT * ob, long);
119 void UpdateLayoutDocument(BufferParams const & params);
122 void paper_update(BufferParams const &);
124 void class_update(BufferParams const &);
126 void language_update(BufferParams const &);
128 void options_update(BufferParams const &);
130 void bullets_update(BufferParams const &);
137 bool language_apply();
139 bool options_apply();
141 void bullets_apply();
143 /// Typedefinitions from the fdesign produced Header file
144 FD_form_tabbed_document * build_tabbed_document();
146 FD_form_doc_paper * build_doc_paper();
148 FD_form_doc_class * build_doc_class();
150 FD_form_doc_language * build_doc_language();
152 FD_form_doc_options * build_doc_options();
154 FD_form_doc_bullet * build_doc_bullet();
156 /// Real GUI implementation.
157 boost::scoped_ptr<FD_form_tabbed_document> dialog_;
159 boost::scoped_ptr<FD_form_doc_paper> paper_;
161 boost::scoped_ptr<FD_form_doc_class> class_;
163 boost::scoped_ptr<FD_form_doc_language> language_;
165 boost::scoped_ptr<FD_form_doc_options> options_;
167 boost::scoped_ptr<FD_form_doc_bullet> bullets_;
173 int current_bullet_panel;
175 int current_bullet_depth;
179 boost::scoped_ptr<Combox> combo_language;
181 boost::scoped_ptr<Combox> combo_doc_class;
182 /// The ButtonController
183 ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_;
188 xformsBC & FormDocument::bc()