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