]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetTabular.h
DocBook: add a TODO for a newly discovered bug.
[features.git] / src / insets / InsetTabular.h
index ef9735632d5a975b16070c3ff2ae9f224747beca..0d4e7afee9d0e954e564e7f86f8fefec0e28bacd 100644 (file)
 #ifndef INSET_TABULAR_H
 #define INSET_TABULAR_H
 
+#include "Changes.h"
 #include "InsetText.h"
 
 #include "support/Length.h"
+#include "support/types.h"
 
 #include <climits>
 #include <iosfwd>
@@ -44,7 +46,6 @@ class CursorSlice;
 class FuncStatus;
 class Lexer;
 class OutputParams;
-class Paragraph;
 class XMLStream;
 
 
@@ -54,6 +55,9 @@ class InsetTableCell : public InsetText
 public:
        ///
        explicit InsetTableCell(Buffer * buf);
+       /// We need this since generation of the default is deprecated
+       /// (since we declare the assignment constuctor below).
+       InsetTableCell(InsetTableCell const & in) = default;
        ///
        InsetCode lyxCode() const override { return CELL_CODE; }
        ///
@@ -64,11 +68,13 @@ public:
        ///
        void toggleFixedWidth(bool fw) { isFixedWidth = fw; }
        ///
+       void toggleVarWidth(bool vw) { isVarwidth = vw; }
+       ///
        void toggleMultiCol(bool m) { isMultiColumn = m; }
        ///
        void toggleMultiRow(bool m) { isMultiRow = m; }
        ///
-       void setContentAlignment(LyXAlignment al) {contentAlign = al; }
+       void setContentAlignment(LyXAlignment al) { contentAlign = al; }
        /// writes the contents of the cell as a string, optionally
        /// descending into insets
        docstring asString(bool intoInsets = true);
@@ -85,11 +91,15 @@ public:
        bool inheritFont() const override { return false; }
        /// Can the cell contain several paragraphs?
        bool allowMultiPar() const override { return !isMultiRow && (!isMultiColumn || isFixedWidth); }
+       ///
+       bool canPaintChange(BufferView const &) const override { return false; }
+       /// This assures we never output \maketitle in table cells
+       bool isInTitle() const override { return true; }
 private:
-       /// unimplemented
-       InsetTableCell();
-       /// unimplemented
-       void operator=(InsetTableCell const &);
+       ///
+       InsetTableCell() = delete;
+       ///
+       void operator=(InsetTableCell const &) = delete;
        // FIXME
        // These booleans are supposed to track whether the cell has had its
        // width explicitly set and whether it is part of a multicolumn, respectively.
@@ -113,10 +123,12 @@ private:
        // iterating, since this information is needed quite often, and so may
        // be quite slow.
        // So, well, if someone can do better, please do!
-       // --rgh
+       // --rkh
        ///
        bool isFixedWidth;
        ///
+       bool isVarwidth;
+       ///
        bool isMultiColumn;
        ///
        bool isMultiRow;
@@ -130,8 +142,6 @@ private:
        ///
        bool usePlainLayout() const override { return true; }
        ///
-       bool forcePlainLayout(idx_type = 0) const override;
-       ///
        bool allowParagraphCustomization(idx_type = 0) const override;
        ///
        bool forceLocalFontSwitch() const override;
@@ -417,12 +427,6 @@ public:
                bool empty;
        };
 
-       /// type for row numbers
-       typedef size_t row_type;
-       /// type for column numbers
-       typedef size_t col_type;
-       /// type for cell indices
-       typedef size_t idx_type;
        /// index indicating an invalid position
        static const idx_type npos = static_cast<idx_type>(-1);
 
@@ -548,9 +552,11 @@ public:
        ///
        void insertRow(row_type row, bool copy);
        ///
-       void moveColumn(col_type col, ColDirection direction);
+       void moveColumn(col_type col_start, col_type col_end,
+                       ColDirection direction);
        ///
-       void moveRow(row_type row, RowDirection direction);
+       void moveRow(row_type row_start, row_type row_end,
+                    RowDirection direction);
        ///
        void appendColumn(col_type column);
        ///
@@ -974,9 +980,7 @@ public:
        bool canTrackChanges() const override { return true; }
        ///
        bool canPaintChange(BufferView const &) const override { return true; }
-       /** returns false if, when outputting LaTeX, font changes should
-           be closed before generating this inset. This is needed for
-           insets that may contain several paragraphs */
+       ///
        bool inheritFont() const override { return false; }
        ///
        bool allowMultiPar() const override;
@@ -985,7 +989,7 @@ public:
        //
        bool isTable() const override { return true; }
        ///
-       RowFlags rowFlags() const override;
+       int rowFlags() const override;
        ///
        void latex(otexstream &, OutputParams const &) const override;
        ///
@@ -1032,9 +1036,7 @@ public:
        // this should return true if we have a "normal" cell, otherwise false.
        // "normal" means without width set!
        /// should all paragraphs be output with "Standard" layout?
-       virtual bool allowParagraphCustomization(idx_type cell = 0) const;
-       ///
-       virtual bool forcePlainLayout(idx_type cell = 0) const;
+       bool allowParagraphCustomization(idx_type cell = 0) const override;
        ///
        void addPreview(DocIterator const & inset_pos,
                graphics::PreviewLoader &) const override;