]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formula.h
fix pullArg when pressing <Delete> at the end of an cell
[lyx.git] / src / mathed / formula.h
index 4526e2a4e5f61aca252fb7fba3d1444e6be2a62b..b98c7ef8dc08649933c1c6cb03e24c32f7275c5a 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.
  *
  *   the GNU General Public Licence version 2 or later.
  */
 
-#ifndef _INSET_FORMULA_H 
-#define _INSET_FORMULA_H
+#ifndef INSET_FORMULA_H 
+#define INSET_FORMULA_H
 
 #ifdef __GNUG__
 #pragma interface
 #endif
 
-#include "definitions.h"
-#include "insets/lyxinset.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(MathParInset*);
-       ///
-       ~InsetFormula();
-       ///
-       int Ascent(LyXFont const &font) const;
-       ///
-       int Descent(LyXFont const &font) const;
-       ///
-       int Width(LyXFont const &font) const;
-       ///
-       void Draw(LyXFont font, LyXScreen &scr, int baseline, float &x);
-       ///
-       void Write(FILE *file);
+       InsetFormula();
        ///
-       void Read(LyXLex &lex);
+       explicit InsetFormula(MathInsetTypes);
        ///
-       int Latex(FILE *file, signed char fragile);
+       explicit InsetFormula(string const &);
        ///
-       int Latex(LString &file, signed char fragile);
+       int ascent(BufferView *, LyXFont const &) const;
        ///
-       int Linuxdoc(LString &file);
+       int descent(BufferView *, LyXFont const &) const;
        ///
-       int DocBook(LString &file);
+       int width(BufferView *, LyXFont const &) const;
        ///
-       void Validate(LaTeXFeatures &) const;
+       void draw(BufferView *, LyXFont const &, int, float &, bool) const;
        ///
-       Inset* Clone();
-       ///
-       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
-       char const* EditMessage() {return _("Math editor mode");}
        ///
-       void Edit(int x, int y);
+       void write(std::ostream &) const;
        ///
-       bool Display() const { return (disp_flag) ? true: false; }
+       void read(LyXLex & lex);
        ///
-       void SetDisplay(bool);
+       int latex(std::ostream &,
+                 bool fragile, bool free_spc) const;
        ///
-       void ToggleInsetCursor();
+       int ascii(std::ostream &, int linelen) const;
        ///
-       void ShowInsetCursor();
+       int linuxdoc(std::ostream &) const;
        ///
-       void HideInsetCursor();
-       ///
-       void GetCursorPos(int&, int&);
+       int docBook(std::ostream &) const;
+
        ///
-       void ToggleInsetSelection();
+       Inset * clone(Buffer const &, bool same_id = false) const;
        ///
-       void InsetButtonPress(int x, int y, int button);
+       void validate(LaTeXFeatures & features) const;
        ///
-       void InsetButtonRelease(int x, int y, int button);
+       Inset::Code lyxCode() const;
        ///
-       void InsetKeyPress(XKeyEvent *ev);
+       bool insetAllowed(Inset::Code code) 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;
        ///
-       LString getLabel(int) const;
-   
-protected:
-       void UpdateLocal();
-       MathParInset* par;
-       static MathedCursor* mathcursor;
-    
+       bool ams() const;
 private:
-       bool disp_flag;
-       //char *label;
-       LString 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
-