]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.h
Fix logic error that led to bug #8777. I have no idea what I was
[lyx.git] / src / insets / InsetTabular.h
index 047f39a83393608e6d06b108808963ced5f3cd35..1fed9bea174b96c1701d91c4085decfa146e2276 100644 (file)
@@ -10,6 +10,7 @@
  * \author Jürgen Vigna
  * \author Edwin Leuven
  * \author Uwe Stöhr
+ * \author Scott Kostyshak
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -29,6 +30,7 @@
 
 #include "support/shared_ptr.h"
 
+#include <climits>
 #include <iosfwd>
 #include <vector>
 
@@ -55,7 +57,7 @@ public:
        ///
        InsetCode lyxCode() const { return CELL_CODE; }
        ///
-       Inset * clone() { return new InsetTableCell(*this); }
+       Inset * clone() const { return new InsetTableCell(*this); }
        ///
        bool getStatus(Cursor & cur, FuncRequest const & cmd,
                FuncStatus & status) const;
@@ -136,6 +138,14 @@ public:
                ///
                COPY_COLUMN,
                ///
+               MOVE_COLUMN_RIGHT,
+               ///
+               MOVE_COLUMN_LEFT,
+               ///
+               MOVE_ROW_DOWN,
+               ///
+               MOVE_ROW_UP,
+               ///
                SET_LINE_TOP,
                ///
                SET_LINE_BOTTOM,
@@ -233,6 +243,7 @@ public:
                UNSET_LTLASTFOOT,
                ///
                SET_LTNEWPAGE,
+               UNSET_LTNEWPAGE,
                ///
                TOGGLE_LTCAPTION,
                ///
@@ -330,6 +341,16 @@ public:
                CAPTION_ANY
        };
 
+       enum RowDirection {
+               UP,
+               DOWN
+       };
+
+       enum ColDirection {
+               RIGHT,
+               LEFT
+       };
+
        class ltType {
        public:
                // constructor
@@ -452,6 +473,10 @@ public:
        ///  
        void insertRow(row_type row, bool copy);
        ///
+       void moveColumn(col_type col, ColDirection direction);
+       ///
+       void moveRow(row_type row, RowDirection direction);
+       ///
        void appendColumn(col_type column);
        ///
        void deleteColumn(col_type column);
@@ -476,12 +501,14 @@ public:
        ///
        docstring xhtml(XHTMLStream & os, OutputParams const &) const;
        ///
-       void plaintext(odocstream &,
+       void plaintext(odocstringstream &,
                       OutputParams const & runparams, int const depth,
-                      bool onlydata, char_type delim) const;
+                      bool onlydata, char_type delim, size_t max_length = INT_MAX) const;
        ///
        bool isMultiColumn(idx_type cell) const;
        ///
+       bool hasMultiColumn(col_type cell) const;
+       ///
        idx_type setMultiColumn(idx_type cell, idx_type number,
                             bool const right_border);
        ///
@@ -493,6 +520,8 @@ public:
        ///
        bool isMultiRow(idx_type cell) const;
        ///
+       bool hasMultiRow(row_type r) const;
+       ///
        idx_type setMultiRow(idx_type cell, idx_type number,
                             bool const bottom_border);
        ///
@@ -702,7 +731,7 @@ public:
        ///
        bool use_booktabs;
        ///
-       bool rotate;
+       int rotate;
        ///
        VAlignment tabular_valignment;
        //
@@ -755,17 +784,17 @@ public:
        ///
        // helper functions for plain text
        ///
-       bool plaintextTopHLine(odocstream &, row_type row,
+       bool plaintextTopHLine(odocstringstream &, row_type row,
                               std::vector<unsigned int> const &) const;
        ///
-       bool plaintextBottomHLine(odocstream &, row_type row,
+       bool plaintextBottomHLine(odocstringstream &, row_type row,
                                  std::vector<unsigned int> const &) const;
        ///
-       void plaintextPrintCell(odocstream &,
+       void plaintextPrintCell(odocstringstream &,
                                OutputParams const &,
                                idx_type cell, row_type row, col_type column,
                                std::vector<unsigned int> const &,
-                               bool onlydata) const;
+                               bool onlydata, size_t max_length) const;
        /// auxiliary function for docbook
        int docbookRow(odocstream & os, row_type, OutputParams const &) const;
        ///
@@ -825,11 +854,14 @@ public:
            insets that may contain several paragraphs */
        bool inheritFont() const { return false; }
        ///
+       bool allowsCaptionVariation(std::string const &) const;
+       ///
        DisplayType display() const;
        ///
        void latex(otexstream &, OutputParams const &) const;
        ///
-       int plaintext(odocstream &, OutputParams const &) const;
+       int plaintext(odocstringstream & ods, OutputParams const & op,
+                     size_t max_length = INT_MAX) const;
        ///
        int docbook(odocstream &, OutputParams const &) const;
        ///
@@ -889,7 +921,7 @@ public:
        /// Update the counters of this inset and of its contents
        void updateBuffer(ParIterator const &, UpdateType);
        ///
-       void addToToc(DocIterator const &) const;
+       void addToToc(DocIterator const & di, bool output_active) const;
 
        ///
        bool completionSupported(Cursor const &) const;