3 * \file math_mathmlstream.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef MATH_MATHMLSTREAM_H
13 #define MATH_MATHMLSTREAM_H
16 // Please keep all four streams in one file until the interface has
20 #include "metricsinfo.h"
35 WriteStream(std::ostream & os, bool fragile, bool latex);
37 explicit WriteStream(std::ostream & os);
41 int line() const { return line_; }
43 bool fragile() const { return fragile_; }
45 bool latex() const { return latex_; }
47 std::ostream & os() { return os_; }
49 bool & firstitem() { return firstitem_; }
51 void addlines(unsigned int);
52 /// writes space if next thing is isalpha()
53 void pendingSpace(bool how);
54 /// writes space if next thing is isalpha()
55 bool pendingSpace() const { return pendingspace_; }
59 /// do we have to write \\protect sometimes
61 /// are we at the beginning of an MathArray?
63 /// are we writing to .tex?
65 /// do we have a space pending?
72 WriteStream & operator<<(WriteStream &, MathAtom const &);
74 WriteStream & operator<<(WriteStream &, MathArray const &);
76 WriteStream & operator<<(WriteStream &, char const *);
78 WriteStream & operator<<(WriteStream &, char);
80 WriteStream & operator<<(WriteStream &, int);
82 WriteStream & operator<<(WriteStream &, unsigned int);
93 MTag(char const * const tag) : tag_(tag) {}
95 char const * const tag_;
101 ETag(char const * const tag) : tag_(tag) {}
103 char const * const tag_;
109 explicit MathMLStream(std::ostream & os);
113 std::ostream & os() { return os_; }
115 int line() const { return line_; }
117 int & tab() { return tab_; }
119 friend MathMLStream & operator<<(MathMLStream &, char const *);
132 MathMLStream & operator<<(MathMLStream &, MathAtom const &);
134 MathMLStream & operator<<(MathMLStream &, MathArray const &);
136 MathMLStream & operator<<(MathMLStream &, char const *);
138 MathMLStream & operator<<(MathMLStream &, char);
140 MathMLStream & operator<<(MathMLStream &, MTag const &);
142 MathMLStream & operator<<(MathMLStream &, ETag const &);
153 explicit NormalStream(std::ostream & os) : os_(os) {}
155 std::ostream & os() { return os_; }
162 NormalStream & operator<<(NormalStream &, MathAtom const &);
164 NormalStream & operator<<(NormalStream &, MathArray const &);
166 NormalStream & operator<<(NormalStream &, char const *);
168 NormalStream & operator<<(NormalStream &, char);
170 NormalStream & operator<<(NormalStream &, int);
181 explicit MapleStream(std::ostream & os) : os_(os) {}
183 std::ostream & os() { return os_; }
191 MapleStream & operator<<(MapleStream &, MathAtom const &);
193 MapleStream & operator<<(MapleStream &, MathArray const &);
195 MapleStream & operator<<(MapleStream &, char const *);
197 MapleStream & operator<<(MapleStream &, char);
199 MapleStream & operator<<(MapleStream &, int);
210 explicit MaximaStream(std::ostream & os) : os_(os) {}
212 std::ostream & os() { return os_; }
220 MaximaStream & operator<<(MaximaStream &, MathAtom const &);
222 MaximaStream & operator<<(MaximaStream &, MathArray const &);
224 MaximaStream & operator<<(MaximaStream &, char const *);
226 MaximaStream & operator<<(MaximaStream &, char);
228 MaximaStream & operator<<(MaximaStream &, int);
236 class MathematicaStream {
239 explicit MathematicaStream(std::ostream & os) : os_(os) {}
241 std::ostream & os() { return os_; }
249 MathematicaStream & operator<<(MathematicaStream &, MathAtom const &);
251 MathematicaStream & operator<<(MathematicaStream &, MathArray const &);
253 MathematicaStream & operator<<(MathematicaStream &, char const *);
255 MathematicaStream & operator<<(MathematicaStream &, char);
257 MathematicaStream & operator<<(MathematicaStream &, int);
268 explicit OctaveStream(std::ostream & os) : os_(os) {}
270 std::ostream & os() { return os_; }
277 OctaveStream & operator<<(OctaveStream &, MathAtom const &);
279 OctaveStream & operator<<(OctaveStream &, MathArray const &);
281 OctaveStream & operator<<(OctaveStream &, char const *);
283 OctaveStream & operator<<(OctaveStream &, char);
285 OctaveStream & operator<<(OctaveStream &, int);