]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormDocument.h
update copyright year
[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 2000-2001 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 <vector>
17 #include <boost/smart_ptr.hpp>
18
19 #ifdef __GNUG_
20 #pragma interface
21 #endif
22
23 #include "FormBaseDeprecated.h"
24
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 dialog.
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(LyXView *, Dialogs *);
42         ///
43         static void ComboInputCB(int, void *, Combox *);
44 private:
45         ///
46         enum State {
47                 ///
48                 INPUT,
49                 ///
50                 CHECKCHOICECLASS,
51                 ///
52                 CHOICEBULLETSIZE,
53                 ///
54                 INPUTBULLETLATEX,
55                 ///
56                 BULLETDEPTH1,
57                 ///
58                 BULLETDEPTH2,
59                 ///
60                 BULLETDEPTH3,
61                 ///
62                 BULLETDEPTH4,
63                 ///
64                 BULLETPANEL1,
65                 ///
66                 BULLETPANEL2,
67                 ///
68                 BULLETPANEL3,
69                 ///
70                 BULLETPANEL4,
71                 ///
72                 BULLETPANEL5,
73                 ///
74                 BULLETPANEL6,
75                 ///
76                 BULLETBMTABLE
77         };
78         /// Pointer to the actual instantiation of the ButtonController.
79         virtual xformsBC & bc();
80         /** Redraw the form (on receipt of a Signal indicating, for example,
81             that the xforms colours have been re-mapped). */
82         virtual void redraw();
83         /// Build the dialog
84         virtual void build();
85         /// Filter the inputs
86         virtual bool input( FL_OBJECT *, long );
87         /// Update the dialog.
88         virtual void update();
89         /// Apply from dialog
90         virtual void apply();
91         /// Cancel from dialog
92         virtual void cancel();
93
94         ///
95         virtual FL_FORM * form() const;
96
97         ///
98         bool CheckDocumentInput(FL_OBJECT * ob, long);
99         ///
100         void ChoiceBulletSize(FL_OBJECT * ob, long);
101         ///
102         void InputBulletLaTeX(FL_OBJECT * ob, long);
103         ///
104         void BulletDepth(FL_OBJECT * ob, State);
105         ///
106         void BulletPanel(FL_OBJECT * ob, State);
107         ///
108         void BulletBMTable(FL_OBJECT * ob, long);
109         ///
110         void checkMarginValues();
111         ///
112         void checkReadOnly();
113         ///
114         void CheckChoiceClass(FL_OBJECT * ob, long);
115         ///
116         void UpdateLayoutDocument(BufferParams const & params);
117
118         ///
119         void paper_update(BufferParams const &);
120         ///
121         void class_update(BufferParams const &);
122         ///
123         void language_update(BufferParams const &);
124         ///
125         void options_update(BufferParams const &);
126         ///
127         void bullets_update(BufferParams const &);
128
129         ///
130         void paper_apply();
131         ///
132         bool class_apply();
133         ///
134         bool language_apply();
135         ///
136         bool options_apply();
137         ///
138         void bullets_apply();
139
140         /// Fdesign generated methods
141         FD_form_tabbed_document * build_tabbed_document();
142         ///
143         FD_form_doc_paper * build_doc_paper();
144         ///
145         FD_form_doc_class * build_doc_class();
146         ///
147         FD_form_doc_language * build_doc_language();
148         ///
149         FD_form_doc_options * build_doc_options();
150         ///
151         FD_form_doc_bullet * build_doc_bullet();
152
153         /// Real GUI implementation.
154         boost::scoped_ptr<FD_form_tabbed_document> dialog_;
155         ///
156         boost::scoped_ptr<FD_form_doc_paper>       paper_;
157         ///
158         boost::scoped_ptr<FD_form_doc_class>       class_;
159         ///
160         boost::scoped_ptr<FD_form_doc_language>    language_;
161         ///
162         boost::scoped_ptr<FD_form_doc_options>     options_;
163         ///
164         boost::scoped_ptr<FD_form_doc_bullet>      bullets_;
165         ///
166         int ActCell;
167         ///
168         int Confirmed;
169         ///
170         int current_bullet_panel;
171         ///
172         int current_bullet_depth;
173         ///
174         FL_OBJECT * fbullet;
175         ///
176         boost::scoped_ptr<Combox> combo_language;
177         ///
178         boost::scoped_ptr<Combox> combo_doc_class;
179         /// The ButtonController
180         ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_;
181 };
182
183
184 inline
185 xformsBC & FormDocument::bc()
186 {
187         return bc_;
188 }
189
190 #endif