]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettabular.h
clear()->erase() ; lots of using directives for cxx
[lyx.git] / src / insets / insettabular.h
index d5f322aebe12f0547a2443937bc0a978717d3678..9070104ea8efa9cbf3720adf9fe1183e5466daf8 100644 (file)
 #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:
@@ -68,7 +68,7 @@ public:
     ///
     ~InsetTabular();
     ///
-    InsetTabular * InsetTabular::Clone() const;
+    Inset * Clone() const;
     ///
     void Read(LyXLex &);
     ///
@@ -88,15 +88,17 @@ public:
     ///
     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);
     ///
@@ -110,6 +112,8 @@ public:
     ///
     int Latex(std::ostream &, bool, bool) const;
     ///
+    int Ascii(std::ostream &) const;
+    ///
     int Linuxdoc(std::ostream &) const;
     ///
     int DocBook(std::ostream &) const;
@@ -118,65 +122,70 @@ public:
     ///
     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;