]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.h
Move isMultiCell() to Cursor, and use it.
[lyx.git] / src / insets / InsetTabular.h
index c2395698f8d3a33f9e6ba2a099d56314bef84259..66862d68f132e5a7e5fb18e0a145df2a6c27053c 100644 (file)
@@ -235,7 +235,7 @@ public:
        static const idx_type npos = static_cast<idx_type>(-1);
 
        /// constructor
-       Tabular(Buffer const &, col_type columns_arg, row_type rows_arg);
+       Tabular(Buffer &, col_type columns_arg, row_type rows_arg);
 
        /// Returns true if there is a topline, returns false if not
        bool topLine(idx_type cell) const;
@@ -442,7 +442,7 @@ public:
        class CellData {
        public:
                ///
-               CellData(Buffer const &);
+               CellData(Buffer &);
                ///
                CellData(CellData const &);
                ///
@@ -571,7 +571,7 @@ public:
        ltType endlastfoot;
 
        ///
-       void init(Buffer const &, row_type rows_arg,
+       void init(Buffer &, row_type rows_arg,
                  col_type columns_arg);
        ///
        void updateIndexes();
@@ -618,12 +618,12 @@ public:
        int docbookRow(odocstream & os, row_type, OutputParams const &) const;
 
        /// change associated Buffer
-       void setBuffer(Buffer const & buffer) { buffer_ = &buffer; }
+       void setBuffer(Buffer & buffer);
        /// retrieve associated Buffer
-       Buffer const & buffer() const { return *buffer_; }
+       Buffer & buffer() const { return *buffer_; }
 
 private:
-       Buffer const * buffer_;
+       Buffer * buffer_;
 
 }; // Tabular
 
@@ -633,7 +633,7 @@ class InsetTableCell : public InsetText
 {
 public:
        ///
-       InsetTableCell(Buffer const & buf);
+       InsetTableCell(Buffer & buf);
        ///
        InsetCode lyxCode() const { return CELL_CODE; }
        ///
@@ -643,6 +643,9 @@ public:
                FuncStatus & status) const;
        ///
        void toggleFixedWidth(bool fw) { isFixedWidth = fw; }
+       /// writes the contents of the cell as a string, optionally
+       /// descending into insets
+       docstring asString(bool intoInsets = true);
 private:
        /// unimplemented
        InsetTableCell();
@@ -690,10 +693,13 @@ class InsetTabular : public Inset
 {
 public:
        ///
-       InsetTabular(Buffer const &, row_type rows = 1,
+       InsetTabular(Buffer &, row_type rows = 1,
                     col_type columns = 1);
        ///
        ~InsetTabular();
+       ///
+       void setBuffer(Buffer & buffer);
+
        ///
        static void string2params(std::string const &, InsetTabular &);
        ///
@@ -806,6 +812,8 @@ public:
        bool insertCompletion(Cursor & cur, docstring const & s, bool finished);
        ///
        void completionPosAndDim(Cursor const &, int & x, int & y, Dimension & dim) const;
+       ///
+       virtual bool usePlainLayout() const { return true; }
 
        ///
        virtual InsetTabular * asInsetTabular() { return this; }
@@ -813,6 +821,9 @@ public:
        virtual InsetTabular const * asInsetTabular() const { return this; }
        ///
        bool isRightToLeft(Cursor & cur) const;
+       /// writes the cells between stidx and enidx as a string, optionally
+       /// descending into the insets
+       docstring asString(idx_type stidx, idx_type enidx, bool intoInsets = true);
 
        //
        // Public structures and variables
@@ -860,8 +871,6 @@ private:
                          col_type & cs, col_type & ce) const;
        ///
        bool insertPlaintextString(BufferView &, docstring const & buf, bool usePaste);
-       /// are we operating on several cells?
-       bool tablemode(Cursor & cur) const;
 
        /// return the "Manhattan distance" to nearest corner
        int dist(BufferView &, idx_type cell, int x, int y) const;