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.
17 Wrapper for InsetMath * with copy-semantics
21 The 'atom' is the major blob in math typesetting. And 'atom' consists
22 of a nucleus, an optional superscript, and an optional subscript.
24 Exactly where the subscript and superscript are drawn depends on the
25 size, and type, of the nucleus they are attached to.
31 Ok: Implementing it thusly is not feasible since cursor movement gets
32 hackish. We use MathAtom only as a wrapper around InsetMath * with value
35 The MathAtom owns the InsetMath * and is responsible for proper cloning and
36 destruction. Every InsetMath * should be put into a MathAtom after its
37 creation as soon as possible.
43 #include "support/unique_ptr.h"
53 MathAtom(MathAtom &&) = default;
54 MathAtom & operator=(MathAtom &&) = default;
55 /// the "real constructor"
56 explicit MathAtom(InsetMath * p);
57 /// copy constructor, invokes clone()
58 MathAtom(MathAtom const &);
59 MathAtom & operator=(MathAtom const &);
60 /// access to the inset
61 InsetMath * nucleus() { return nucleus_.get(); }
62 InsetMath const * nucleus() const { return nucleus_.get(); }
63 InsetMath * operator->() { return nucleus_.get(); }
64 InsetMath const * operator->() const { return nucleus_.get(); }
66 std::unique_ptr<InsetMath> nucleus_;