2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2000-2001 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 dialog.
36 The table-layout-form here changes values for latex-tabulars
39 class FormDocument : public FormBaseBD {
41 FormDocument(LyXView *, Dialogs *);
43 static void ComboInputCB(int, void *, Combox *);
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();
86 virtual bool input( FL_OBJECT *, long );
87 /// Update the dialog.
88 virtual void update();
91 /// Cancel from dialog
92 virtual void cancel();
95 virtual FL_FORM * form() const;
98 bool CheckDocumentInput(FL_OBJECT * ob, long);
100 void ChoiceBulletSize(FL_OBJECT * ob, long);
102 void InputBulletLaTeX(FL_OBJECT * ob, long);
104 void BulletDepth(FL_OBJECT * ob, State);
106 void BulletPanel(FL_OBJECT * ob, State);
108 void BulletBMTable(FL_OBJECT * ob, long);
110 void checkReadOnly();
112 void CheckChoiceClass(FL_OBJECT * ob, long);
114 void UpdateLayoutDocument(BufferParams const & params);
117 void paper_update(BufferParams const &);
119 void class_update(BufferParams const &);
121 void language_update(BufferParams const &);
123 void options_update(BufferParams const &);
125 void bullets_update(BufferParams const &);
132 bool language_apply();
134 bool options_apply();
136 void bullets_apply();
138 /// Fdesign generated methods
139 FD_form_tabbed_document * build_tabbed_document();
141 FD_form_doc_paper * build_doc_paper();
143 FD_form_doc_class * build_doc_class();
145 FD_form_doc_language * build_doc_language();
147 FD_form_doc_options * build_doc_options();
149 FD_form_doc_bullet * build_doc_bullet();
151 /// Real GUI implementation.
152 boost::scoped_ptr<FD_form_tabbed_document> dialog_;
154 boost::scoped_ptr<FD_form_doc_paper> paper_;
156 boost::scoped_ptr<FD_form_doc_class> class_;
158 boost::scoped_ptr<FD_form_doc_language> language_;
160 boost::scoped_ptr<FD_form_doc_options> options_;
162 boost::scoped_ptr<FD_form_doc_bullet> bullets_;
168 int current_bullet_panel;
170 int current_bullet_depth;
174 boost::scoped_ptr<Combox> combo_language;
176 boost::scoped_ptr<Combox> combo_doc_class;
177 /// The ButtonController
178 ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_;
183 xformsBC & FormDocument::bc()