]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormDocument.h
8669b022777b4ccdda706b19eacac02c13078eef
[lyx.git] / src / frontends / xforms / FormDocument.h
1 // -*- C++ -*-
2 /* form_document.h
3  * FormDocument Interface Class
4  */
5
6 #ifndef FORM_DOCUMENT_H
7 #define FORM_DOCUMENT_H
8
9 #include "DialogBase.h"
10 #include "support/utility.hpp"
11 #include <vector>
12
13 #ifdef __GNUG_
14 #pragma interface
15 #endif
16
17 class LyXView;
18 class Dialogs;
19 class Combox;
20
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;
27
28 #ifdef SIGC_CXX_NAMESPACES
29 using SigC::Connection;
30 #endif
31
32 /** This class provides an XForms implementation of the FormDocument Popup.
33     The table-layout-form here changes values for latex-tabulars
34  */
35 class FormDocument : public DialogBase, public noncopyable {
36 public:
37     /// #FormDocument x(Communicator ..., Popups ...);#
38     FormDocument(LyXView *, Dialogs *);
39     ///
40     ~FormDocument();
41     ///
42     void SetDocumentClassChoice(vector<string> const & choices);
43     ///
44     static  int WMHideCB(FL_FORM *, void *);
45     ///
46     static void OKCB(FL_OBJECT *, long);
47     ///
48     static void CancelCB(FL_OBJECT *, long);
49     ///
50     static void ApplyCB(FL_OBJECT *, long);
51     ///
52     static void InputCB(FL_OBJECT *, long);
53     ///
54     enum EnumPopupStatus {
55         ///
56         POPUP_UNMODIFIED,
57         ///
58         POPUP_MODIFIED,
59         ///
60         POPUP_READONLY
61     };
62
63 private:
64     ///
65     void DeactivateDocumentButtons();
66     ///
67     void ActivateDocumentButtons();
68     ///
69     void EnableDocumentLayout();
70     ///
71     void DisableDocumentLayout();
72     ///
73     void CheckDocumentInput(FL_OBJECT * ob, long);
74     ///
75     void ChoiceBulletSize(FL_OBJECT * ob, long);
76     ///
77     void InputBulletLaTeX(FL_OBJECT * ob, long);
78     ///
79     void BulletDepth(FL_OBJECT * ob, long);
80     ///
81     void BulletPanel(FL_OBJECT * ob, long);
82     ///
83     void BulletBMTable(FL_OBJECT * ob, long);
84     ///
85     void checkMarginValues();
86     ///
87     static void DocumentInputCB(FL_OBJECT * ob, long);
88     ///
89     static void ChoiceBulletSizeCB(FL_OBJECT * ob, long);
90     ///
91     static void InputBulletLaTeXCB(FL_OBJECT * ob, long);
92     ///
93     static void BulletDepthCB(FL_OBJECT * ob, long);
94     ///
95     static void BulletPanelCB(FL_OBJECT * ob, long);
96     ///
97     static void BulletBMTableCB(FL_OBJECT * ob, long);
98
99     /// Create the popup if necessary, update it and display it.
100     void show();
101     /// Hide the popup.
102     void hide();
103     /// Update the popup.
104     void update();
105     ///
106     void paper_update();
107     ///
108     void class_update();
109     ///
110     void language_update();
111     ///
112     void options_update();
113     ///
114     void bullets_update();
115     /// Apply from popup
116     void apply();
117     ///
118     void paper_apply();
119     ///
120     bool class_apply();
121     ///
122     bool language_apply();
123     ///
124     bool options_apply();
125     ///
126     void bullets_apply();
127     /// Cancel from popup
128     void cancel();
129     /// Build the popup
130     void build();
131     /// Explicitly free the popup.
132     void free();
133
134     /// Typedefinitions from the fdesign produced Header file
135     FD_form_tabbed_document * build_tabbed_document();
136     ///
137     FD_form_doc_paper * build_doc_paper();
138     ///
139     FD_form_doc_class * build_doc_class();
140     ///
141     FD_form_doc_language * build_doc_language();
142     ///
143     FD_form_doc_options * build_doc_options();
144     ///
145     FD_form_doc_bullet * build_doc_bullet();
146
147     /// Real GUI implementation.
148     FD_form_tabbed_document * dialog_;
149     ///
150     FD_form_doc_paper       * paper_;
151     ///
152     FD_form_doc_class       * class_;
153     ///
154     FD_form_doc_language    * language_;
155     ///
156     FD_form_doc_options     * options_;
157     ///
158     FD_form_doc_bullet      * bullets_;
159     /// Which LyXView do we belong to?
160     LyXView * lv_;
161     ///
162     Dialogs * d_;
163     /// Update connection.
164     Connection u_;
165     /// Hide connection.
166     Connection h_;
167     /// has form contents changed? Used to control OK/Apply
168     EnumPopupStatus status;
169     ///
170     int ActCell;
171     ///
172     int Confirmed;
173     ///
174     int current_bullet_panel;
175     ///
176     int current_bullet_depth;
177     ///
178     FL_OBJECT * fbullet;
179     ///
180     Combox * combo_language;
181 };
182
183 #endif