]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formula.h
mathed95.diff
[lyx.git] / src / mathed / formula.h
index 89919d528887359eb8d4e2243efc7aa4bf4baa69..eb629c90e11c852e60b2c1ac42c043c360685ce9 100644 (file)
 #pragma interface
 #endif
 
-#include <iosfwd>
+#include "LString.h"
+#include "mathed/formulabase.h"
+#include "math_defs.h"
 
-#include "insets/lyxinset.h"
-#include <boost/smart_ptr.hpp>
-
-class MathParInset;
-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;
        ///
@@ -47,102 +43,42 @@ public:
        ///
        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 &, 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;
-       ///
-       LyXFont const ConvertFont(LyXFont const & f) 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;
-       ///
-       void display(bool);
-       ///
-       void ToggleInsetCursor(BufferView *);
-       ///
-       void ShowInsetCursor(BufferView *, bool show = true);
+       int ascii(std::ostream &, int linelen) const;
        ///
-       void HideInsetCursor(BufferView *);
+       int linuxdoc(std::ostream &) const;
        ///
-       void GetCursorPos(BufferView *, int &, int &) const;
-       ///
-       void ToggleInsetSelection(BufferView * bv);
-       ///
-       void InsetButtonPress(BufferView *, int x, int y, int button);
-       ///
-       void InsetButtonRelease(BufferView *, int x, int y, int button);
-       ///
-       void InsetKeyPress(XKeyEvent * ev);
+       int docBook(std::ostream &) const;
+
        ///
-       void InsetMotionNotify(BufferView *, int x, int y, int state);
+       Inset * clone(Buffer const &) const;
        ///
-       void InsetUnlock(BufferView *);
-   
-       ///  To allow transparent use of math editing functions
-       virtual RESULT LocalDispatch(BufferView *, kb_action, string const &);
-    
+       void validate(LaTeXFeatures & features) const;
        ///
-       void InsertSymbol(BufferView *, string const &);
+       Inset::Code lyxCode() const;
        ///
-       bool SetNumber(bool);
+       virtual RESULT localDispatch(BufferView *, kb_action, string const &);
        ///
        std::vector<string> const getLabelList() const;
        ///
-       void HandleExtern(string const & arg, BufferView * bv);
-   
-protected:
+       void handleExtern(string const & arg, BufferView * bv);
        ///
-       void UpdateLocal(BufferView * bv);
+       MathMatrixInset * par() const;
        ///
-       //boost::shared_ptr<MathParInset> par;
-       MathParInset * par;
-    
-private:
+       bool display() const;
        ///
-       bool disp_flag_;
+       bool ams() const;
+private:
+       /// Safe setting of contents
+       void par(MathInset *);
 };
-
-
-inline
-Inset::Code InsetFormula::LyxCode() const
-{
-       return Inset::MATH_CODE;
-}
-
-
-inline
-LyXFont const InsetFormula::ConvertFont(LyXFont const & f) const
-{
-       // We have already discussed what was here
-       LyXFont font(f);
-       font.setLatex(LyXFont::OFF);
-       return font;
-}
-
-
-inline
-bool InsetFormula::display() const
-{
-       return disp_flag_;
-}
 #endif