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>
23 #include "FormBaseDeprecated.h"
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;
35 /** This class provides an XForms implementation of the FormDocument Popup.
36 The table-layout-form here changes values for latex-tabulars
39 class FormDocument : public FormBaseBD {
41 /// #FormDocument x(Communicator ..., Popups ...);#
42 FormDocument(LyXView *, Dialogs *);
44 static void ComboInputCB(int, void *, Combox *);
79 /// Pointer to the actual instantiation of the ButtonController.
80 virtual xformsBC & bc();
81 /** Redraw the form (on receipt of a Signal indicating, for example,
82 that the xforms colours have been re-mapped). */
83 virtual void redraw();
87 virtual bool input( FL_OBJECT *, long );
89 virtual void update();
93 virtual void cancel();
96 virtual FL_FORM * form() const;
99 bool CheckDocumentInput(FL_OBJECT * ob, long);
101 void ChoiceBulletSize(FL_OBJECT * ob, long);
103 void InputBulletLaTeX(FL_OBJECT * ob, long);
105 void BulletDepth(FL_OBJECT * ob, State);
107 void BulletPanel(FL_OBJECT * ob, State);
109 void BulletBMTable(FL_OBJECT * ob, long);
111 void checkMarginValues();
113 void checkReadOnly();
115 void CheckChoiceClass(FL_OBJECT * ob, long);
117 void UpdateLayoutDocument(BufferParams const & params);
120 void paper_update(BufferParams const &);
122 void class_update(BufferParams const &);
124 void language_update(BufferParams const &);
126 void options_update(BufferParams const &);
128 void bullets_update(BufferParams const &);
135 bool language_apply();
137 bool options_apply();
139 void bullets_apply();
141 /// Typedefinitions from the fdesign produced Header file
142 FD_form_tabbed_document * build_tabbed_document();
144 FD_form_doc_paper * build_doc_paper();
146 FD_form_doc_class * build_doc_class();
148 FD_form_doc_language * build_doc_language();
150 FD_form_doc_options * build_doc_options();
152 FD_form_doc_bullet * build_doc_bullet();
154 /// Real GUI implementation.
155 boost::scoped_ptr<FD_form_tabbed_document> dialog_;
157 boost::scoped_ptr<FD_form_doc_paper> paper_;
159 boost::scoped_ptr<FD_form_doc_class> class_;
161 boost::scoped_ptr<FD_form_doc_language> language_;
163 boost::scoped_ptr<FD_form_doc_options> options_;
165 boost::scoped_ptr<FD_form_doc_bullet> bullets_;
171 int current_bullet_panel;
173 int current_bullet_depth;
177 boost::scoped_ptr<Combox> combo_language;
179 boost::scoped_ptr<Combox> combo_doc_class;
180 /// The ButtonController
181 ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_;
186 xformsBC & FormDocument::bc()