]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/formula.h
small cleanup, doxygen, formatting changes
[lyx.git] / src / mathed / formula.h
index b59728d7f882ceff9534dfff1806ca6b6e860693..aa350a3f853eb7336f4473ddeb657b33f3a2f000 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.
  *
 #pragma interface
 #endif
 
+#include <iosfwd>
+
 #include "insets/lyxinset.h"
-#include "support/LOstream.h"
 
 class MathParInset;
 class MathedCursor;
+class Buffer;
 
 ///
 class InsetFormula: public UpdatableInset {
 public:
        ///
+       explicit
        InsetFormula(bool display = false);
        ///
+       explicit
        InsetFormula(MathParInset *);
        ///
        ~InsetFormula();
        ///
-       int ascent(Painter &, LyXFont const &) const;
+       int ascent(BufferView *, LyXFont const &) const;
        ///
-       int descent(Painter &, LyXFont const &) const;
+       int descent(BufferView *, LyXFont const &) const;
        ///
-       int width(Painter &, LyXFont const &) const;
+       int width(BufferView *, LyXFont const &) const;
        ///
-       void draw(Painter &, LyXFont const &, int baseline, float & x) const;
+       void draw(BufferView *,LyXFont const &, int, float &, bool) const;
        ///
-       void Write(ostream &) const;
+       void Write(Buffer const *, std::ostream &) const;
        ///
-       void Read(LyXLex & lex);
+       void Read(Buffer const *, LyXLex & lex);
        ///
-       int Latex(ostream &, signed char fragile) const;
+       int Latex(Buffer const *, std::ostream &,
+                 bool fragile, bool free_spc) const;
        ///
-       int Latex(string & file, signed char fragile) const;
+       int Ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
-       int Linuxdoc(string & file) const;
+       int Linuxdoc(Buffer const *, std::ostream &) const;
        ///
-       int DocBook(string & file) const;
+       int DocBook(Buffer const *, std::ostream &) const;
        ///
        void Validate(LaTeXFeatures &) const;
        ///
-       Inset * Clone() const;
+       Inset * Clone(Buffer const &) const;
        ///
        Inset::Code LyxCode() const { return Inset::MATH_CODE; }
        ///
-       LyXFont ConvertFont(LyXFont font) {
+       LyXFont const ConvertFont(LyXFont const & f) const {
                // We have already discussed what was here
+               LyXFont font(f);
                font.setLatex(LyXFont::OFF);
                return font;
        }
 
        /// what appears in the minibuffer when opening
-       char const * EditMessage() const {return _("Math editor mode");}
+       string const EditMessage() const;
        ///
-       void Edit(int x, int y);
+       void Edit(BufferView *, int x, int y, unsigned int button);
        ///
        bool display() const { return (disp_flag) ? true: false; }
        ///
        void display(bool);
        ///
-       void ToggleInsetCursor();
+       void ToggleInsetCursor(BufferView *);
        ///
-       void ShowInsetCursor();
+       void ShowInsetCursor(BufferView *, bool show=true);
        ///
-       void HideInsetCursor();
+       void HideInsetCursor(BufferView *);
        ///
-       void GetCursorPos(int &, int &) const;
+       void GetCursorPos(BufferView *, int &, int &) const;
        ///
-       void ToggleInsetSelection();
+       void ToggleInsetSelection(BufferView * bv);
        ///
-       void InsetButtonPress(int x, int y, int button);
+       void InsetButtonPress(BufferView *, int x, int y, int button);
        ///
-       void InsetButtonRelease(int x, int y, int button);
+       void InsetButtonRelease(BufferView *, int x, int y, int button);
        ///
        void InsetKeyPress(XKeyEvent * ev);
        ///
-       void InsetMotionNotify(int x, int y, int state);
+       void InsetMotionNotify(BufferView *, int x, int y, int state);
        ///
-       void InsetUnlock();
+       void InsetUnlock(BufferView *);
    
        ///  To allow transparent use of math editing functions
-       virtual bool LocalDispatch(int, char const *);
+       virtual RESULT LocalDispatch(BufferView *, int, string const &);
     
        ///
-       void InsertSymbol(char const *);
+       void InsertSymbol(BufferView *, string const &);
        ///
        bool SetNumber(bool);
        ///
-       int GetNumberOfLabels() const;
-       ///
-       string getLabel(int) const;
+       std::vector<string> const getLabelList() const;
    
 protected:
-       void UpdateLocal();
+       ///
+       void UpdateLocal(BufferView * bv);
+       ///
        MathParInset * par;
-       static MathedCursor* mathcursor;
+       ///
+       static MathedCursor * mathcursor;
     
 private:
+       ///
        bool disp_flag;
+       ///
        string label;
 };
-
-
-// If a mathinset exist at cursor pos, just lock it.
-// Otherwise create a new one, and lock it.
-bool OpenMathInset(Buffer *);
-
 #endif