]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormDocument.h
More pref work from Angus
[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     @author Jürgen Vigna
38  */
39 class FormDocument : public FormBaseBD {
40 public:
41         /// #FormDocument x(Communicator ..., Popups ...);#
42         FormDocument(LyXView *, Dialogs *);
43         ///
44         ~FormDocument();
45         ///
46         static void ComboInputCB(int, void *, Combox *);
47
48 private:
49         ///
50         enum State {
51                 ///
52                 INPUT,
53                 ///
54                 CHECKCHOICECLASS,
55                 ///
56                 CHOICEBULLETSIZE,
57                 ///
58                 INPUTBULLETLATEX,
59                 ///
60                 BULLETDEPTH1,
61                 ///
62                 BULLETDEPTH2,
63                 ///
64                 BULLETDEPTH3,
65                 ///
66                 BULLETDEPTH4,
67                 ///
68                 BULLETPANEL1,
69                 ///
70                 BULLETPANEL2,
71                 ///
72                 BULLETPANEL3,
73                 ///
74                 BULLETPANEL4,
75                 ///
76                 BULLETPANEL5,
77                 ///
78                 BULLETPANEL6,
79                 ///
80                 BULLETBMTABLE
81         };
82         /// Build the dialog
83         virtual void build();
84         /// Filter the inputs
85         virtual bool input( FL_OBJECT *, long );
86         /// Update the popup.
87         virtual void update();
88         /// Apply from popup
89         virtual void apply();
90         /// Cancel from popup
91         virtual void cancel();
92
93         ///
94         virtual FL_FORM * form() const;
95
96         ///
97         bool CheckDocumentInput(FL_OBJECT * ob, long);
98         ///
99         void ChoiceBulletSize(FL_OBJECT * ob, long);
100         ///
101         void InputBulletLaTeX(FL_OBJECT * ob, long);
102         ///
103         void BulletDepth(FL_OBJECT * ob, State);
104         ///
105         void BulletPanel(FL_OBJECT * ob, State);
106         ///
107         void BulletBMTable(FL_OBJECT * ob, long);
108         ///
109         void checkMarginValues();
110         ///
111         void checkReadOnly();
112         ///
113         void CheckChoiceClass(FL_OBJECT * ob, long);
114         ///
115         void UpdateLayoutDocument(BufferParams const & params);
116
117         ///
118         void paper_update(BufferParams const &);
119         ///
120         void class_update(BufferParams const &);
121         ///
122         void language_update(BufferParams const &);
123         ///
124         void options_update(BufferParams const &);
125         ///
126         void bullets_update(BufferParams const &);
127
128         ///
129         void paper_apply();
130         ///
131         bool class_apply();
132         ///
133         bool language_apply();
134         ///
135         bool options_apply();
136         ///
137         void bullets_apply();
138
139         /// Typedefinitions from the fdesign produced Header file
140         FD_form_tabbed_document * build_tabbed_document();
141         ///
142         FD_form_doc_paper * build_doc_paper();
143         ///
144         FD_form_doc_class * build_doc_class();
145         ///
146         FD_form_doc_language * build_doc_language();
147         ///
148         FD_form_doc_options * build_doc_options();
149         ///
150         FD_form_doc_bullet * build_doc_bullet();
151
152         /// Real GUI implementation.
153         FD_form_tabbed_document * dialog_;
154         ///
155         FD_form_doc_paper       * paper_;
156         ///
157         FD_form_doc_class       * class_;
158         ///
159         FD_form_doc_language    * language_;
160         ///
161         FD_form_doc_options     * options_;
162         ///
163         FD_form_doc_bullet      * bullets_;
164         ///
165         int ActCell;
166         ///
167         int Confirmed;
168         ///
169         int current_bullet_panel;
170         ///
171         int current_bullet_depth;
172         ///
173         FL_OBJECT * fbullet;
174         ///
175         Combox * combo_language;
176         ///
177         Combox * combo_doc_class;
178 };
179
180 #endif