]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormDocument.h
Really dull and boring header shit
[lyx.git] / src / frontends / xforms / FormDocument.h
1 // -*- C++ -*-
2 /**
3  * \file FormDocument.h
4  * Read the file COPYING
5  *
6  * \author Jürgen Vigna
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #ifndef FORM_DOCUMENT_H
12 #define FORM_DOCUMENT_H
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "FormBaseDeprecated.h"
19
20 #include <boost/scoped_ptr.hpp>
21
22 #include <vector>
23
24 class Combox;
25 class BufferParams;
26
27 struct FD_document;
28 struct FD_document_paper;
29 struct FD_document_class;
30 struct FD_document_language;
31 struct FD_document_options;
32 struct FD_document_bullet;
33
34 /** This class provides an XForms implementation of the FormDocument dialog.
35     The table-layout-form here changes values for latex-tabulars
36  */
37 class FormDocument : public FormBaseBD {
38 public:
39         FormDocument(LyXView &, Dialogs &);
40         ///
41         static void ComboInputCB(int, void *, Combox *);
42 private:
43         /// Pointer to the actual instantiation of the ButtonController.
44         virtual xformsBC & bc();
45         /** Redraw the form (on receipt of a Signal indicating, for example,
46             that the xforms colours have been re-mapped). */
47         virtual void redraw();
48         /// Build the dialog
49         virtual void build();
50         /// Filter the inputs
51         virtual bool input( FL_OBJECT *, long);
52         /// Update the dialog.
53         virtual void update();
54         /// Apply from dialog
55         virtual void apply();
56         /// Cancel from dialog
57         virtual void cancel();
58
59         ///
60         virtual FL_FORM * form() const;
61
62         ///
63         bool CheckDocumentInput(FL_OBJECT * ob, long);
64         ///
65         void ChoiceBulletSize(FL_OBJECT * ob, long);
66         ///
67         void InputBulletLaTeX(FL_OBJECT * ob, long);
68         ///
69         void BulletDepth(FL_OBJECT * ob);
70         ///
71         void BulletPanel(FL_OBJECT * ob);
72         ///
73         void BulletBMTable(FL_OBJECT * ob, long);
74         ///
75         void checkReadOnly();
76         ///
77         void CheckChoiceClass(FL_OBJECT * ob, long);
78         ///
79         void UpdateLayoutDocument(BufferParams const & params);
80         ///
81         void UpdateClassParams(BufferParams const & params);
82
83         ///
84         void paper_update(BufferParams const &);
85         ///
86         void class_update(BufferParams const &);
87         ///
88         void language_update(BufferParams const &);
89         ///
90         void options_update(BufferParams const &);
91         ///
92         void bullets_update(BufferParams const &);
93
94         ///
95         void paper_apply(BufferParams &);
96         ///
97         bool class_apply(BufferParams &);
98         ///
99         bool language_apply(BufferParams &);
100         ///
101         bool options_apply(BufferParams &);
102         ///
103         void bullets_apply(BufferParams &);
104
105         ///
106         void paper_apply();
107         ///
108         bool class_apply();
109         ///
110         bool language_apply();
111         ///
112         bool options_apply();
113         ///
114         void bullets_apply();
115
116         /// Real GUI implementation.
117         boost::scoped_ptr<FD_document> dialog_;
118         ///
119         boost::scoped_ptr<FD_document_paper>    paper_;
120         ///
121         boost::scoped_ptr<FD_document_class>    class_;
122         ///
123         boost::scoped_ptr<FD_document_language> language_;
124         ///
125         boost::scoped_ptr<FD_document_options>  options_;
126         ///
127         boost::scoped_ptr<FD_document_bullet>   bullets_;
128         ///
129         int ActCell;
130         ///
131         int Confirmed;
132         ///
133         int current_bullet_panel;
134         ///
135         int current_bullet_depth;
136         ///
137         FL_OBJECT * fbullet;
138         ///
139         boost::scoped_ptr<Combox> combo_language;
140         ///
141         boost::scoped_ptr<Combox> combo_doc_class;
142         /// The ButtonController
143         ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_;
144         ///
145         std::vector<string> lang_;
146 };
147
148
149 inline
150 xformsBC & FormDocument::bc()
151 {
152         return bc_;
153 }
154
155 #endif