]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formula.h
mathed95.diff
[lyx.git] / src / mathed / formula.h
index b59728d7f882ceff9534dfff1806ca6b6e860693..eb629c90e11c852e60b2c1ac42c043c360685ce9 100644 (file)
@@ -6,7 +6,7 @@
  *  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 "LString.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 Write(ostream &) const;
-       ///
-       void Read(LyXLex & lex);
-       ///
-       int Latex(ostream &, signed char fragile) const;
-       ///
-       int Latex(string & file, signed char fragile) const;
-       ///
-       int Linuxdoc(string & file) const;
-       ///
-       int DocBook(string & file) const;
-       ///
-       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 draw(BufferView *, LyXFont const &, int, float &, bool) const;
 
-       /// what appears in the minibuffer when opening
-       char const * EditMessage() const {return _("Math editor mode");}
-       ///
-       void Edit(int x, int y);
-       ///
-       bool display() const { return (disp_flag) ? true: false; }
        ///
-       void display(bool);
+       void write(std::ostream &) const;
        ///
-       void ToggleInsetCursor();
+       void read(LyXLex & lex);
        ///
-       void ShowInsetCursor();
+       int latex(std::ostream &,
+                 bool fragile, bool free_spc) const;
        ///
-       void HideInsetCursor();
+       int ascii(std::ostream &, int linelen) const;
        ///
-       void GetCursorPos(int &, int &) const;
+       int linuxdoc(std::ostream &) const;
        ///
-       void ToggleInsetSelection();
+       int docBook(std::ostream &) const;
+
        ///
-       void InsetButtonPress(int x, int y, int button);
+       Inset * clone(Buffer const &) const;
        ///
-       void InsetButtonRelease(int x, int y, int button);
+       void validate(LaTeXFeatures & features) const;
        ///
-       void InsetKeyPress(XKeyEvent * ev);
+       Inset::Code lyxCode() const;
        ///
-       void InsetMotionNotify(int x, int y, int state);
+       virtual RESULT localDispatch(BufferView *, kb_action, string const &);
        ///
-       void InsetUnlock();
-   
-       ///  To allow transparent use of math editing functions
-       virtual bool LocalDispatch(int, char const *);
-    
+       std::vector<string> const getLabelList() const;
        ///
-       void InsertSymbol(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();
-       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