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 /**@name Constructors and Destructors */
39 /// #FormDocument x(Communicator ..., Popups ...);#
40 FormDocument(LyXView *, Dialogs *);
43 void SetDocumentClassChoice(vector<string> const & choices);
46 /**@name Real per-instance Callback Methods */
48 static int WMHideCB(FL_FORM *, void *);
49 static void OKCB(FL_OBJECT *, long);
50 static void CancelCB(FL_OBJECT *, long);
51 static void ApplyCB(FL_OBJECT *, long);
52 static void InputCB(FL_OBJECT *, long);
55 enum EnumPopupStatus {
62 void DeactivateDocumentButtons();
63 void ActivateDocumentButtons();
64 void EnableDocumentLayout();
65 void DisableDocumentLayout();
66 void CheckDocumentInput(FL_OBJECT * ob, long);
67 void ChoiceBulletSize(FL_OBJECT * ob, long);
68 void InputBulletLaTeX(FL_OBJECT * ob, long);
69 void BulletDepth(FL_OBJECT * ob, long);
70 void BulletPanel(FL_OBJECT * ob, long);
71 void BulletBMTable(FL_OBJECT * ob, long);
72 void checkMarginValues();
74 /**@name Real per-instance Callback Methods */
76 static void DocumentInputCB(FL_OBJECT * ob, long);
77 static void ChoiceBulletSizeCB(FL_OBJECT * ob, long);
78 static void InputBulletLaTeXCB(FL_OBJECT * ob, long);
79 static void BulletDepthCB(FL_OBJECT * ob, long);
80 static void BulletPanelCB(FL_OBJECT * ob, long);
81 static void BulletBMTableCB(FL_OBJECT * ob, long);
84 /**@name Slot Methods */
86 /// Create the popup if necessary, update it and display it.
94 void language_update();
95 void options_update();
96 void bullets_update();
101 bool language_apply();
102 bool options_apply();
103 void bullets_apply();
104 /// Cancel from popup
110 /// Explicitly free the popup.
113 /// Typedefinitions from the fdesign produced Header file
114 FD_form_tabbed_document * build_tabbed_document();
115 FD_form_doc_paper * build_doc_paper();
116 FD_form_doc_class * build_doc_class();
117 FD_form_doc_language * build_doc_language();
118 FD_form_doc_options * build_doc_options();
119 FD_form_doc_bullet * build_doc_bullet();
121 /**@name Private Data */
123 /// Real GUI implementation.
124 FD_form_tabbed_document * dialog_;
125 FD_form_doc_paper * paper_;
126 FD_form_doc_class * class_;
127 FD_form_doc_language * language_;
128 FD_form_doc_options * options_;
129 FD_form_doc_bullet * bullets_;
130 /// Which LyXView do we belong to?
133 /// Update connection.
137 /// has form contents changed? Used to control OK/Apply
138 EnumPopupStatus status;
142 current_bullet_panel, current_bullet_depth;
146 Combox * combo_language;