4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Matthias Ettrich
10 * \author Jürgen Vigna
11 * \author Edwin Leuven
13 * \author Scott Kostyshak
15 * Full author contact details are available in file CREDITS.
18 // Things to think of when designing the new tabular support:
19 // - color support (colortbl, color)
20 // - decimal alignment (dcloumn)
21 // - custom lines (hhline)
24 #ifndef INSET_TABULAR_H
25 #define INSET_TABULAR_H
27 #include "InsetText.h"
51 class InsetTableCell : public InsetText
55 explicit InsetTableCell(Buffer * buf);
57 InsetCode lyxCode() const { return CELL_CODE; }
59 Inset * clone() const { return new InsetTableCell(*this); }
61 bool getStatus(Cursor & cur, FuncRequest const & cmd,
62 FuncStatus & status) const;
64 void toggleFixedWidth(bool fw) { isFixedWidth = fw; }
66 void toggleMultiCol(bool m) { isMultiColumn = m; }
68 void toggleMultiRow(bool m) { isMultiRow = m; }
70 void setContentAlignment(LyXAlignment al) {contentAlign = al; }
71 /// writes the contents of the cell as a string, optionally
72 /// descending into insets
73 docstring asString(bool intoInsets = true);
75 docstring xhtml(XMLStream &, OutputParams const &) const;
77 void docbook(XMLStream &, OutputParams const &) const;
79 void addToToc(DocIterator const & di, bool output_active,
80 UpdateType utype, TocBackend & backend) const;
82 void metrics(MetricsInfo &, Dimension &) const;
83 /// Needs to be same as InsetTabular
84 bool inheritFont() const { return false; }
89 void operator=(InsetTableCell const &);
91 // These booleans are supposed to track whether the cell has had its
92 // width explicitly set and whether it is part of a multicolumn, respectively.
93 // We need to know this to determine whether
94 // layout changes and paragraph customization are allowed---that is,
95 // we need it in forcePlainLayout() and allowParagraphCustomization().
96 // Unfortunately, that information is not readily available in
97 // InsetTableCell. In the case of multicolumn cells, it is present
98 // in CellData, and so would be available here if CellData were to
99 // become a member of InsetTableCell. But in the other case, it isn't
100 // even available there, but is held in Tabular::ColumnData.
101 // So, the present solution uses this boolean to track the information
102 // we need to track, and tries to keep it updated. This is not ideal,
103 // but the other solutions are no better. These are:
104 // (i) Keep a pointer in InsetTableCell to the table;
105 // (ii) Find the table by iterating over the Buffer's insets.
106 // Solution (i) raises the problem of updating the pointer when an
107 // InsetTableCell is copied, and we'd therefore need a copy constructor
108 // in InsetTabular and then in Tabular, which seems messy, given how
109 // complicated those classes are. Solution (ii) involves a lot of
110 // iterating, since this information is needed quite often, and so may
112 // So, well, if someone can do better, please do!
120 // FIXME: Here the thoughts from the comment above also apply.
122 LyXAlignment contentAlign;
123 /// should paragraph indentation be omitted in any case?
124 bool neverIndent() const { return true; }
126 LyXAlignment contentAlignment() const { return contentAlign; }
128 virtual bool usePlainLayout() const { return true; }
130 virtual bool forcePlainLayout(idx_type = 0) const;
132 virtual bool allowParagraphCustomization(idx_type = 0) const;
134 virtual bool forceLocalFontSwitch() const;
135 /// Is the width forced to some value?
136 bool hasFixedWidth() const { return isFixedWidth; }
137 /// Can the cell contain several paragraphs?
138 bool allowMultiPar() const { return !isMultiRow && (!isMultiColumn || isFixedWidth); }
143 // A helper struct for tables
246 RESET_FORMAL_DEFAULT,
260 TOGGLE_VARWIDTH_COLUMN,
264 UNSET_ROTATE_TABULAR,
266 TOGGLE_ROTATE_TABULAR,
299 SET_SPECIAL_MULTICOLUMN,
317 TABULAR_VALIGN_MIDDLE,
319 TABULAR_VALIGN_BOTTOM,
321 LONGTABULAR_ALIGN_LEFT,
323 LONGTABULAR_ALIGN_CENTER,
325 LONGTABULAR_ALIGN_RIGHT,
340 CELL_BEGIN_OF_MULTICOLUMN,
342 CELL_PART_OF_MULTICOLUMN,
344 CELL_BEGIN_OF_MULTIROW,
346 CELL_PART_OF_MULTIROW
354 LYX_VALIGN_MIDDLE = 1,
356 LYX_VALIGN_BOTTOM = 2
362 LYX_LONGTABULAR_ALIGN_LEFT = 0,
364 LYX_LONGTABULAR_ALIGN_CENTER = 1,
366 LYX_LONGTABULAR_ALIGN_RIGHT = 2
407 // we have this header type (is set in the getLT... functions)
409 // double borders on top
411 // double borders on bottom
413 // used for FirstHeader & LastFooter and if this is true
414 // all the rows marked as FirstHeader or LastFooter are
415 // ignored in the output and it is set to be empty!
419 /// type for row numbers
420 typedef size_t row_type;
421 /// type for column numbers
422 typedef size_t col_type;
423 /// type for cell indices
424 typedef size_t idx_type;
425 /// index indicating an invalid position
426 static const idx_type npos = static_cast<idx_type>(-1);
429 Tabular(Buffer * buf, col_type columns_arg, row_type rows_arg);
431 /// Returns true if there is a topline, returns false if not
432 bool topLine(idx_type cell) const;
433 /// Returns true if there is a topline, returns false if not
434 bool bottomLine(idx_type cell) const;
435 /// Returns true if there is a topline, returns false if not
436 /// If \p ignore_bt is true, we return the state as if booktabs was
438 bool leftLine(idx_type cell, bool const ignore_bt = false) const;
439 /// Returns true if there is a topline, returns false if not
440 /// If \p ignore_bt is true, we return the state as if booktabs was
442 bool rightLine(idx_type cell, bool const ignore_bt = false) const;
443 /// Returns whether the top line is trimmed left and/or right
444 std::pair<bool, bool> topLineTrim(idx_type const cell) const;
445 /// Returns whether the bottom line is trimmed left and/or right
446 std::pair<bool, bool> bottomLineTrim(idx_type const cell) const;
448 /// return space occupied by the second horizontal line and
449 /// interline space above row \p row in pixels
450 int interRowSpace(row_type row) const;
452 int interColumnSpace(idx_type cell) const;
454 /* returns the maximum over all rows */
456 int cellWidth(idx_type cell) const;
458 int cellHeight(idx_type cell) const;
464 row_type nrows() const {return row_info.size();}
466 col_type ncols() const {return column_info.size();}
468 int rowAscent(row_type row) const;
470 int rowDescent(row_type row) const;
472 void setRowAscent(row_type row, int height);
474 void setRowDescent(row_type row, int height);
476 void setTopLine(idx_type cell, bool line);
478 void setBottomLine(idx_type cell, bool line);
480 void setTopLineLTrim(idx_type cell, bool val);
482 void setBottomLineLTrim(idx_type cell, bool val);
484 void setTopLineRTrim(idx_type cell, bool val);
486 void setBottomLineRTrim(idx_type cell, bool val);
488 void setTopLineTrim(idx_type cell, std::pair<bool, bool>);
490 void setBottomLineTrim(idx_type cell, std::pair<bool, bool>);
492 void setLeftLine(idx_type cell, bool line);
494 void setRightLine(idx_type cell, bool line);
496 bool rowTopLine(row_type row) const;
498 bool rowBottomLine(row_type row) const;
500 bool columnLeftLine(col_type column) const;
502 bool columnRightLine(col_type column) const;
504 void setAlignment(idx_type cell, LyXAlignment align,
505 bool onlycolumn = false);
507 void setVAlignment(idx_type cell, VAlignment align,
508 bool onlycolumn = false);
510 void setTabularWidth(Length const & l) { tabular_width = l; }
512 Length tabularWidth() const { return tabular_width; }
514 void setColumnPWidth(Cursor &, idx_type, Length const &);
516 bool setMColumnPWidth(Cursor &, idx_type, Length const &);
518 bool toggleVarwidth(idx_type, bool const);
520 bool setMROffset(Cursor &, idx_type, Length const &);
522 void setAlignSpecial(idx_type cell, docstring const & special,
525 LyXAlignment getAlignment(idx_type cell,
526 bool onlycolumn = false) const;
528 VAlignment getVAlignment(idx_type cell,
529 bool onlycolumn = false) const;
530 /// The vertical offset of the table due to the vertical
531 /// alignment with respect to the baseline.
532 int offsetVAlignment() const;
534 Length const getPWidth(idx_type cell) const;
536 Length const getMROffset(idx_type cell) const;
538 int textHOffset(idx_type cell) const;
540 int textVOffset(idx_type cell) const;
542 void appendRow(row_type row);
544 void deleteRow(row_type row, bool const force = false);
546 void copyRow(row_type row);
548 void insertRow(row_type row, bool copy);
550 void moveColumn(col_type col, ColDirection direction);
552 void moveRow(row_type row, RowDirection direction);
554 void appendColumn(col_type column);
556 void deleteColumn(col_type column, bool const force = false);
558 void copyColumn(col_type column);
560 void insertColumn(col_type column, bool copy);
562 idx_type getFirstCellInRow(row_type row, bool const ct = false) const;
564 idx_type getLastCellInRow(row_type row, bool const ct = false) const;
566 idx_type getFirstRow(bool const ct = false) const;
568 idx_type getLastRow(bool const ct = false) const;
570 idx_type numberOfCellsInRow(row_type row) const;
572 void write(std::ostream &) const;
576 void latex(otexstream &, OutputParams const &) const;
577 /// serialise the table in DocBook, according to buffer parameters
578 void docbook(XMLStream &, OutputParams const &) const;
580 docstring xhtml(XMLStream &, OutputParams const &) const;
582 void plaintext(odocstringstream &,
583 OutputParams const & runparams, int const depth,
584 bool onlydata, char_type delim, size_t max_length = INT_MAX) const;
586 bool isMultiColumn(idx_type cell) const;
588 bool hasMultiColumn(col_type cell) const;
590 bool hasVarwidthColumn() const;
592 bool isVTypeColumn(col_type cell) const;
594 idx_type setMultiColumn(Cursor & cur, idx_type cell, idx_type number,
595 bool const right_border);
597 void unsetMultiColumn(idx_type cell);
599 bool isPartOfMultiColumn(row_type row, col_type column) const;
601 bool isPartOfMultiRow(row_type row, col_type column) const;
603 bool isMultiRow(idx_type cell) const;
605 bool hasMultiRow(row_type r) const;
607 idx_type setMultiRow(Cursor & cur, idx_type cell, idx_type number,
608 bool const bottom_border,
609 LyXAlignment const halign);
611 void unsetMultiRow(idx_type cell);
613 row_type cellRow(idx_type cell) const;
615 col_type cellColumn(idx_type cell) const;
617 void setRotateCell(idx_type cell, int);
619 int getRotateCell(idx_type cell) const;
621 bool needRotating() const;
623 bool isLastCell(idx_type cell) const;
625 idx_type cellAbove(idx_type cell) const;
627 idx_type cellBelow(idx_type cell) const;
628 /// \return the index of the VISIBLE cell at row, column
629 /// this will be the same as the cell in the previous row,
630 /// e.g., if the cell is part of a multirow
631 idx_type cellIndex(row_type row, col_type column) const;
633 void setUsebox(idx_type cell, BoxType);
635 BoxType getUsebox(idx_type cell) const;
637 // Long Tabular Options support functions
639 void setLTHead(row_type row, bool flag, ltType const &, bool first);
641 bool getRowOfLTHead(row_type row, ltType &) const;
643 bool getRowOfLTFirstHead(row_type row, ltType &) const;
645 void setLTFoot(row_type row, bool flag, ltType const &, bool last);
647 bool getRowOfLTFoot(row_type row, ltType &) const;
649 bool getRowOfLTLastFoot(row_type row, ltType &) const;
651 void setLTNewPage(row_type row, bool what);
653 bool getLTNewPage(row_type row) const;
655 idx_type setLTCaption(Cursor & cur, row_type row, bool what);
657 bool ltCaption(row_type row) const;
659 bool haveLTHead(bool withcaptions = true) const;
661 bool haveLTFirstHead(bool withcaptions = true) const;
663 bool haveLTFoot(bool withcaptions = true) const;
665 bool haveLTLastFoot(bool withcaptions = true) const;
667 bool haveLTCaption(CaptionType captiontype = CAPTION_ANY) const;
669 // end longtable support
672 /// there is a subtle difference between these two methods.
675 /// cellInset(cellIndex(r,c));
676 /// can return different things. this is because cellIndex(r,c)
677 /// returns the VISIBLE cell at r,c, which may be the same as the
678 /// cell at the previous row or column, if we're dealing with some
679 /// multirow or multicell.
680 std::shared_ptr<InsetTableCell> cellInset(idx_type cell);
681 std::shared_ptr<InsetTableCell> cellInset(row_type row, col_type column);
682 InsetTableCell const * cellInset(idx_type cell) const;
685 void setCellInset(row_type row, col_type column,
686 std::shared_ptr<InsetTableCell>);
687 /// Search for \param inset in the tabular, with the
689 void validate(LaTeXFeatures &) const;
692 // FIXME Now that cells have an InsetTableCell as their insets, rather
693 // than an InsetText, it'd be possible to reverse the relationship here,
694 // so that cell_vector was a vector<InsetTableCell> rather than a
695 // vector<CellData>, and an InsetTableCell had a CellData as a member,
696 // or perhaps just had its members as members.
701 explicit CellData(Buffer *);
703 CellData(CellData const &);
705 CellData & operator=(CellData const &);
717 LyXAlignment alignment;
719 VAlignment valignment;
720 /// width of the part before the decimal
722 /// width of the decimal part
735 bool top_line_rtrimmed;
737 bool top_line_ltrimmed;
739 bool bottom_line_rtrimmed;
741 bool bottom_line_ltrimmed;
747 docstring align_special;
749 Length p_width; // this is only set for multicolumn!!!
751 std::shared_ptr<InsetTableCell> inset;
754 CellData const & cellInfo(idx_type cell) const;
756 CellData & cellInfo(idx_type cell);
758 typedef std::vector<CellData> cell_vector;
760 typedef std::vector<cell_vector> cell_vvector;
771 /// Extra space between the top line and this row
773 /// Ignore top_space if true and use the default top space
774 bool top_space_default;
775 /// Extra space between this row and the bottom line
777 /// Ignore bottom_space if true and use the default bottom space
778 bool bottom_space_default;
779 /// Extra space between the bottom line and the next top line
780 Length interline_space;
781 /// Ignore interline_space if true and use the default interline space
782 bool interline_space_default;
783 /// This are for longtabulars only
786 /// a row of endfirsthead
790 /// row of endlastfoot
792 /// row for a newpage
800 typedef std::vector<RowData> row_vector;
808 LyXAlignment alignment;
810 VAlignment valignment;
816 docstring align_special;
818 docstring decimal_point;
825 typedef std::vector<ColumnData> column_vector;
828 idx_type numberofcells;
830 std::vector<row_type> rowofcell;
832 std::vector<col_type> columnofcell;
836 column_vector column_info;
838 cell_vvector cell_info;
840 Length tabular_width;
846 VAlignment tabular_valignment;
850 HAlignment longtabular_alignment;
852 bool is_long_tabular;
855 /// endfirsthead data
863 void init(Buffer *, row_type rows_arg,
864 col_type columns_arg);
866 void updateIndexes();
868 bool setFixedWidth(row_type r, col_type c);
869 /// return true of update is needed
870 bool updateColumnWidths(MetricsInfo & mi);
872 idx_type columnSpan(idx_type cell) const;
874 idx_type rowSpan(idx_type cell) const;
876 BoxType useBox(idx_type cell) const;
878 // helper function for Latex
880 void TeXTopHLine(otexstream &, row_type row, std::list<col_type>,
881 std::list<col_type>) const;
883 void TeXBottomHLine(otexstream &, row_type row, std::list<col_type>,
884 std::list<col_type>) const;
886 void TeXCellPreamble(otexstream &, idx_type cell, bool & ismulticol, bool & ismultirow,
887 bool const bidi) const;
889 void TeXCellPostamble(otexstream &, idx_type cell, bool ismulticol, bool ismultirow) const;
891 void TeXLongtableHeaderFooter(otexstream &, OutputParams const &, std::list<col_type>,
892 std::list<col_type>) const;
894 bool isValidRow(row_type const row) const;
896 void TeXRow(otexstream &, row_type const row,
897 OutputParams const &, std::list<col_type>, std::list<col_type>) const;
899 // helper functions for plain text
901 bool plaintextTopHLine(odocstringstream &, row_type row,
902 std::vector<unsigned int> const &) const;
904 bool plaintextBottomHLine(odocstringstream &, row_type row,
905 std::vector<unsigned int> const &) const;
907 void plaintextPrintCell(odocstringstream &,
908 OutputParams const &,
909 idx_type cell, row_type row, col_type column,
910 std::vector<unsigned int> const &,
911 bool onlydata, size_t max_length) const;
912 /// auxiliary function for DocBook
913 void docbookRow(XMLStream &, row_type, OutputParams const &,
914 bool header = false) const;
915 /// auxiliary function for DocBook: export this row as HTML
916 void docbookRowAsHTML(XMLStream &, row_type, OutputParams const &,
918 /// auxiliary function for DocBook: export this row as CALS
919 void docbookRowAsCALS(XMLStream &, row_type, OutputParams const &) const;
921 docstring xhtmlRow(XMLStream & xs, row_type, OutputParams const &,
922 bool header = false) const;
924 /// change associated Buffer
925 void setBuffer(Buffer & buffer);
926 /// retrieve associated Buffer
927 Buffer const & buffer() const { return *buffer_; }
928 /// retrieve associated Buffer
929 Buffer & buffer() { return *buffer_; }
937 class InsetTabular : public Inset
941 InsetTabular(Buffer *, row_type rows = 1,
942 col_type columns = 1);
946 void setBuffer(Buffer & buffer);
949 static void string2params(std::string const &, InsetTabular &);
951 static std::string params2string(InsetTabular const &);
955 void write(std::ostream &) const;
957 void metrics(MetricsInfo &, Dimension &) const;
959 void draw(PainterInfo & pi, int x, int y) const;
961 void drawSelection(PainterInfo & pi, int x, int y) const;
963 void drawBackground(PainterInfo & pi, int x, int y) const;
965 bool editable() const { return true; }
967 bool hasSettings() const { return true; }
969 bool insetAllowed(InsetCode code) const;
971 bool allowSpellCheck() const { return true; }
973 bool canTrackChanges() const { return true; }
975 bool canPaintChange(BufferView const &) const { return true; }
976 /** returns false if, when outputting LaTeX, font changes should
977 be closed before generating this inset. This is needed for
978 insets that may contain several paragraphs */
979 bool inheritFont() const { return false; }
981 bool allowsCaptionVariation(std::string const &) const;
983 bool isTable() const { return true; }
985 RowFlags rowFlags() const;
987 void latex(otexstream &, OutputParams const &) const;
989 int plaintext(odocstringstream & ods, OutputParams const & op,
990 size_t max_length = INT_MAX) const;
992 void docbook(XMLStream &, OutputParams const &) const;
994 docstring xhtml(XMLStream &, OutputParams const &) const;
996 void validate(LaTeXFeatures & features) const;
998 InsetCode lyxCode() const { return TABULAR_CODE; }
1000 std::string contextMenu(BufferView const &, int, int) const;
1002 std::string contextMenuName() const;
1003 /// get offset of this cursor slice relative to our upper left corner
1004 void cursorPos(BufferView const & bv, CursorSlice const & sl,
1005 bool boundary, int & x, int & y) const;
1006 /// Executes a space-separated sequence of tabular-features requests
1007 void tabularFeatures(Cursor & cur, std::string const & what);
1008 /// Change a single tabular feature; does not handle undo.
1009 void tabularFeatures(Cursor & cur, Tabular::Feature feature,
1010 std::string const & val = std::string());
1012 size_t nargs() const { return tabular.numberofcells; }
1014 std::shared_ptr<InsetTableCell const> cell(idx_type) const;
1016 std::shared_ptr<InsetTableCell> cell(idx_type);
1018 Text * getText(int) const;
1020 /// does the inset contain changes ?
1021 bool isChanged() const;
1022 /// set the change for the entire inset
1023 void setChange(Change const & change);
1024 /// accept the changes within the inset
1025 void acceptChanges();
1026 /// reject the changes within the inset
1027 void rejectChanges();
1029 // this should return true if we have a "normal" cell, otherwise false.
1030 // "normal" means without width set!
1031 /// should all paragraphs be output with "Standard" layout?
1032 virtual bool allowParagraphCustomization(idx_type cell = 0) const;
1034 virtual bool forcePlainLayout(idx_type cell = 0) const;
1036 void addPreview(DocIterator const & inset_pos,
1037 graphics::PreviewLoader &) const;
1039 /// lock cell with given index
1040 void edit(Cursor & cur, bool front, EntryDirection entry_from);
1041 /// get table row from x coordinate
1042 int rowFromY(Cursor & cur, int y) const;
1043 /// get table column from y coordinate
1044 int columnFromX(Cursor & cur, int x) const;
1046 Inset * editXY(Cursor & cur, int x, int y);
1047 /// can we go further down on mouse click?
1048 bool descendable(BufferView const &) const { return true; }
1049 /// Update the counters of this inset and of its contents
1050 void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
1052 void addToToc(DocIterator const & di, bool output_active,
1053 UpdateType utype, TocBackend & backend) const;
1056 bool completionSupported(Cursor const &) const;
1058 bool inlineCompletionSupported(Cursor const & cur) const;
1060 bool automaticInlineCompletion() const;
1062 bool automaticPopupCompletion() const;
1064 bool showCompletionCursor() const;
1066 CompletionList const * createCompletionList(Cursor const & cur) const;
1068 docstring completionPrefix(Cursor const & cur) const;
1070 bool insertCompletion(Cursor & cur, docstring const & s, bool finished);
1072 void completionPosAndDim(Cursor const &, int & x, int & y, Dimension & dim) const;
1074 virtual bool usePlainLayout() const { return true; }
1076 docstring layoutName() const { return from_ascii("Tabular"); }
1080 InsetTabular * asInsetTabular() { return this; }
1082 InsetTabular const * asInsetTabular() const { return this; }
1084 bool isRightToLeft(Cursor & cur) const;
1085 /// writes the cells between stidx and enidx as a string, optionally
1086 /// descending into the insets
1087 docstring asString(idx_type stidx, idx_type enidx, bool intoInsets = true);
1089 ParagraphList asParList(idx_type stidx, idx_type enidx);
1091 /// Returns whether the cell in the specified row and column is selected.
1092 bool isCellSelected(Cursor & cur, row_type row, col_type col) const;
1094 void setLayoutForHiddenCells(DocumentClass const & dc);
1096 // Public structures and variables
1098 mutable Tabular tabular;
1102 InsetTabular(InsetTabular const &);
1104 void doDispatch(Cursor & cur, FuncRequest & cmd);
1106 bool getFeatureStatus(Cursor & cur, std::string const & s,
1107 std::string const & argument, FuncStatus & status) const;
1109 bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
1111 Inset * clone() const { return new InsetTabular(*this); }
1114 bool hitSelectRow(BufferView const & bv, int x) const;
1116 bool hitSelectColumn(BufferView const & bv, int y) const;
1117 /// Returns true if coordinates are on row/column selection zones
1118 bool clickable(BufferView const &, int x, int y) const;
1121 void drawCellLines(PainterInfo &, int x, int y, row_type row,
1122 idx_type cell) const;
1124 void setCursorFromCoordinates(Cursor & cur, int x, int y) const;
1127 void moveNextCell(Cursor & cur,
1128 EntryDirection entry_from = ENTRY_DIRECTION_IGNORE);
1130 void movePrevCell(Cursor & cur,
1131 EntryDirection entry_from = ENTRY_DIRECTION_IGNORE);
1133 int cellXPos(idx_type cell) const;
1135 int cellYPos(idx_type cell) const;
1137 bool copySelection(Cursor & cur);
1139 bool pasteClipboard(Cursor & cur);
1141 void cutSelection(Cursor & cur);
1143 void getSelection(Cursor & cur, row_type & rs, row_type & re,
1144 col_type & cs, col_type & ce) const;
1146 bool insertPlaintextString(BufferView &, docstring const & buf, bool usePaste);
1148 /// return the "Manhattan distance" to nearest corner
1149 int dist(BufferView &, idx_type cell, int x, int y) const;
1150 /// return the cell nearest to x, y
1151 idx_type getNearestCell(BufferView &, int x, int y) const;
1153 /// test the rotation state of the given cell range.
1154 bool oneCellHasRotationState(bool rotated,
1155 row_type row_start, row_type row_end,
1156 col_type col_start, col_type col_end) const;
1158 /// true when selecting rows with the mouse
1160 /// true when selecting columns with the mouse
1164 std::string const featureAsString(Tabular::Feature feature);
1166 /// Split cell on decimal symbol
1167 InsetTableCell splitCell(InsetTableCell & head, docstring const & decimal_sym, bool & hassep);
1171 #endif // INSET_TABULAR_H