#pragma interface
#endif
-#include <iosfwd>
+#include "LString.h"
+#include "mathed/formulabase.h"
+#include "math_defs.h"
-#include "insets/lyxinset.h"
-
-class MathParInset;
-class MathedCursor;
-class Buffer;
+class MathMatrixInset;
///
-class InsetFormula: public UpdatableInset {
+class InsetFormula : public InsetFormulaBase {
public:
///
- explicit
- InsetFormula(bool display = false);
+ InsetFormula();
///
- explicit
- InsetFormula(MathParInset *);
+ explicit InsetFormula(MathInsetTypes);
///
- ~InsetFormula();
+ explicit InsetFormula(string const &);
///
int ascent(BufferView *, LyXFont const &) const;
///
///
int width(BufferView *, LyXFont const &) const;
///
- void draw(BufferView *,LyXFont const &, int, float &, bool) const;
+ void draw(BufferView *, LyXFont const &, int, float &, bool) const;
+
///
- void Write(Buffer const *, std::ostream &) const;
+ void write(std::ostream &) const;
///
- void Read(Buffer const *, LyXLex & lex);
+ void read(LyXLex & lex);
///
- int Latex(Buffer const *, std::ostream &,
+ int latex(std::ostream &,
bool fragile, bool free_spc) const;
///
- int Ascii(Buffer const *, std::ostream &) const;
- ///
- int Linuxdoc(Buffer const *, std::ostream &) const;
- ///
- int DocBook(Buffer const *, std::ostream &) const;
- ///
- void Validate(LaTeXFeatures &) const;
- ///
- Inset * Clone() const;
+ int ascii(std::ostream &, int linelen) const;
///
- Inset::Code LyxCode() const { return Inset::MATH_CODE; }
+ int linuxdoc(std::ostream &) const;
///
- LyXFont const ConvertFont(LyXFont const & f) const {
- // We have already discussed what was here
- LyXFont font(f);
- font.setLatex(LyXFont::OFF);
- return font;
- }
+ int docBook(std::ostream &) const;
- /// what appears in the minibuffer when opening
- string const EditMessage() const;
- ///
- void Edit(BufferView *, int x, int y, unsigned int button);
- ///
- bool display() const { return (disp_flag) ? true: false; }
- ///
- void display(bool);
- ///
- void ToggleInsetCursor(BufferView *);
- ///
- void ShowInsetCursor(BufferView *);
- ///
- void HideInsetCursor(BufferView *);
///
- void GetCursorPos(BufferView *, int &, int &) const;
+ Inset * clone(Buffer const &) const;
///
- void ToggleInsetSelection(BufferView * bv);
+ void validate(LaTeXFeatures & features) const;
///
- void InsetButtonPress(BufferView *, int x, int y, int button);
+ Inset::Code lyxCode() const;
///
- void InsetButtonRelease(BufferView *, int x, int y, int button);
- ///
- void InsetKeyPress(XKeyEvent * ev);
- ///
- void InsetMotionNotify(BufferView *, int x, int y, int state);
- ///
- void InsetUnlock(BufferView *);
-
- /// To allow transparent use of math editing functions
- virtual RESULT LocalDispatch(BufferView *, int, string const &);
-
- ///
- void InsertSymbol(BufferView *, string const &);
- ///
- bool SetNumber(bool);
+ virtual RESULT localDispatch(BufferView *, kb_action, string const &);
///
std::vector<string> const getLabelList() const;
-
-protected:
///
- void UpdateLocal(BufferView * bv);
+ void handleExtern(string const & arg, BufferView * bv);
///
- MathParInset * par;
+ MathMatrixInset * par() const;
///
- static MathedCursor * mathcursor;
-
-private:
+ bool display() const;
///
- bool disp_flag;
- ///
- string label;
+ bool ams() const;
+private:
+ /// 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