]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormDocument.h
sourcedoc-friendly files.
[lyx.git] / src / frontends / xforms / FormDocument.h
1 // -*- C++ -*-
2 /**
3  * \file FormDocument.h
4  * Copyright 2000-2002 the LyX Team
5  * Read the file COPYING
6  *
7  * \author Jürgen Vigna, jug@sad.it
8  */
9
10 #ifndef FORM_DOCUMENT_H
11 #define FORM_DOCUMENT_H
12
13 #include <vector>
14 #include <boost/smart_ptr.hpp>
15
16 #ifdef __GNUG_
17 #pragma interface
18 #endif
19
20 #include "FormBaseDeprecated.h"
21
22 class Combox;
23 class BufferParams;
24
25 struct FD_form_tabbed_document;
26 struct FD_form_doc_paper;
27 struct FD_form_doc_class;
28 struct FD_form_doc_language;
29 struct FD_form_doc_options;
30 struct FD_form_doc_bullet;
31
32 /** This class provides an XForms implementation of the FormDocument dialog.
33     The table-layout-form here changes values for latex-tabulars
34  */
35 class FormDocument : public FormBaseBD {
36 public:
37         FormDocument(LyXView *, Dialogs *);
38         ///
39         static void ComboInputCB(int, void *, Combox *);
40 private:
41         ///
42         enum State {
43                 ///
44                 INPUT,
45                 ///
46                 CHECKCHOICECLASS,
47                 ///
48                 CHOICEBULLETSIZE,
49                 ///
50                 INPUTBULLETLATEX,
51                 ///
52                 BULLETDEPTH1,
53                 ///
54                 BULLETDEPTH2,
55                 ///
56                 BULLETDEPTH3,
57                 ///
58                 BULLETDEPTH4,
59                 ///
60                 BULLETPANEL1,
61                 ///
62                 BULLETPANEL2,
63                 ///
64                 BULLETPANEL3,
65                 ///
66                 BULLETPANEL4,
67                 ///
68                 BULLETPANEL5,
69                 ///
70                 BULLETPANEL6,
71                 ///
72                 BULLETBMTABLE
73         };
74         /// Pointer to the actual instantiation of the ButtonController.
75         virtual xformsBC & bc();
76         /** Redraw the form (on receipt of a Signal indicating, for example,
77             that the xforms colours have been re-mapped). */
78         virtual void redraw();
79         /// Build the dialog
80         virtual void build();
81         /// Filter the inputs
82         virtual bool input( FL_OBJECT *, long);
83         /// Update the dialog.
84         virtual void update();
85         /// Apply from dialog
86         virtual void apply();
87         /// Cancel from dialog
88         virtual void cancel();
89
90         ///
91         virtual FL_FORM * form() const;
92
93         ///
94         bool CheckDocumentInput(FL_OBJECT * ob, long);
95         ///
96         void ChoiceBulletSize(FL_OBJECT * ob, long);
97         ///
98         void InputBulletLaTeX(FL_OBJECT * ob, long);
99         ///
100         void BulletDepth(FL_OBJECT * ob, State);
101         ///
102         void BulletPanel(FL_OBJECT * ob, State);
103         ///
104         void BulletBMTable(FL_OBJECT * ob, long);
105         ///
106         void checkReadOnly();
107         ///
108         void CheckChoiceClass(FL_OBJECT * ob, long);
109         ///
110         void UpdateLayoutDocument(BufferParams const & params);
111
112         ///
113         void paper_update(BufferParams const &);
114         ///
115         void class_update(BufferParams const &);
116         ///
117         void language_update(BufferParams const &);
118         ///
119         void options_update(BufferParams const &);
120         ///
121         void bullets_update(BufferParams const &);
122
123         ///
124         void paper_apply(BufferParams &);
125         ///
126         bool class_apply(BufferParams &);
127         ///
128         bool language_apply(BufferParams &);
129         ///
130         bool options_apply(BufferParams &);
131         ///
132         void bullets_apply(BufferParams &);
133
134         ///
135         void paper_apply();
136         ///
137         bool class_apply();
138         ///
139         bool language_apply();
140         ///
141         bool options_apply();
142         ///
143         void bullets_apply();
144
145         /// Fdesign generated methods
146         FD_form_tabbed_document * build_tabbed_document();
147         ///
148         FD_form_doc_paper * build_doc_paper();
149         ///
150         FD_form_doc_class * build_doc_class();
151         ///
152         FD_form_doc_language * build_doc_language();
153         ///
154         FD_form_doc_options * build_doc_options();
155         ///
156         FD_form_doc_bullet * build_doc_bullet();
157
158         /// Real GUI implementation.
159         boost::scoped_ptr<FD_form_tabbed_document> dialog_;
160         ///
161         boost::scoped_ptr<FD_form_doc_paper>       paper_;
162         ///
163         boost::scoped_ptr<FD_form_doc_class>       class_;
164         ///
165         boost::scoped_ptr<FD_form_doc_language>    language_;
166         ///
167         boost::scoped_ptr<FD_form_doc_options>     options_;
168         ///
169         boost::scoped_ptr<FD_form_doc_bullet>      bullets_;
170         ///
171         int ActCell;
172         ///
173         int Confirmed;
174         ///
175         int current_bullet_panel;
176         ///
177         int current_bullet_depth;
178         ///
179         FL_OBJECT * fbullet;
180         ///
181         boost::scoped_ptr<Combox> combo_language;
182         ///
183         boost::scoped_ptr<Combox> combo_doc_class;
184         /// The ButtonController
185         ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_;
186 };
187
188
189 inline
190 xformsBC & FormDocument::bc()
191 {
192         return bc_;
193 }
194
195 #endif