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