* 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.
*
* the GNU General Public Licence version 2 or later.
*/
-#ifndef _INSET_FORMULA_H
-#define _INSET_FORMULA_H
+#ifndef INSET_FORMULA_H
+#define INSET_FORMULA_H
#ifdef __GNUG__
#pragma interface
#endif
-#include "definitions.h"
-#include "insets/lyxinset.h"
+#include <iosfwd>
+#include "insets/lyxinset.h"
class MathParInset;
class MathedCursor;
+class Buffer;
///
class InsetFormula: public UpdatableInset {
public:
///
- InsetFormula(bool display=false);
+ explicit
+ InsetFormula(bool display = false);
///
- InsetFormula(MathParInset*);
+ explicit
+ InsetFormula(MathParInset *);
///
~InsetFormula();
///
- int Ascent(LyXFont const &font) const;
+ int ascent(BufferView *, LyXFont const &) const;
///
- int Descent(LyXFont const &font) const;
+ int descent(BufferView *, LyXFont const &) const;
///
- int Width(LyXFont const &font) const;
+ int width(BufferView *, LyXFont const &) const;
///
- void Draw(LyXFont font, LyXScreen &scr, int baseline, float &x);
+ void draw(BufferView *,LyXFont const &, int, float &, bool) const;
///
- void Write(FILE *file);
+ void Write(Buffer const *, std::ostream &) const;
///
- void Read(LyXLex &lex);
+ void Read(Buffer const *, LyXLex & lex);
///
- int Latex(FILE *file, signed char fragile);
+ int Latex(Buffer const *, std::ostream &,
+ bool fragile, bool free_spc) const;
///
- int Latex(string &file, signed char fragile);
+ int Ascii(Buffer const *, std::ostream &) const;
///
- int Linuxdoc(string &file);
+ int Linuxdoc(Buffer const *, std::ostream &) const;
///
- int DocBook(string &file);
+ int DocBook(Buffer const *, std::ostream &) const;
///
void Validate(LaTeXFeatures &) const;
///
- Inset* Clone();
+ Inset * Clone() const;
///
Inset::Code LyxCode() const { return Inset::MATH_CODE; }
///
}
/// what appears in the minibuffer when opening
- char const* EditMessage() {return _("Math editor mode");}
+ char 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; }
+ bool display() const { return (disp_flag) ? true: false; }
///
- void SetDisplay(bool);
+ void display(bool);
///
- void ToggleInsetCursor();
+ void ToggleInsetCursor(BufferView *);
///
- void ShowInsetCursor();
+ void ShowInsetCursor(BufferView *);
///
- void HideInsetCursor();
+ void HideInsetCursor(BufferView *);
///
- void GetCursorPos(int&, int&);
+ 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 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 *, char const *);
///
bool SetNumber(bool);
///
- int GetNumberOfLabels() const;
- ///
- string getLabel(int) const;
+ std::vector<string> getLabelList() const;
protected:
- void UpdateLocal();
- MathParInset* par;
- static MathedCursor* mathcursor;
+ ///
+ void UpdateLocal(BufferView * bv);
+ ///
+ MathParInset * par;
+ ///
+ static MathedCursor * mathcursor;
private:
+ ///
bool disp_flag;
- //char *label;
+ ///
string label;
};
bool OpenMathInset(Buffer *);
#endif
-