]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettabular.h
prepare for 1.1.6pre2
[lyx.git] / src / insets / insettabular.h
index 9d54ffcdd123cca4d164c7580a3e954b05998438..f9d8396978d1e247f87babad3462af72dc0c0b95 100644 (file)
 #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 &);
     ///
@@ -160,7 +164,7 @@ public:
     ///
     int getMaxWidth(Painter & pain, UpdatableInset const *) const;
     ///
-    Buffer * BufferOwner() const { return buffer; }
+    Buffer * BufferOwner() const { return const_cast<Buffer *>(buffer); }
     ///
     LyXText * getLyXText(BufferView *) const;
     ///
@@ -174,6 +178,8 @@ public:
     // Public structures and variables
     ///
     LyXTabular * tabular;
+       ///
+       Signal0<void> hideDialog;
 
 private:
     ///
@@ -186,7 +192,7 @@ private:
     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 *);
     ///
@@ -215,6 +221,10 @@ private:
     bool hasSelection() const { return ((sel_pos_start != sel_pos_end) ||
                                       (sel_cell_start != sel_cell_end));}
     ///
+    void clearSelection() const {
+       sel_pos_start = sel_pos_end = sel_cell_start = sel_cell_end = 0;
+    }
+    ///
     bool ActivateCellInset(BufferView *, int x = 0, int y = 0, int button = 0,
                           bool behind = false);
     ///
@@ -224,7 +234,7 @@ private:
     ///
     bool hasPasteBuffer() const;
     ///
-    bool copySelection();
+    bool copySelection(BufferView *);
     ///
     bool pasteSelection(BufferView *);
     ///
@@ -235,21 +245,21 @@ private:
     ///
     InsetText * the_locking_inset;
     ///
-    Buffer * buffer;
+    Buffer const * buffer;
     ///
     mutable LyXCursor cursor;
     ///
     mutable LyXCursor old_cursor;
     ///
-    mutable int inset_pos;
+    mutable LyXParagraph::size_type inset_pos;
     ///
     mutable unsigned int inset_x;
     ///
     mutable unsigned int inset_y;
     ///
-    mutable int sel_pos_start;
+    mutable LyXParagraph::size_type sel_pos_start;
     ///
-    mutable int sel_pos_end;
+    mutable LyXParagraph::size_type sel_pos_end;
     ///
     mutable int sel_cell_start;
     ///
@@ -268,7 +278,5 @@ private:
     mutable bool locked;
     ///
     mutable UpdateCodes need_update;
-    ///
-    mutable Dialogs * dialogs_;
 };
 #endif