4 * Purpose: Declaration of insets for mathed
5 * Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
6 * Created: January 1996
7 * Description: Math paragraph and objects for a WYSIWYG math editor.
9 * Dependencies: Xlib, XForms
11 * Copyright: 1996, 1997 Alejandro Aguilar Sierra
13 * Version: 0.8beta, Mathed & Lyx project.
15 * You are free to use and modify this code under the terms of
16 * the GNU General Public Licence version 2 or later.
19 // Note: These math insets are internal to Mathed and are not derived
30 #include "symbol_def.h"
34 /** Abstract base class for all math objects.
35 A math insets is for use of the math editor only, it isn't a
36 general LyX inset. It's used to represent all the math objects.
37 The formulaInset (a LyX inset) encapsulates a math inset.
41 /** A math inset has a name (usually its LaTeX name),
44 MathedInset(string const & nm, short ot, short st);
47 MathedInset(MathedInset *);
49 virtual ~MathedInset() {}
51 virtual void draw(Painter &, int x, int baseline) = 0;
52 /// Write LaTeX and Lyx code
53 virtual void Write(std::ostream &, bool fragile) = 0;
55 virtual MathedInset * Clone() = 0;
56 /// Compute the size of the object
57 virtual void Metrics() = 0;
59 virtual int Ascent() const;
61 virtual int Descent() const;
63 virtual int Width() const;
65 virtual int Height() const;
67 virtual bool GetLimits() const;
69 virtual void SetLimits(bool);
71 string const & GetName() const;
73 short GetType() const;
75 short GetStyle() const;
76 //Man: Avoid to use these functions if it's not strictly necessary
78 virtual void SetType(short t);
80 virtual void SetStyle(short st);
82 virtual void SetName(string const & n);
86 static void defaultAscent(int da);
88 static void defaultDescent(int dd);
90 static void defaultWidth(int dw);
112 /// In a near future maybe we use a better fonts renderer than X
113 void drawStr(Painter &, short, int, int, int, string const &);