// -*- C++ -*-
+/**
+ * \file math_atom.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
#ifndef MATH_ATOM_H
#define MATH_ATOM_H
-#ifdef __GNUG__
-#pragma interface
-#endif
/**
+Wrapper for MathInset * with copy-semantics
+
+--
+
The 'atom' is the major blob in math typesetting. And 'atom' consists
of a nucleus, an optional superscript, and an optional subscript.
*/
+class InsetBase;
class MathInset;
class MathAtom {
// std::containers
MathAtom();
/// the "real constructor"
- explicit MathAtom(MathInset * p);
+ explicit MathAtom(InsetBase * p);
/// copy constructor, invokes nucleus_->clone()
MathAtom(MathAtom const &);
/// we really need to clean up
~MathAtom();
/// assignment invokes nucleus_->clone()
void operator=(MathAtom const &);
- /// change inset under the hood
- void operator=(MathInset * p);
- /// change inset under the hood
- void reset(MathInset * p);
/// access to the inset (checked with gprof)
- MathInset const * nucleus() const { return nucleus_; }
MathInset * nucleus() { return nucleus_; }
/// access to the inset
- MathInset * operator->() const { return nucleus_; }
+ MathInset const * operator->() const { return nucleus_; }
+
+ /// width cache. Not nice...
+ mutable int width_;
private:
///