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