]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathUnknown.h
Better fix for bug #8679
[lyx.git] / src / mathed / InsetMathUnknown.h
1 // -*- C++ -*-
2 /**
3  * \file InsetMathUnknown.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author André Pönitz
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef MATH_UNKNOWNINSET_H
13 #define MATH_UNKNOWNINSET_H
14
15 #include "InsetMath.h"
16
17 #include "support/docstring.h"
18
19
20 namespace lyx {
21
22 /// LaTeX names for objects that we really don't know
23 class InsetMathUnknown : public InsetMath {
24 public:
25         ///
26         explicit InsetMathUnknown(docstring const & name,
27                 docstring const & selection = docstring(),
28                 bool final = true, bool black = false);
29         ///
30         void metrics(MetricsInfo & mi, Dimension & dim) const;
31         ///
32         void draw(PainterInfo & pi, int x, int y) const;
33         ///
34         void setName(docstring const & name);
35         ///
36         docstring name() const;
37
38         ///
39         docstring const & selection() const { return selection_; }
40         
41         /// identifies UnknownInsets
42         InsetMathUnknown const * asUnknownInset() const { return this; }
43         /// identifies UnknownInsets
44         InsetMathUnknown * asUnknownInset() { return this; }
45
46         ///
47         void normalize(NormalStream &) const;
48         ///
49         void maple(MapleStream &) const;
50         ///
51         void mathematica(MathematicaStream &) const;
52         ///
53         void mathmlize(MathStream &) const;
54         ///
55         void htmlize(HtmlStream &) const;
56         ///
57         void octave(OctaveStream &) const;
58         ///
59         void finalize();
60         ///
61         bool final() const;
62         ///
63         int kerning(BufferView const *) const { return kerning_; }
64         ///
65         InsetCode lyxCode() const { return MATH_UNKNOWN_CODE; }
66
67 private:
68         ///
69         Inset * clone() const { return new InsetMathUnknown(*this); }
70
71         ///
72         docstring name_;
73         /// are we finished creating the name?
74         bool final_;
75         ///
76         bool black_;
77         ///
78         mutable int kerning_;
79         /// the selection which was replaced by this
80         docstring selection_;
81 };
82
83 } // namespace lyx
84
85 #endif