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 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 checkMarginValues();
112 void checkReadOnly();
114 void CheckChoiceClass(FL_OBJECT * ob, long);
116 void UpdateLayoutDocument(BufferParams const & params);
119 void paper_update(BufferParams const &);
121 void class_update(BufferParams const &);
123 void language_update(BufferParams const &);
125 void options_update(BufferParams const &);
127 void bullets_update(BufferParams const &);
134 bool language_apply();
136 bool options_apply();
138 void bullets_apply();
140 /// Fdesign generated methods
141 FD_form_tabbed_document * build_tabbed_document();
143 FD_form_doc_paper * build_doc_paper();
145 FD_form_doc_class * build_doc_class();
147 FD_form_doc_language * build_doc_language();
149 FD_form_doc_options * build_doc_options();
151 FD_form_doc_bullet * build_doc_bullet();
153 /// Real GUI implementation.
154 boost::scoped_ptr<FD_form_tabbed_document> dialog_;
156 boost::scoped_ptr<FD_form_doc_paper> paper_;
158 boost::scoped_ptr<FD_form_doc_class> class_;
160 boost::scoped_ptr<FD_form_doc_language> language_;
162 boost::scoped_ptr<FD_form_doc_options> options_;
164 boost::scoped_ptr<FD_form_doc_bullet> bullets_;
170 int current_bullet_panel;
172 int current_bullet_depth;
176 boost::scoped_ptr<Combox> combo_language;
178 boost::scoped_ptr<Combox> combo_doc_class;
179 /// The ButtonController
180 ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_;
185 xformsBC & FormDocument::bc()