]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formulabase.h
architectural changes to tex2lyx
[lyx.git] / src / mathed / formulabase.h
index 1459c894a3b14bf30b2dc482ea6ad33858e1e853..2699af0ffa2dc2f6eb519f6389b6410f51cc5acd 100644 (file)
 #ifndef INSET_FORMULABASE_H
 #define INSET_FORMULABASE_H
 
-
 #include "insets/updatableinset.h"
-#include "frontends/mouse_state.h"
-#include "lyxfont.h"
+#include "dimension.h"
 
 #include <boost/weak_ptr.hpp>
 #include <iosfwd>
@@ -25,19 +23,12 @@ class Buffer;
 class BufferView;
 class MathAtom;
 
+
 /// An abstract base class for all math related LyX insets
 class InsetFormulaBase : public UpdatableInset {
 public:
        ///
        InsetFormulaBase();
-       ///
-       virtual int ascent(BufferView *, LyXFont const &) const = 0;
-       ///
-       virtual int descent(BufferView *, LyXFont const &) const = 0;
-       ///
-       virtual int width(BufferView *, LyXFont const &) const = 0;
-       ///
-       virtual void draw(BufferView *,LyXFont const &, int, float &) const = 0;
        /// lowest x coordinate
        virtual int xlow() const;
        /// highest x coordinate
@@ -53,25 +44,15 @@ public:
        // user-accessible way to override "false positives"
        virtual void validate(LaTeXFeatures &) const;
        ///
-       virtual Inset * clone(Buffer const &, bool same_id = false) const = 0;
-       ///
-       virtual Inset::Code lyxCode() const;
+       virtual InsetOld::Code lyxCode() const;
        /// what appears in the minibuffer when opening
        virtual string const editMessage() const;
        ///
-       virtual void edit(BufferView *, int x, int y, mouse_button::state button);
-       ///
-       virtual void edit(BufferView *, bool front = true);
-       ///
-       virtual void toggleInsetCursor(BufferView *);
-       ///
-       virtual void showInsetCursor(BufferView *, bool show = true);
-       ///
-       virtual void hideInsetCursor(BufferView *);
-       ///
        virtual void fitInsetCursor(BufferView *) const;
-       ///
+       /// FIXME
        virtual void getCursorPos(BufferView *, int &, int &) const;
+       /// get the absolute document x,y of the cursor
+       virtual void getCursor(BufferView & bv, int & x, int & y) const;
        ///
        virtual void toggleInsetSelection(BufferView * bv);
        ///
@@ -82,8 +63,6 @@ public:
        /// To allow transparent use of math editing functions
        //virtual void status(FuncRequest const &);
 
-       ///
-       virtual std::vector<string> const getLabelList() const;
        ///
        virtual MathAtom const & par() const = 0;
        ///
@@ -125,15 +104,10 @@ private:
 
 protected:
        ///
-       mutable boost::weak_ptr<BufferView> view_;
-       ///
-       mutable LyXFont font_;
+       //mutable boost::weak_ptr<BufferView> view_;
+       mutable BufferView * view_;
 
 protected:
-       ///
-       void metrics(BufferView * bv, LyXFont const & font) const;
-       ///
-       void metrics(BufferView * bv = 0) const;
        ///
        void handleFont(BufferView * bv, string const & arg, string const & font);