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);
92 MTag(char const * const tag) : tag_(tag) {}
94 char const * const tag_;
99 ETag(char const * const tag) : tag_(tag) {}
101 char const * const tag_;
107 explicit MathMLStream(std::ostream & os);
111 std::ostream & os() { return os_; }
113 int line() const { return line_; }
115 int & tab() { return tab_; }
117 friend MathMLStream & operator<<(MathMLStream &, char const *);
130 MathMLStream & operator<<(MathMLStream &, MathAtom const &);
132 MathMLStream & operator<<(MathMLStream &, MathArray const &);
134 MathMLStream & operator<<(MathMLStream &, char const *);
136 MathMLStream & operator<<(MathMLStream &, char);
138 MathMLStream & operator<<(MathMLStream &, MTag const &);
140 MathMLStream & operator<<(MathMLStream &, ETag const &);
151 explicit NormalStream(std::ostream & os) : os_(os) {}
153 std::ostream & os() { return os_; }
160 NormalStream & operator<<(NormalStream &, MathAtom const &);
162 NormalStream & operator<<(NormalStream &, MathArray const &);
164 NormalStream & operator<<(NormalStream &, char const *);
166 NormalStream & operator<<(NormalStream &, char);
168 NormalStream & operator<<(NormalStream &, int);
179 explicit MapleStream(std::ostream & os) : os_(os) {}
181 std::ostream & os() { return os_; }
189 MapleStream & operator<<(MapleStream &, MathAtom const &);
191 MapleStream & operator<<(MapleStream &, MathArray const &);
193 MapleStream & operator<<(MapleStream &, char const *);
195 MapleStream & operator<<(MapleStream &, char);
197 MapleStream & operator<<(MapleStream &, int);
208 explicit MaximaStream(std::ostream & os) : os_(os) {}
210 std::ostream & os() { return os_; }
218 MaximaStream & operator<<(MaximaStream &, MathAtom const &);
220 MaximaStream & operator<<(MaximaStream &, MathArray const &);
222 MaximaStream & operator<<(MaximaStream &, char const *);
224 MaximaStream & operator<<(MaximaStream &, char);
226 MaximaStream & operator<<(MaximaStream &, int);
234 class MathematicaStream {
237 explicit MathematicaStream(std::ostream & os) : os_(os) {}
239 std::ostream & os() { return os_; }
247 MathematicaStream & operator<<(MathematicaStream &, MathAtom const &);
249 MathematicaStream & operator<<(MathematicaStream &, MathArray const &);
251 MathematicaStream & operator<<(MathematicaStream &, char const *);
253 MathematicaStream & operator<<(MathematicaStream &, char);
255 MathematicaStream & operator<<(MathematicaStream &, int);
266 explicit OctaveStream(std::ostream & os) : os_(os) {}
268 std::ostream & os() { return os_; }
275 OctaveStream & operator<<(OctaveStream &, MathAtom const &);
277 OctaveStream & operator<<(OctaveStream &, MathArray const &);
279 OctaveStream & operator<<(OctaveStream &, char const *);
281 OctaveStream & operator<<(OctaveStream &, char);
283 OctaveStream & operator<<(OctaveStream &, int);