]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/FormDocument.h
implement getLabelList
[lyx.git] / src / frontends / qt2 / FormDocument.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  *
5  *           LyX, The Document Processor
6  *
7  *           Copyright (C) 2000 The LyX Team.
8  *
9  *           @author Kalle Dalheimer
10  *
11  *======================================================*/
12
13 #ifndef FORM_DOCUMENT_H
14 #define FORM_DOCUMENT_H
15
16 #include <vector>
17 #include <boost/smart_ptr.hpp>
18
19 #include "Qt2Base.h"
20 #include "qt2BC.h"
21 #undef emit
22
23 #ifdef __GNUG_
24 #pragma interface
25 #endif
26
27 class ControlDocument;
28 class FormDocumentDialogImpl;
29 class BufferParams;
30 class LyXView;
31 class Dialogs;
32
33 /** This class provides an Qt2 implementation of the FormDocument dialog.
34     The table-layout-form here changes values for latex-tabulars
35     @author Kalle Dalheimer
36  */
37 class FormDocument
38   : public Qt2CB<ControlDocument, Qt2DB<FormDocumentDialogImpl> >
39 {
40 public:
41         FormDocument(LyXView *, Dialogs *);
42 private:
43         ///
44         enum State {
45                 ///
46                 INPUT,
47                 ///
48                 CHECKCHOICECLASS,
49                 ///
50                 CHOICEBULLETSIZE,
51                 ///
52                 INPUTBULLETLATEX,
53                 ///
54                 BULLETDEPTH1,
55                 ///
56                 BULLETDEPTH2,
57                 ///
58                 BULLETDEPTH3,
59                 ///
60                 BULLETDEPTH4,
61                 ///
62                 BULLETPANEL1,
63                 ///
64                 BULLETPANEL2,
65                 ///
66                 BULLETPANEL3,
67                 ///
68                 BULLETPANEL4,
69                 ///
70                 BULLETPANEL5,
71                 ///
72                 BULLETPANEL6,
73                 ///
74                 BULLETBMTABLE
75         };
76         /// Pointer to the actual instantiation of the ButtonController.
77         virtual qt2BC & bc();
78         /// Build the dialog
79         virtual void build();
80 //      /// Filter the inputs
81 //      virtual bool input( FL_OBJECT *, long );
82         /// Update the dialog.
83         virtual void update();
84         /// Apply from dialog
85         virtual void apply();
86         /// Cancel from dialog
87         virtual void cancel();
88
89 //      ///
90 //      virtual QDialog* form() const;
91
92         ///
93         bool CheckDocumentInput(QWidget* ob, long);
94         ///
95         void ChoiceBulletSize(QWidget* ob, long);
96         ///
97         void InputBulletLaTeX(QWidget* ob, long);
98         ///
99         void BulletDepth(QWidget* ob, State);
100         ///
101         void BulletPanel(QWidget* ob, State);
102         ///
103         void BulletBMTable(QWidget* ob, long);
104         ///
105         void checkMarginValues();
106         ///
107         void checkReadOnly();
108         ///
109         void CheckChoiceClass(QWidget* ob, long);
110         ///
111         void UpdateLayoutDocument(BufferParams const & params);
112
113         ///
114         void paper_update(BufferParams const &);
115         ///
116         void class_update(BufferParams const &);
117         ///
118         void language_update(BufferParams const &);
119         ///
120         void options_update(BufferParams const &);
121         ///
122         void bullets_update(BufferParams const &);
123
124         ///
125         void paper_apply();
126         ///
127         bool class_apply();
128         ///
129         bool language_apply();
130         ///
131         bool options_apply();
132         ///
133         void bullets_apply();
134
135         /// Fdesign generated methods
136         QDialog* build_tabbed_document();
137         ///
138         QDialog* build_doc_paper();
139         ///
140         QDialog* build_doc_class();
141         ///
142         QDialog* build_doc_language();
143         ///
144         QDialog* build_doc_options();
145         ///
146         QDialog* build_doc_bullet();
147
148         /// Real GUI implementation.
149         boost::scoped_ptr<FormDocumentDialogImpl> dialog_;
150         ///
151         int ActCell;
152         ///
153         int Confirmed;
154         ///
155         int current_bullet_panel;
156         ///
157         int current_bullet_depth;
158 //      ///
159 //      FL_OBJECT * fbullet;
160 //      ///
161 //      boost::scoped_ptr<Combox> combo_language;
162 //      ///
163 //      boost::scoped_ptr<Combox> combo_doc_class;
164         /// The ButtonController
165         ButtonController<NoRepeatedApplyReadOnlyPolicy, qt2BC> bc_;
166 };
167
168
169 inline
170 qt2BC & FormDocument::bc()
171 {
172         return bc_;
173 }
174
175 #endif