]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormDocument.h
Overhaul the branches code.
[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 "FormBase.h"
16 #include "BranchList.h"
17
18 #include <boost/scoped_ptr.hpp>
19
20 #include "lyx_forms.h"
21 #include <vector>
22
23 class ControlDocument;
24
25 class BufferParams;
26
27 class FormColorpicker;
28
29 struct FD_document;
30 struct FD_document_paper;
31 struct FD_document_class;
32 struct FD_document_language;
33 struct FD_document_options;
34 struct FD_document_bullet;
35 struct FD_document_branch;
36
37 namespace {
38
39 enum GuiColors {
40         GUI_COLOR_CHOICE   = FL_FREE_COL15
41 };
42
43
44 }
45
46
47 /** This class provides an XForms implementation of the FormDocument dialog.
48  *  The table-layout-form here changes values for latex-tabulars
49  */
50 class FormDocument : public FormCB<ControlDocument, FormDB<FD_document> > {
51 public:
52         FormDocument();
53 private:
54         /** Redraw the form (on receipt of a Signal indicating, for example,
55             that the xforms colours have been re-mapped). */
56         virtual void redraw();
57         /// Build the dialog
58         virtual void build();
59         /// Filter the inputs
60         virtual ButtonPolicy::SMInput input( FL_OBJECT *, long);
61         /// Update the dialog.
62         virtual void update();
63         /// Apply from dialog
64         virtual void apply();
65
66         ///
67         void branch_input(FL_OBJECT *);
68         ///
69         void ChoiceBulletSize(FL_OBJECT * ob, long);
70         ///
71         void InputBulletLaTeX(FL_OBJECT * ob, long);
72         ///
73         void BulletDepth(FL_OBJECT * ob);
74         ///
75         void BulletPanel(FL_OBJECT * ob);
76         ///
77         void BulletBMTable(FL_OBJECT * ob, long);
78         ///
79         void checkReadOnly();
80         ///
81         void CheckChoiceClass();
82         ///
83         void UpdateLayoutDocument(BufferParams const & params);
84         ///
85         void UpdateClassParams(BufferParams const & params);
86
87         ///
88         void paper_update(BufferParams const &);
89         ///
90         void class_update(BufferParams const &);
91         ///
92         void language_update(BufferParams const &);
93         ///
94         void options_update(BufferParams const &);
95         ///
96         void bullets_update(BufferParams const &);
97         ///
98         void branch_update(BufferParams const &);
99
100         ///
101         void paper_apply(BufferParams &);
102         ///
103         bool class_apply(BufferParams &);
104         ///
105         bool language_apply(BufferParams &);
106         ///
107         bool options_apply(BufferParams &);
108         ///
109         void bullets_apply(BufferParams &);
110         ///
111         void branch_apply(BufferParams &);
112
113         void rebuild_all_branches_browser();
114         void rebuild_selected_branches_browser();
115
116         /// Real GUI implementation.
117         boost::scoped_ptr<FD_document_paper>    paper_;
118         ///
119         boost::scoped_ptr<FD_document_class>    class_;
120         ///
121         boost::scoped_ptr<FD_document_language> language_;
122         ///
123         boost::scoped_ptr<FD_document_options>  options_;
124         ///
125         boost::scoped_ptr<FD_document_bullet>   bullets_;
126         ///
127         boost::scoped_ptr<FD_document_branch>   branch_;
128         ///
129         boost::scoped_ptr<FormColorpicker> picker_;
130         ///
131         int ActCell;
132         ///
133         int Confirmed;
134         ///
135         int current_bullet_panel;
136         ///
137         int current_bullet_depth;
138         ///
139         FL_OBJECT * fbullet;
140         ///
141         std::vector<std::string> lang_;
142         /// Contains all legal branches for this doc
143         BranchList branchlist_;
144 };
145
146 #endif