]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormDocument.h
(Rob Laheye): changes to the document dialog + some trivia.
[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 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "FormBaseDeprecated.h"
20
21 #include <boost/scoped_ptr.hpp>
22
23 #include <vector>
24
25 class Combox;
26 class BufferParams;
27
28 struct FD_document;
29 struct FD_document_paper;
30 struct FD_document_class;
31 struct FD_document_language;
32 struct FD_document_options;
33 struct FD_document_bullet;
34
35 /** This class provides an XForms implementation of the FormDocument dialog.
36     The table-layout-form here changes values for latex-tabulars
37  */
38 class FormDocument : public FormBaseBD {
39 public:
40         FormDocument(LyXView &, Dialogs &);
41         ///
42         static void ComboInputCB(int, void *, Combox *);
43 private:
44         /// Pointer to the actual instantiation of the ButtonController.
45         virtual xformsBC & bc();
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 bool input( FL_OBJECT *, long);
53         /// Update the dialog.
54         virtual void update();
55         /// Apply from dialog
56         virtual void apply();
57         /// Cancel from dialog
58         virtual void cancel();
59
60         ///
61         virtual FL_FORM * form() const;
62
63         ///
64         void ChoiceBulletSize(FL_OBJECT * ob, long);
65         ///
66         void InputBulletLaTeX(FL_OBJECT * ob, long);
67         ///
68         void BulletDepth(FL_OBJECT * ob);
69         ///
70         void BulletPanel(FL_OBJECT * ob);
71         ///
72         void BulletBMTable(FL_OBJECT * ob, long);
73         ///
74         void checkReadOnly();
75         ///
76         void CheckChoiceClass(FL_OBJECT * ob, long);
77         ///
78         void UpdateLayoutDocument(BufferParams const & params);
79         ///
80         void UpdateClassParams(BufferParams const & params);
81
82         ///
83         void paper_update(BufferParams const &);
84         ///
85         void class_update(BufferParams const &);
86         ///
87         void language_update(BufferParams const &);
88         ///
89         void options_update(BufferParams const &);
90         ///
91         void bullets_update(BufferParams const &);
92
93         ///
94         void paper_apply(BufferParams &);
95         ///
96         bool class_apply(BufferParams &);
97         ///
98         bool language_apply(BufferParams &);
99         ///
100         bool options_apply(BufferParams &);
101         ///
102         void bullets_apply(BufferParams &);
103
104         ///
105         void paper_apply();
106         ///
107         bool class_apply();
108         ///
109         bool language_apply();
110         ///
111         bool options_apply();
112         ///
113         void bullets_apply();
114
115         /// Real GUI implementation.
116         boost::scoped_ptr<FD_document> dialog_;
117         ///
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         int ActCell;
129         ///
130         int Confirmed;
131         ///
132         int current_bullet_panel;
133         ///
134         int current_bullet_depth;
135         ///
136         FL_OBJECT * fbullet;
137         ///
138         boost::scoped_ptr<Combox> combo_language;
139         ///
140         boost::scoped_ptr<Combox> combo_doc_class;
141         /// The ButtonController
142         ButtonController<NoRepeatedApplyReadOnlyPolicy, xformsBC> bc_;
143         ///
144         std::vector<string> lang_;
145 };
146
147
148 inline
149 xformsBC & FormDocument::bc()
150 {
151         return bc_;
152 }
153
154 #endif