]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formula.h
enable direct input of #1...#9; some whitespace changes
[lyx.git] / src / mathed / formula.h
index aa350a3f853eb7336f4473ddeb657b33f3a2f000..dd2ec650ca9681c51f167c00d8175b281d59fb5d 100644 (file)
 #pragma interface
 #endif
 
-#include <iosfwd>
+#include "formulabase.h"
+#include "math_defs.h"
+#include "math_atom.h"
 
-#include "insets/lyxinset.h"
-
-class MathParInset;
-class MathedCursor;
-class Buffer;
+class MathHullInset;
 
 ///
-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;
        ///
@@ -47,85 +43,53 @@ public:
        ///
        int width(BufferView *, LyXFont const &) const;
        ///
-       void draw(BufferView *,LyXFont const &, int, float &, bool) const;
-       ///
-       void Write(Buffer const *, std::ostream &) const;
-       ///
-       void Read(Buffer const *, LyXLex & lex);
-       ///
-       int Latex(Buffer const *, std::ostream &,
-                 bool fragile, bool free_spc) const;
-       ///
-       int Ascii(Buffer const *, std::ostream &, int linelen) const;
-       ///
-       int Linuxdoc(Buffer const *, std::ostream &) const;
-       ///
-       int DocBook(Buffer const *, std::ostream &) const;
-       ///
-       void Validate(LaTeXFeatures &) const;
-       ///
-       Inset * Clone(Buffer const &) const;
-       ///
-       Inset::Code LyxCode() const { return Inset::MATH_CODE; }
-       ///
-       LyXFont const ConvertFont(LyXFont const & f) const {
-               // We have already discussed what was here
-               LyXFont font(f);
-               font.setLatex(LyXFont::OFF);
-               return font;
-       }
+       void draw(BufferView *, LyXFont const &, int, float &, bool) 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 *, bool show=true);
+       void write(Buffer const *, std::ostream &) const;
        ///
-       void HideInsetCursor(BufferView *);
+       void read(Buffer const *, LyXLex & lex);
        ///
-       void GetCursorPos(BufferView *, int &, int &) const;
+       int latex(Buffer const *, std::ostream &, bool fragile, bool free_spc) const;
        ///
-       void ToggleInsetSelection(BufferView * bv);
+       int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
-       void InsetButtonPress(BufferView *, int x, int y, int button);
+       int linuxdoc(Buffer const *, std::ostream &) const;
        ///
-       void InsetButtonRelease(BufferView *, int x, int y, int button);
+       int docbook(Buffer const *, std::ostream &) const;
+
        ///
-       void InsetKeyPress(XKeyEvent * ev);
+       Inset * clone(Buffer const &, bool same_id = false) const;
        ///
-       void InsetMotionNotify(BufferView *, int x, int y, int state);
+       void validate(LaTeXFeatures & features) const;
        ///
-       void InsetUnlock(BufferView *);
-   
-       ///  To allow transparent use of math editing functions
-       virtual RESULT LocalDispatch(BufferView *, int, string const &);
-    
+       Inset::Code lyxCode() const;
        ///
-       void InsertSymbol(BufferView *, string const &);
+       bool insetAllowed(Inset::Code code) const;
        ///
-       bool SetNumber(bool);
+       virtual RESULT localDispatch(BufferView *, kb_action, string const &);
        ///
        std::vector<string> const getLabelList() const;
-   
-protected:
        ///
-       void UpdateLocal(BufferView * bv);
+       MathInsetTypes getType() const;
        ///
-       MathParInset * par;
+       MathAtom const & par() const { return par_; }
        ///
-       static MathedCursor * mathcursor;
-    
+       MathAtom & par() { return par_; }
+
 private:
+       /// Is this a displayed environment?
+       bool display() const;
+       /// available in AMS only?
+       bool ams() const;
+       /// access to hull
+       MathHullInset * hull();
+       /// access to hull
+       MathHullInset const * hull() const;
+       ///
+       void handleExtern(string const & arg);
+
        ///
-       bool disp_flag;
-       ///
-       string label;
+       MathAtom par_;
 };
 #endif