#pragma interface
#endif
-#include <iosfwd>
+#include "formulabase.h"
+#include "math_defs.h"
+#include "math_atom.h"
-#include "insets/lyxinset.h"
-
-class MathParInset;
-class MathedCursor;
+class MathHullInset;
///
-class InsetFormula: public UpdatableInset {
+class InsetFormula : public InsetFormulaBase {
public:
///
- InsetFormula(bool display = false);
- ///
- InsetFormula(MathParInset *);
- ///
- ~InsetFormula();
- ///
- int ascent(Painter &, LyXFont const &) const;
- ///
- int descent(Painter &, LyXFont const &) const;
- ///
- int width(Painter &, LyXFont const &) const;
- ///
- void draw(Painter &, LyXFont const &, int baseline, float & x) const;
- ///
- void Write(std::ostream &) const;
- ///
- void Read(LyXLex & lex);
- ///
- int Latex(std::ostream &, signed char fragile, bool free_spc) const;
+ InsetFormula();
///
- int Linuxdoc(std::ostream &) const;
+ explicit InsetFormula(MathInsetTypes);
///
- int DocBook(std::ostream &) const;
+ explicit InsetFormula(string const &);
///
- void Validate(LaTeXFeatures &) const;
+ int ascent(BufferView *, LyXFont const &) const;
///
- Inset * Clone() const;
+ int descent(BufferView *, LyXFont const &) const;
///
- Inset::Code LyxCode() const { return Inset::MATH_CODE; }
+ int width(BufferView *, LyXFont const &) const;
///
- LyXFont ConvertFont(LyXFont font) {
- // We have already discussed what was here
- font.setLatex(LyXFont::OFF);
- return font;
- }
+ void draw(BufferView *, LyXFont const &, int, float &, bool) const;
- /// what appears in the minibuffer when opening
- char const * EditMessage() const;
///
- void Edit(BufferView *, int x, int y, unsigned int button);
+ void write(Buffer const *, std::ostream &) const;
///
- bool display() const { return (disp_flag) ? true: false; }
+ void read(Buffer const *, LyXLex & lex);
///
- void display(bool);
+ int latex(Buffer const *, std::ostream &, bool fragile, bool free_spc) const;
///
- void ToggleInsetCursor(BufferView *);
+ int ascii(Buffer const *, std::ostream &, int linelen) const;
///
- void ShowInsetCursor(BufferView *);
+ int linuxdoc(Buffer const *, std::ostream &) const;
///
- void HideInsetCursor(BufferView *);
- ///
- void GetCursorPos(int &, int &) const;
- ///
- void ToggleInsetSelection(BufferView * bv);
+ int docbook(Buffer const *, std::ostream &) const;
+
///
- void InsetButtonPress(BufferView *, int x, int y, int button);
+ Inset * clone(Buffer const &, bool same_id = false) const;
///
- void InsetButtonRelease(BufferView *, int x, int y, int button);
+ void validate(LaTeXFeatures & features) const;
///
- void InsetKeyPress(XKeyEvent * ev);
+ Inset::Code lyxCode() const;
///
- void InsetMotionNotify(BufferView *, int x, int y, int state);
+ bool insetAllowed(Inset::Code code) const;
///
- void InsetUnlock(BufferView *);
-
- /// To allow transparent use of math editing functions
- virtual RESULT LocalDispatch(BufferView *, int, string const &);
-
+ virtual RESULT localDispatch(BufferView *, kb_action, string const &);
///
- void InsertSymbol(BufferView *, char const *);
+ std::vector<string> const getLabelList() const;
///
- bool SetNumber(bool);
+ MathInsetTypes getType() const;
///
- int GetNumberOfLabels() const;
+ MathAtom const & par() const { return par_; }
///
- string getLabel(int) const;
-
-protected:
- void UpdateLocal(BufferView * bv);
- MathParInset * par;
- static MathedCursor * mathcursor;
-
-private:
- bool disp_flag;
- string label;
-};
+ MathAtom & par() { return par_; }
+private:
+ /// Is this a displayed environment?
+ bool display() const;
+ /// available in AMS only?
+ bool ams() const;
+ /// access to hull
+ MathHullInset * hull();
+ /// access to hull
+ MathHullInset const * hull() const;
+ ///
+ void handleExtern(string const & arg);
-// If a mathinset exist at cursor pos, just lock it.
-// Otherwise create a new one, and lock it.
-bool OpenMathInset(Buffer *);
-
+ ///
+ MathAtom par_;
+};
#endif