4 * Purpose: Declaration of interaction classes for mathed
5 * Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
6 * Created: January 1996
7 * Description: MathCursor control all user interaction
9 * Dependencies: Xlib, XForms
11 * Copyright: 1996, 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.
26 #include "math_xiter.h"
33 /// This is the external interface of Mathed's subkernel
38 MathedCursor(MathParInset * p);
40 void Insert(byte, MathedTextCodes t = LM_TC_MIN);
42 void insertInset(MathedInset *, int t);
48 bool Right(bool sel = false);
50 bool Left(bool sel = false);
52 bool Up(bool sel = false);
54 bool Down(bool sel = false);
59 /// Pull out an argument from its container inset
62 void draw(Painter &, int x, int y);
64 void Redraw(Painter &);
70 void SetPos(int, int);
72 void GetPos(int & x, int & y);
76 MathParInset * GetPar();
78 MathParInset * getCurrentPar() const;
80 void SetCursorData(MathParInset *);
82 void SetPar(MathParInset *);
84 void Interpret(string const &);
90 void setLabel(string const &);
92 string const & getLabel() const;
95 /// Set accent: if argument = 0 it's considered consumed
96 void setAccent(int ac = 0);
97 /// Returns last accent
98 int getAccent() const;
101 // Macro mode methods
103 void MacroModeOpen();
105 void MacroModeClose();
109 // Local selection methods
127 void SelGetArea(int ** xp, int ** yp, int & n);
129 void clearLastCode();
131 void setLastCode(MathedTextCodes t);
133 void toggleLastCode(MathedTextCodes t);
135 MathedTextCodes getLastCode() const;
137 /// true iff cursor points to data
138 bool hasData(MathedArray const &);
152 MathedXIter * anchor;
156 MathedXIter * cursor;
158 void doAccent(byte c, MathedTextCodes t);
160 void doAccent(MathedInset * p);
166 MathedTextCodes lastcode;
170 MathFuncInset * imacro;