]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormDocument.h
get rid of broken_header.h and some unneeded tests
[lyx.git] / src / frontends / xforms / FormDocument.h
1 // -*- C++ -*-
2 /**
3  * \file FormDocument.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Jürgen Vigna
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef FORM_DOCUMENT_H
13 #define FORM_DOCUMENT_H
14
15 #include "FormDialogView.h"
16 #include "BranchList.h"
17
18 #include <boost/scoped_ptr.hpp>
19
20 #include "lyx_forms.h"
21 #include <vector>
22
23 class BufferParams;
24
25 namespace lyx {
26 namespace frontend {
27
28 class ControlDocument;
29 class FormColorpicker;
30 struct FD_document;
31 struct FD_document_paper;
32 struct FD_document_class;
33 struct FD_document_language;
34 struct FD_document_options;
35 struct FD_document_bullet;
36 struct FD_document_branch;
37
38 /** This class provides an XForms implementation of the FormDocument dialog.
39  *  The table-layout-form here changes values for latex-tabulars
40  */
41 class FormDocument
42         : public FormController<ControlDocument, FormView<FD_document> > {
43 public:
44         FormDocument(Dialog &);
45 private:
46         /** Redraw the form (on receipt of a Signal indicating, for example,
47             that the xforms colours have been re-mapped). */
48         virtual void redraw();
49         /// Build the dialog
50         virtual void build();
51         /// Filter the inputs
52         virtual ButtonPolicy::SMInput input( FL_OBJECT *, long);
53         /// Update the dialog.
54         virtual void update();
55         /// Apply from dialog
56         virtual void apply();
57
58         ///
59         void branch_input(FL_OBJECT *);
60         ///
61         void ChoiceBulletSize(FL_OBJECT * ob, long);
62         ///
63         void InputBulletLaTeX(FL_OBJECT * ob, long);
64         ///
65         void BulletDepth(FL_OBJECT * ob);
66         ///
67         void BulletPanel(FL_OBJECT * ob);
68         ///
69         void BulletBMTable(FL_OBJECT * ob, long);
70         ///
71         void checkReadOnly();
72         ///
73         void CheckChoiceClass();
74         ///
75         void UpdateLayoutDocument(BufferParams const & params);
76         ///
77         void UpdateClassParams(BufferParams const & params);
78
79         ///
80         void paper_update(BufferParams const &);
81         ///
82         void class_update(BufferParams const &);
83         ///
84         void language_update(BufferParams const &);
85         ///
86         void options_update(BufferParams const &);
87         ///
88         void bullets_update(BufferParams const &);
89         ///
90         void branch_update(BufferParams const &);
91
92         ///
93         void paper_apply(BufferParams &);
94         ///
95         bool class_apply(BufferParams &);
96         ///
97         bool language_apply(BufferParams &);
98         ///
99         bool options_apply(BufferParams &);
100         ///
101         void bullets_apply(BufferParams &);
102         ///
103         void branch_apply(BufferParams &);
104
105         void rebuild_all_branches_browser();
106         void rebuild_selected_branches_browser();
107
108         /// Real GUI implementation.
109         boost::scoped_ptr<FD_document_paper>    paper_;
110         ///
111         boost::scoped_ptr<FD_document_class>    class_;
112         ///
113         boost::scoped_ptr<FD_document_language> language_;
114         ///
115         boost::scoped_ptr<FD_document_options>  options_;
116         ///
117         boost::scoped_ptr<FD_document_bullet>   bullets_;
118         ///
119         boost::scoped_ptr<FD_document_branch>   branch_;
120         ///
121         boost::scoped_ptr<FormColorpicker> picker_;
122         ///
123         int ActCell;
124         ///
125         int Confirmed;
126         ///
127         int current_bullet_panel;
128         ///
129         int current_bullet_depth;
130         ///
131         FL_OBJECT * fbullet;
132         ///
133         std::vector<std::string> lang_;
134         /// Contains all legal branches for this doc
135         BranchList branchlist_;
136 };
137
138 } // namespace frontend
139 } // namespace lyx
140
141 #endif