]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QMath.C
Get rid of the static_casts.
[lyx.git] / src / frontends / qt2 / QMath.C
1 /**
2  * \file QMath.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #include <config.h>
12
13
14 #include "debug.h"
15
16 #include "lfuns.h"
17 #include "funcrequest.h"
18 #include "LyXView.h"
19 #include "BufferView.h"
20
21 #include "QMathDialog.h"
22 #include "QMath.h"
23
24 #include "iconpalette.h"
25
26 // needless to say, this can't last for long
27 #warning FIXME Current_view used here!
28 extern BufferView * current_view;
29
30
31 // FIXME temporary HACK !
32 void createMathPanel()
33 {
34         static QMath * dialog = 0;
35         if (!dialog) {
36                 dialog = new QMath;
37                 dialog->build_dialog();
38         }
39         dialog->do_show();
40 }
41
42
43 QMath::QMath()
44 {
45 }
46
47
48 void QMath::do_show()
49 {
50         dialog_->show();
51 }
52
53
54 void QMath::build_dialog()
55 {
56         dialog_ = new QMathDialog(this);
57 }
58
59
60 void QMath::subscript()
61 {
62 #warning FIXME Current_view used here!
63         current_view->owner()->dispatch(FuncRequest(LFUN_SUBSCRIPT));
64 }
65
66
67 void QMath::superscript()
68 {
69 #warning FIXME Current_view used here!
70         current_view->owner()->dispatch(FuncRequest(LFUN_SUPERSCRIPT));
71 }
72
73
74 void QMath::insert(string const & name)
75 {
76 #warning FIXME Current_view used here!
77         current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATH, '\\' + name));
78 }
79
80
81 void QMath::insertCubeRoot()
82 {
83 #warning FIXME Current_view used here!
84         current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATH, "\\root"));
85         current_view->owner()->dispatch(FuncRequest(LFUN_SELFINSERT, "3"));
86         current_view->owner()->dispatch(FuncRequest(LFUN_RIGHT));
87 }
88
89
90 void QMath::insertMatrix(string const & str)
91 {
92 #warning FIXME Current_view used here!
93         current_view->owner()->dispatch(FuncRequest(LFUN_INSERT_MATRIX, str));
94 }
95
96
97 void QMath::insertDelim(string const & str)
98 {
99 #warning FIXME Current_view used here!
100         current_view->owner()->dispatch(FuncRequest(LFUN_MATH_DELIM, str));
101 }
102
103
104 void QMath::toggleDisplay()
105 {
106 #warning FIXME Current_view used here!
107         current_view->owner()->dispatch(FuncRequest(LFUN_MATH_DISPLAY));
108 }