* Created: January 1996
* Description: Allows the edition of math paragraphs inside Lyx.
*
- * Copyright: (c) 1996, Alejandro Aguilar Sierra
+ * Copyright: 1996, Alejandro Aguilar Sierra
*
* Version: 0.4, Lyx project.
*
#pragma interface
#endif
-#include "insets/lyxinset.h"
-#include "support/LOstream.h"
+#include "mathed/formulabase.h"
+#include "math_defs.h"
-class MathParInset;
-class MathedCursor;
+class MathMatrixInset;
///
-class InsetFormula: public UpdatableInset {
+class InsetFormula : public InsetFormulaBase {
public:
///
- InsetFormula(bool display = false);
+ InsetFormula();
///
- InsetFormula(MathParInset *);
+ explicit InsetFormula(MathInsetTypes);
///
- ~InsetFormula();
+ explicit InsetFormula(string const &);
///
- int ascent(Painter &, LyXFont const &) const;
+ int ascent(BufferView *, LyXFont const &) const;
///
- int descent(Painter &, LyXFont const &) const;
+ int descent(BufferView *, LyXFont const &) const;
///
- int width(Painter &, LyXFont const &) const;
+ int width(BufferView *, LyXFont const &) const;
///
- void draw(Painter &, LyXFont const &, int baseline, float & x) const;
+ void draw(BufferView *, LyXFont const &, int, float &, bool) const;
///
- void Write(ostream &) const;
- ///
- void Read(LyXLex & lex);
- ///
- int Latex(ostream &, signed char fragile) const;
-#ifndef USE_OSTREAM_ONLY
- ///
- int Latex(string & file, signed char fragile) const;
- ///
- int Linuxdoc(string & file) const;
- ///
- int DocBook(string & file) const;
-#else
- ///
- int Linuxdoc(ostream &) const;
- ///
- int DocBook(ostream &) const;
-#endif
- ///
- void Validate(LaTeXFeatures &) const;
- ///
- Inset * Clone() const;
- ///
- Inset::Code LyxCode() const { return Inset::MATH_CODE; }
- ///
- LyXFont ConvertFont(LyXFont font) {
- // We have already discussed what was here
- font.setLatex(LyXFont::OFF);
- return font;
- }
+ void Metrics() const;
- /// what appears in the minibuffer when opening
- const char * EditMessage() const {return _("Math editor mode");}
- ///
- void Edit(BufferView *, int x, int y, unsigned int button);
///
- bool display() const { return (disp_flag) ? true: false; }
+ void write(std::ostream &) const;
///
- void display(bool);
+ void read(LyXLex & lex);
///
- void ToggleInsetCursor(BufferView *);
+ int latex(std::ostream &,
+ bool fragile, bool free_spc) const;
///
- void ShowInsetCursor(BufferView *);
+ int ascii(std::ostream &, int linelen) const;
///
- void HideInsetCursor(BufferView *);
+ int linuxdoc(std::ostream &) const;
///
- void GetCursorPos(int &, int &) const;
+ int docBook(std::ostream &) const;
+
///
- void ToggleInsetSelection(BufferView * bv);
+ Inset * clone(Buffer const &, bool same_id = false) const;
///
- void InsetButtonPress(BufferView *, int x, int y, int button);
+ void validate(LaTeXFeatures & features) const;
///
- void InsetButtonRelease(BufferView *, int x, int y, int button);
+ Inset::Code lyxCode() const;
///
- void InsetKeyPress(XKeyEvent * ev);
+ bool insetAllowed(Inset::Code code) const;
///
- void InsetMotionNotify(BufferView *, int x, int y, int state);
+ virtual RESULT localDispatch(BufferView *, kb_action, string const &);
///
- void InsetUnlock(BufferView *);
-
- /// To allow transparent use of math editing functions
- virtual RESULT LocalDispatch(BufferView *, int, string const &);
-
+ std::vector<string> const getLabelList() const;
///
- void InsertSymbol(BufferView *, char const *);
+ void handleExtern(string const & arg, BufferView * bv);
///
- bool SetNumber(bool);
+ MathMatrixInset * par() const;
///
- int GetNumberOfLabels() const;
+ bool display() const;
///
- string getLabel(int) const;
-
-protected:
- void UpdateLocal(BufferView * bv);
- MathParInset * par;
- static MathedCursor * mathcursor;
-
+ bool ams() const;
private:
- bool disp_flag;
- string label;
+ /// Safe setting of contents
+ void par(MathInset *);
};
-
-
-// If a mathinset exist at cursor pos, just lock it.
-// Otherwise create a new one, and lock it.
-bool OpenMathInset(Buffer *);
-
#endif