]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formulabase.h
rename commandtags.h to lfuns.h and renumber/cleanup. Rebuild the tree !
[lyx.git] / src / mathed / formulabase.h
index 6654a8bfeb5c2b5fe9e6ba7e967e54023116b89c..1459c894a3b14bf30b2dc482ea6ad33858e1e853 100644 (file)
@@ -1,25 +1,20 @@
 // -*- C++ -*-
+
 /*
- *  File:        formulabase.h
- *  Purpose:     Common parts of the math LyX insets
- *  Author:      André Pönitz
- *  Created:     May 2001
- *  Description: Allows the edition of math paragraphs inside Lyx.
+ * Common parts of the math LyX insets
+ * \author  André Pönitz
  *
- *  Copyright: 2001, The LyX Project
+ * Full author contact details are available in file CREDITS
  *
- *   You are free to use and modify this code under the terms of
- *   the GNU General Public Licence version 2 or later.
+ * You are free to use and modify this code under the terms of
+ * the GNU General Public Licence version 2 or later.
  */
 
 #ifndef INSET_FORMULABASE_H
 #define INSET_FORMULABASE_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
 
-#include "insets/inset.h"
+#include "insets/updatableinset.h"
 #include "frontends/mouse_state.h"
 #include "lyxfont.h"
 
@@ -42,7 +37,7 @@ public:
        ///
        virtual int width(BufferView *, LyXFont const &) const = 0;
        ///
-       virtual void draw(BufferView *,LyXFont const &, int, float &, bool) const = 0;
+       virtual void draw(BufferView *,LyXFont const &, int, float &) const = 0;
        /// lowest x coordinate
        virtual int xlow() const;
        /// highest x coordinate
@@ -54,6 +49,8 @@ public:
 
 public:
        ///
+       // Don't use this for AMS validation as long as there is no
+       // user-accessible way to override "false positives"
        virtual void validate(LaTeXFeatures &) const;
        ///
        virtual Inset * clone(Buffer const &, bool same_id = false) const = 0;
@@ -81,7 +78,7 @@ public:
        virtual void insetUnlock(BufferView *);
 
        /// To allow transparent use of math editing functions
-       virtual RESULT localDispatch(FuncRequest const &);
+       virtual dispatch_result localDispatch(FuncRequest const &);
        /// To allow transparent use of math editing functions
        //virtual void status(FuncRequest const &);
 
@@ -92,16 +89,15 @@ public:
        ///
        virtual MathAtom & par() = 0;
        ///
-       virtual void updateLocal(BufferView * bv, bool mark_dirty);
-       ///
-       BufferView * view() const { return view_.get(); }
+       // And shouldn't this really return a shared_ptr<BufferView> instead?
+       BufferView * view() const;
 
        ///
        virtual bool searchForward(BufferView *, string const &,
-                                  bool = true, bool = false);
+                                  bool = true, bool = false);
        ///
        virtual bool searchBackward(BufferView *, string const &,
-                                   bool = true, bool = false);
+                                   bool = true, bool = false);
        ///
        virtual bool isTextInset() const { return true; }
        ///
@@ -112,18 +108,20 @@ public:
        virtual EDITABLE editable() const { return HIGHLY_EDITABLE; }
        ///
        bool display() const;
+       // return the selection as string
+       string selectionAsString() const;
 
 private:
        /// unimplemented
        void operator=(const InsetFormulaBase &);
        /// common base for handling accents
        void handleAccent(BufferView * bv, string const & arg, string const & name);
-       /// lfun handler 
-       RESULT lfunMousePress(FuncRequest const &);
+       /// lfun handler
+       dispatch_result lfunMousePress(FuncRequest const &);
        ///
-       RESULT lfunMouseRelease(FuncRequest const &);
+       dispatch_result lfunMouseRelease(FuncRequest const &);
        ///
-       RESULT lfunMouseMotion(FuncRequest const &);
+       dispatch_result lfunMouseMotion(FuncRequest const &);
 
 protected:
        ///
@@ -149,4 +147,7 @@ protected:
 // So do it here.
 void mathDispatch(FuncRequest const &);
 
+///
+void releaseMathCursor(BufferView * bv);
+
 #endif