3 * FormDocument Interface Class
6 #ifndef FORM_DOCUMENT_H
7 #define FORM_DOCUMENT_H
9 #include "DialogBase.h"
10 #include "support/utility.hpp"
21 struct FD_form_tabbed_document;
22 struct FD_form_doc_paper;
23 struct FD_form_doc_class;
24 struct FD_form_doc_language;
25 struct FD_form_doc_options;
26 struct FD_form_doc_bullet;
28 #ifdef SIGC_CXX_NAMESPACES
29 using SigC::Connection;
32 /** This class provides an XForms implementation of the FormDocument Popup.
33 The table-layout-form here changes values for latex-tabulars
35 class FormDocument : public DialogBase, public noncopyable {
37 /// #FormDocument x(Communicator ..., Popups ...);#
38 FormDocument(LyXView *, Dialogs *);
42 void SetDocumentClassChoice(vector<string> const & choices);
44 static int WMHideCB(FL_FORM *, void *);
46 static void OKCB(FL_OBJECT *, long);
48 static void CancelCB(FL_OBJECT *, long);
50 static void ApplyCB(FL_OBJECT *, long);
52 static void InputCB(FL_OBJECT *, long);
54 enum EnumPopupStatus {
65 void DeactivateDocumentButtons();
67 void ActivateDocumentButtons();
69 void EnableDocumentLayout();
71 void DisableDocumentLayout();
73 void CheckDocumentInput(FL_OBJECT * ob, long);
75 void ChoiceBulletSize(FL_OBJECT * ob, long);
77 void InputBulletLaTeX(FL_OBJECT * ob, long);
79 void BulletDepth(FL_OBJECT * ob, long);
81 void BulletPanel(FL_OBJECT * ob, long);
83 void BulletBMTable(FL_OBJECT * ob, long);
85 void checkMarginValues();
87 static void DocumentInputCB(FL_OBJECT * ob, long);
89 static void ChoiceBulletSizeCB(FL_OBJECT * ob, long);
91 static void InputBulletLaTeXCB(FL_OBJECT * ob, long);
93 static void BulletDepthCB(FL_OBJECT * ob, long);
95 static void BulletPanelCB(FL_OBJECT * ob, long);
97 static void BulletBMTableCB(FL_OBJECT * ob, long);
99 /// Create the popup if necessary, update it and display it.
103 /// Update the popup.
110 void language_update();
112 void options_update();
114 void bullets_update();
122 bool language_apply();
124 bool options_apply();
126 void bullets_apply();
127 /// Cancel from popup
131 /// Explicitly free the popup.
134 /// Typedefinitions from the fdesign produced Header file
135 FD_form_tabbed_document * build_tabbed_document();
137 FD_form_doc_paper * build_doc_paper();
139 FD_form_doc_class * build_doc_class();
141 FD_form_doc_language * build_doc_language();
143 FD_form_doc_options * build_doc_options();
145 FD_form_doc_bullet * build_doc_bullet();
147 /// Real GUI implementation.
148 FD_form_tabbed_document * dialog_;
150 FD_form_doc_paper * paper_;
152 FD_form_doc_class * class_;
154 FD_form_doc_language * language_;
156 FD_form_doc_options * options_;
158 FD_form_doc_bullet * bullets_;
159 /// Which LyXView do we belong to?
163 /// Update connection.
167 /// has form contents changed? Used to control OK/Apply
168 EnumPopupStatus status;
174 int current_bullet_panel;
176 int current_bullet_depth;
180 Combox * combo_language;