]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathDiff.cpp
"fix" bug #3332 (plain text export depends on the menu language)
[lyx.git] / src / mathed / InsetMathDiff.cpp
1 /**
2  * \file InsetMathDiff.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author André Pönitz
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "InsetMathDiff.h"
14 #include "MathData.h"
15 #include "MathStream.h"
16 #include "debug.h"
17
18
19 namespace lyx {
20
21 using std::auto_ptr;
22 using std::endl;
23
24
25 InsetMathDiff::InsetMathDiff()
26         : InsetMathNest(1)
27 {}
28
29
30 auto_ptr<Inset> InsetMathDiff::doClone() const
31 {
32         return auto_ptr<Inset>(new InsetMathDiff(*this));
33 }
34
35
36 void InsetMathDiff::addDer(MathData const & der)
37 {
38         cells_.push_back(der);
39 }
40
41
42 void InsetMathDiff::normalize(NormalStream & os) const
43 {
44         os << "[diff";
45         for (idx_type idx = 0; idx < nargs(); ++idx)
46                 os << ' ' << cell(idx);
47         os << ']';
48 }
49
50
51 bool InsetMathDiff::metrics(MetricsInfo &, Dimension &) const
52 {
53         lyxerr << "should not happen" << endl;
54         return true;
55 }
56
57
58 void InsetMathDiff::draw(PainterInfo &, int, int) const
59 {
60         lyxerr << "should not happen" << endl;
61 }
62
63
64 void InsetMathDiff::maple(MapleStream & os) const
65 {
66         os << "diff(";
67         for (idx_type idx = 0; idx < nargs(); ++idx) {
68                 if (idx != 0)
69                         os << ',';
70                 os << cell(idx);
71         }
72         os << ')';
73 }
74
75
76 void InsetMathDiff::maxima(MaximaStream & os) const
77 {
78         os << "diff(";
79         for (idx_type idx = 0; idx < nargs(); ++idx) {
80                 if (idx != 0)
81                         os << ',';
82                 os << cell(idx);
83                 if (idx != 0)
84                         os << ",1";
85         }
86         os << ')';
87 }
88
89
90 void InsetMathDiff::mathematica(MathematicaStream & os) const
91 {
92         os << "D[";
93         for (idx_type idx = 0; idx < nargs(); ++idx) {
94                 if (idx != 0)
95                         os << ',';
96                 os << cell(idx);
97         }
98         os << ']';
99 }
100
101
102 void InsetMathDiff::mathmlize(MathStream & os) const
103 {
104         os << "diff(";
105         for (idx_type idx = 0; idx < nargs(); ++idx) {
106                 if (idx != 0)
107                         os << ',';
108                 os << cell(idx);
109         }
110         os << ')';
111 }
112
113
114 void InsetMathDiff::write(WriteStream &) const
115 {
116         lyxerr << "should not happen" << endl;
117 }
118
119
120 } // namespace lyx