]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formula.h
mathed95.diff
[lyx.git] / src / mathed / formula.h
index f24bcaa2197214ee5f8502232e411f0406068975..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.
  *
  *   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 "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(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);
-       ///
-       void Read(LyXLex &lex);
+       InsetFormula();
        ///
-       int Latex(FILE *file, signed char fragile);
+       explicit InsetFormula(MathInsetTypes);
        ///
-       int Latex(string &file, signed char fragile);
+       explicit InsetFormula(string const &);
        ///
-       int Linuxdoc(string &file);
+       int ascent(BufferView *, LyXFont const &) const;
        ///
-       int DocBook(string &file);
+       int descent(BufferView *, LyXFont const &) const;
        ///
-       void Validate(LaTeXFeatures &) const;
+       int width(BufferView *, LyXFont const &) 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 draw(BufferView *, LyXFont const &, int, float &, bool) const;
 
-       /// what appears in the minibuffer when opening
-       char const* EditMessage() {return _("Math editor mode");}
-       ///
-       void Edit(int x, int y);
        ///
-       bool Display() const { return (disp_flag) ? true: false; }
+       void write(std::ostream &) const;
        ///
-       void SetDisplay(bool);
+       void read(LyXLex & lex);
        ///
-       void ToggleInsetCursor();
+       int latex(std::ostream &,
+                 bool fragile, bool free_spc) const;
        ///
-       void ShowInsetCursor();
+       int ascii(std::ostream &, int linelen) const;
        ///
-       void HideInsetCursor();
+       int linuxdoc(std::ostream &) const;
        ///
-       void GetCursorPos(int&, int&);
-       ///
-       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;
-       //char *label;
-       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
-