#endif
#include "lyxinset.h"
-#include "table.h"
+#include "tabular.h"
#include "LString.h"
+#include "lyxcursor.h"
class LyXLex;
class Painter;
class BufferView;
class Buffer;
-class TexRow;
class InsetTabular : public UpdatableInset {
public:
///
~InsetTabular();
///
- InsetTabular * InsetTabular::Clone() const;
+ Inset * Clone() const;
///
void Read(LyXLex &);
///
///
void InsetUnlock(BufferView *);
///
- bool LockInsetInInset(UpdatableInset *);
+ void UpdateLocal(BufferView *, bool flag = true);
///
- bool UnlockInsetInInset(BufferView *, UpdatableInset *, bool lr=false);
+ bool LockInsetInInset(BufferView *, UpdatableInset *);
///
- void UpdateLocal(BufferView *, bool flag = true);
+ bool UnlockInsetInInset(BufferView *, UpdatableInset *, bool lr=false);
///
bool UpdateInsetInInset(BufferView *, Inset *);
///
- bool display() const { return tabular->IsLongTable(); }
+ int InsetInInsetY();
+ ///
+ bool display() const { return tabular->IsLongTabular(); }
///
void InsetButtonRelease(BufferView *, int, int, int);
///
///
int Latex(std::ostream &, bool, bool) const;
///
+ int Ascii(std::ostream &) const;
+ ///
int Linuxdoc(std::ostream &) const;
///
int DocBook(std::ostream &) const;
///
Inset::Code LyxCode() const { return Inset::TABULAR_CODE; }
///
- void GetCursorPos(int & x, int & y);
+ void GetCursorPos(int & x, int & y) const;
///
void ToggleInsetCursor(BufferView *);
///
- void TableFeatures(int feature, string val="");
+ void TabularFeatures(int feature, string val="");
///
int GetActCell() { return actcell; }
///
- void SetFont(LyXFont const &);
+ void SetFont(BufferView *, LyXFont const &, bool toggleall = false);
///
/// Public structures and variables
///
- LyXTable * tabular;
+ LyXTabular * tabular;
private:
void calculate_width_of_cells(Painter &, LyXFont const &) const;
///
- void DrawCellLines(Painter &, int x, int baseline, int row, int cell);
+ void DrawCellLines(Painter &, int x, int baseline, int row, int cell) const;
///
void ShowInsetCursor(BufferView *);
///
void HideInsetCursor(BufferView *);
///
- void setPos(int x, int y, bool activate_inset=true);
+ void setPos(Painter &, int x, int y) const;
///
- void setWidthOfCell(int pos, int cell, int row);
+ bool SetCellDimensions(Painter & pain, int cell, int row);
///
- bool moveRight(bool activate_inset=true);
- bool moveLeft(bool activate_inset=true);
- bool moveUp(bool activate_inset=true);
- bool moveDown(bool activate_inset=true);
+ UpdatableInset::RESULT moveRight(BufferView *, bool lock=true);
+ UpdatableInset::RESULT moveLeft(BufferView *, bool lock=true);
+ UpdatableInset::RESULT moveUp();
+ UpdatableInset::RESULT moveDown();
bool moveNextCell();
bool movePrevCell();
bool Delete();
///
- void resetPos();
+ void resetPos(Painter &) const;
///
- void RemoveTableRow();
+ void RemoveTabularRow();
///
bool hasCharSelection() const {return (sel_pos_start != sel_pos_end);}
bool hasCellSelection() const {return hasCharSelection() &&
(sel_cell_start != sel_cell_end);}
+ ///
+ bool ActivateCellInset(BufferView *, int x=0, int y=0, int button=0);
+ ///
+ bool InsetHit(BufferView * bv, int x, int y) const;
+
///
/// Private structures and variables
///
- UpdatableInset
+ InsetText
* the_locking_inset;
Buffer
* buffer;
- int
+ mutable LyXCursor
+ cursor,
+ old_cursor;
+ mutable int
inset_pos,
inset_x, inset_y,
sel_pos_start,
sel_pos_end,
sel_cell_start,
sel_cell_end,
- old_x,
- cx, cy,
- actpos,
actcell,
actcol,
actrow;