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
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
38 class FormDocument : public FormBase {
40 /// #FormDocument x(Communicator ..., Popups ...);#
41 FormDocument(LyXView *, Dialogs *);
44 /// this operates very differently to FormBase::InputCB
45 static void InputCB(FL_OBJECT *, long);
47 static void ComboInputCB(int, void *, Combox *);
49 static void ChoiceClassCB(FL_OBJECT *, long);
51 static void ChoiceBulletSizeCB(FL_OBJECT * ob, long);
53 static void InputBulletLaTeXCB(FL_OBJECT * ob, long);
55 static void BulletDepthCB(FL_OBJECT * ob, long);
57 static void BulletPanelCB(FL_OBJECT * ob, long);
59 static void BulletBMTableCB(FL_OBJECT * ob, long);
63 bool CheckDocumentInput(FL_OBJECT * ob, long);
65 void ChoiceBulletSize(FL_OBJECT * ob, long);
67 void InputBulletLaTeX(FL_OBJECT * ob, long);
69 void BulletDepth(FL_OBJECT * ob, long);
71 void BulletPanel(FL_OBJECT * ob, long);
73 void BulletBMTable(FL_OBJECT * ob, long);
75 void checkMarginValues();
79 void CheckChoiceClass(FL_OBJECT * ob, long);
81 void UpdateLayoutDocument(BufferParams const & params);
84 virtual void update();
86 void paper_update(BufferParams const &);
88 void class_update(BufferParams const &);
90 void language_update(BufferParams const &);
92 void options_update(BufferParams const &);
94 void bullets_update(BufferParams const &);
102 bool language_apply();
104 bool options_apply();
106 void bullets_apply();
107 /// Cancel from popup
108 virtual void cancel();
110 virtual void restore() {
114 virtual void build();
116 virtual FL_FORM * const form() const;
118 /// Typedefinitions from the fdesign produced Header file
119 FD_form_tabbed_document * build_tabbed_document();
121 FD_form_doc_paper * build_doc_paper();
123 FD_form_doc_class * build_doc_class();
125 FD_form_doc_language * build_doc_language();
127 FD_form_doc_options * build_doc_options();
129 FD_form_doc_bullet * build_doc_bullet();
131 /// Real GUI implementation.
132 FD_form_tabbed_document * dialog_;
134 FD_form_doc_paper * paper_;
136 FD_form_doc_class * class_;
138 FD_form_doc_language * language_;
140 FD_form_doc_options * options_;
142 FD_form_doc_bullet * bullets_;
148 int current_bullet_panel;
150 int current_bullet_depth;
154 Combox * combo_language;
156 Combox * combo_doc_class;