]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormDocument.h
Pass and store references to LyXView and Dialogs, not pointers in the
[lyx.git] / src / frontends / xforms / FormDocument.h
1 // -*- C++ -*-
2 /**
3  * \file FormDocument.h
4  * Copyright 2000-2002 the LyX Team
5  * Read the file COPYING
6  *
7  * \author Jürgen Vigna, jug@sad.it
8  */
9
10 #ifndef FORM_DOCUMENT_H
11 #define FORM_DOCUMENT_H
12
13 #ifdef __GNUG__
14 #pragma interface
15 #endif
16
17 #include "FormBaseDeprecated.h"
18
19 #include <boost/scoped_ptr.hpp>
20
21 #include <vector>
22
23 class Combox;
24 class BufferParams;
25
26 struct FD_document;
27 struct FD_document_paper;
28 struct FD_document_class;
29 struct FD_document_language;
30 struct FD_document_options;
31 struct FD_document_bullet;
32
33 /** This class provides an XForms implementation of the FormDocument dialog.
34     The table-layout-form here changes values for latex-tabulars
35  */
36 class FormDocument : public FormBaseBD {
37 public:
38         FormDocument(LyXView &, Dialogs &);
39         ///
40         static void ComboInputCB(int, void *, Combox *);
41 private:
42         /// Pointer to the actual instantiation of the ButtonController.
43         virtual xformsBC & bc();
44         /** Redraw the form (on receipt of a Signal indicating, for example,
45             that the xforms colours have been re-mapped). */
46         virtual void redraw();
47         /// Build the dialog
48         virtual void build();
49         /// Filter the inputs
50         virtual bool input( FL_OBJECT *, long);
51         /// Update the dialog.
52         virtual void update();
53         /// Apply from dialog
54         virtual void apply();
55         /// Cancel from dialog
56         virtual void cancel();
57
58         ///
59         virtual FL_FORM * form() const;
60
61         ///
62         bool CheckDocumentInput(FL_OBJECT * ob, long);
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