#include "LString.h"
#include "lyxcursor.h"
#include "lyxfunc.h"
+#include <sigc++/signal_system.h>
+
+#ifdef SIGC_CXX_NAMESPACES
+using SigC::Signal0;
+#endif
class LyXLex;
class Painter;
class BufferView;
class Buffer;
-class Dialogs;
class InsetTabular : public UpdatableInset {
public:
///
enum UpdateCodes {
NONE = 0,
- INIT,
- FULL,
- CELL,
- CURSOR,
- SELECTION
+ CURSOR = 1,
+ CELL = 2,
+ SELECTION = 3,
+ FULL = 4,
+ INIT = 5
};
///
- InsetTabular(Buffer *, int rows = 1, int columns = 1);
+ InsetTabular(Buffer const &, int rows = 1, int columns = 1);
///
- InsetTabular(InsetTabular const &, Buffer *);
+ InsetTabular(InsetTabular const &, Buffer const &);
///
~InsetTabular();
///
- Inset * Clone() const;
+ Inset * Clone(Buffer const &) const;
///
void Read(Buffer const *, LyXLex &);
///
///
bool UpdateInsetInInset(BufferView *, Inset *);
///
- int InsetInInsetY();
+ unsigned int InsetInInsetY();
///
UpdatableInset * GetLockingInset();
///
///
void InsetKeyPress(XKeyEvent *);
///
- UpdatableInset::RESULT LocalDispatch(BufferView *, int, string const &);
+ UpdatableInset::RESULT LocalDispatch(BufferView *, kb_action,
+ string const &);
///
int Latex(Buffer const *, std::ostream &, bool, bool) const;
///
- int Ascii(Buffer const *, std::ostream &) const;
+ int Ascii(Buffer const *, std::ostream &, int linelen) const;
///
int Linuxdoc(Buffer const *, std::ostream &) const;
///
///
void ToggleInsetCursor(BufferView *);
///
- bool TabularFeatures(BufferView * bv, string what);
+ bool TabularFeatures(BufferView * bv, string const & what);
///
- void TabularFeatures(BufferView * bv, int feature, string val = string());
+ void TabularFeatures(BufferView * bv, LyXTabular::Feature feature,
+ string const & val = string());
///
- int GetActCell() { return actcell; }
+ int GetActCell() const { return actcell; }
///
void SetFont(BufferView *, LyXFont const &, bool toggleall = false);
///
int getMaxWidth(Painter & pain, UpdatableInset const *) const;
///
- Buffer * BufferOwner() const { return buffer; }
+ Buffer * BufferOwner() const { return const_cast<Buffer *>(buffer); }
+ ///
+ LyXText * getLyXText(BufferView const *, bool const recursive = false) const;
///
- LyXText * getLyXText(BufferView *) const;
void resizeLyXText(BufferView *) const;
+ ///
void OpenLayoutDialog(BufferView *) const;
- LyXFunc::func_status getStatus(string argument) const;
+ ///
+ LyXFunc::func_status getStatus(string const & argument) const;
//
// Public structures and variables
///
LyXTabular * tabular;
+ ///
+ Signal0<void> hideDialog;
private:
///
bool calculate_dimensions_of_cells(BufferView *, LyXFont const &,
- bool =false) const;
+ bool = false) const;
///
void DrawCellLines(Painter &, int x, int baseline,
int row, int cell) const;
void DrawCellSelection(Painter &, int x, int baseline,
int row, int column, int cell) const;
///
- void ShowInsetCursor(BufferView *);
+ void ShowInsetCursor(BufferView *, bool show=true);
///
void HideInsetCursor(BufferView *);
///
///
UpdatableInset::RESULT moveLeft(BufferView *, bool lock = true);
///
- UpdatableInset::RESULT moveUp(BufferView *);
+ UpdatableInset::RESULT moveUp(BufferView *, bool lock = true);
///
- UpdatableInset::RESULT moveDown(BufferView *);
+ UpdatableInset::RESULT moveDown(BufferView *, bool lock = true);
///
- bool moveNextCell(BufferView *);
+ bool moveNextCell(BufferView *, bool lock = false);
///
- bool movePrevCell(BufferView *);
+ bool movePrevCell(BufferView *, bool lock = false);
///
bool Delete();
///
///
void RemoveTabularRow();
///
- bool hasSelection() const {return ((sel_pos_start != sel_pos_end) ||
- (sel_cell_start != sel_cell_end));}
+ bool hasSelection() const {
+ return sel_cell_start != sel_cell_end;
+ }
+ ///
+ void clearSelection() const {
+ sel_cell_start = sel_cell_end = 0;
+ }
///
bool ActivateCellInset(BufferView *, int x = 0, int y = 0, int button = 0,
bool behind = false);
///
+ bool ActivateCellInsetAbs(BufferView *, int x = 0, int y = 0, int button = 0);
+ ///
bool InsetHit(BufferView * bv, int x, int y) const;
///
int GetMaxWidthOfCell(Painter &, int cell) const;
///
bool hasPasteBuffer() const;
///
- bool copySelection();
+ bool copySelection(BufferView *);
///
bool pasteSelection(BufferView *);
///
bool cutSelection();
+ ///
+ bool isRightToLeft(BufferView *);
//
// Private structures and variables
///
InsetText * the_locking_inset;
///
- Buffer * buffer;
+ InsetText * old_locking_inset;
///
- mutable LyXCursor cursor;
- ///
- mutable LyXCursor old_cursor;
- ///
- mutable int inset_pos;
- ///
- mutable int inset_x;
+ Buffer const * buffer;
///
- mutable int inset_y;
+ mutable LyXCursor cursor;
///
- mutable int sel_pos_start;
+ mutable unsigned int inset_x;
///
- mutable int sel_pos_end;
+ mutable unsigned int inset_y;
///
mutable int sel_cell_start;
///
///
mutable int actrow;
///
+ mutable int first_visible_cell;
+ ///
bool no_selection;
///
+ bool no_draw;
+ ///
mutable bool locked;
///
mutable UpdateCodes need_update;
- ///
- mutable Dialogs * dialogs_;
};
#endif