]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormDocument.h
ae5d51bd008c34d144c1cf09ba6d33669949262a
[lyx.git] / src / frontends / xforms / FormDocument.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  * 
5  *           LyX, The Document Processor
6  *       
7  *           Copyright (C) 2000 The LyX Team.
8  *
9  *           @author Jürgen Vigna
10  *
11  *======================================================*/
12
13 #ifndef FORM_DOCUMENT_H
14 #define FORM_DOCUMENT_H
15
16 #include "FormBase.h"
17 #include <vector>
18
19 #ifdef __GNUG_
20 #pragma interface
21 #endif
22
23 class LyXView;
24 class Dialogs;
25 class Combox;
26 class BufferParams;
27
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;
34
35 /** This class provides an XForms implementation of the FormDocument Popup.
36     The table-layout-form here changes values for latex-tabulars
37  */
38 class FormDocument : public FormBase {
39 public:
40         /// #FormDocument x(Communicator ..., Popups ...);#
41         FormDocument(LyXView *, Dialogs *);
42         ///
43         ~FormDocument();
44         ///
45         static void ComboInputCB(int, void *, Combox *);
46
47 private:
48         ///
49         enum State {
50                 ///
51                 INPUT,
52                 ///
53                 CHECKCHOICECLASS,
54                 ///
55                 CHOICEBULLETSIZE,
56                 ///
57                 INPUTBULLETLATEX,
58                 ///
59                 BULLETDEPTH1,
60                 ///
61                 BULLETDEPTH2,
62                 ///
63                 BULLETDEPTH3,
64                 ///
65                 BULLETDEPTH4,
66                 ///
67                 BULLETPANEL1,
68                 ///
69                 BULLETPANEL2,
70                 ///
71                 BULLETPANEL3,
72                 ///
73                 BULLETPANEL4,
74                 ///
75                 BULLETPANEL5,
76                 ///
77                 BULLETPANEL6,
78                 ///
79                 BULLETBMTABLE
80         };
81         /// Build the dialog
82         virtual void build();
83         /// Filter the inputs
84         virtual bool input( FL_OBJECT *, long );
85         /// Update the popup.
86         virtual void update();
87         /// Apply from popup
88         virtual void apply();
89         /// Cancel from popup
90         virtual void cancel();
91         ///
92         virtual void restore() {
93                 update();
94         }
95
96         ///
97         virtual FL_FORM * form() const;
98
99         ///
100         bool CheckDocumentInput(FL_OBJECT * ob, long);
101         ///
102         void ChoiceBulletSize(FL_OBJECT * ob, long);
103         ///
104         void InputBulletLaTeX(FL_OBJECT * ob, long);
105         ///
106         void BulletDepth(FL_OBJECT * ob, State);
107         ///
108         void BulletPanel(FL_OBJECT * ob, State);
109         ///
110         void BulletBMTable(FL_OBJECT * ob, long);
111         ///
112         void checkMarginValues();
113         ///
114         void checkReadOnly();
115         ///
116         void CheckChoiceClass(FL_OBJECT * ob, long);
117         ///
118         void UpdateLayoutDocument(BufferParams const & params);
119
120         ///
121         void paper_update(BufferParams const &);
122         ///
123         void class_update(BufferParams const &);
124         ///
125         void language_update(BufferParams const &);
126         ///
127         void options_update(BufferParams const &);
128         ///
129         void bullets_update(BufferParams const &);
130
131         ///
132         void paper_apply();
133         ///
134         bool class_apply();
135         ///
136         bool language_apply();
137         ///
138         bool options_apply();
139         ///
140         void bullets_apply();
141
142         /// Typedefinitions from the fdesign produced Header file
143         FD_form_tabbed_document * build_tabbed_document();
144         ///
145         FD_form_doc_paper * build_doc_paper();
146         ///
147         FD_form_doc_class * build_doc_class();
148         ///
149         FD_form_doc_language * build_doc_language();
150         ///
151         FD_form_doc_options * build_doc_options();
152         ///
153         FD_form_doc_bullet * build_doc_bullet();
154
155         /// Real GUI implementation.
156         FD_form_tabbed_document * dialog_;
157         ///
158         FD_form_doc_paper       * paper_;
159         ///
160         FD_form_doc_class       * class_;
161         ///
162         FD_form_doc_language    * language_;
163         ///
164         FD_form_doc_options     * options_;
165         ///
166         FD_form_doc_bullet      * bullets_;
167         ///
168         int ActCell;
169         ///
170         int Confirmed;
171         ///
172         int current_bullet_panel;
173         ///
174         int current_bullet_depth;
175         ///
176         FL_OBJECT * fbullet;
177         ///
178         Combox * combo_language;
179         ///
180         Combox * combo_doc_class;
181 };
182
183 #endif