- BOX_MINIPAGE = 2
- };
-
- /* konstruktor */
- ///
- LyXTabular(InsetTabular *, int columns_arg, int rows_arg);
- ///
- LyXTabular(InsetTabular *, LyXTabular const &);
- ///
- explicit
- LyXTabular(Buffer const *, InsetTabular *, LyXLex & lex);
- ///
- ~LyXTabular();
- ///
- LyXTabular & operator=(LyXTabular const &);
- ///
- LyXTabular * Clone(InsetTabular *);
-
- /// Returns true if there is a topline, returns false if not
- bool TopLine(int cell, bool onlycolumn = false) const;
- /// Returns true if there is a topline, returns false if not
- bool BottomLine(int cell, bool onlycolumn = false) const;
- /// Returns true if there is a topline, returns false if not
- bool LeftLine(int cell, bool onlycolumn = false) const;
- /// Returns true if there is a topline, returns false if not
- bool RightLine(int cell, bool onlycolumn = false) const;
-
- ///
- bool TopAlreadyDrawed(int cell) const;
- ///
- bool LeftAlreadyDrawed(int cell) const;
- ///
- bool IsLastRow(int cell) const;
-
- ///
- int GetAdditionalHeight(int cell) const;
- ///
- int GetAdditionalWidth(int cell) const;
-
- /* returns the maximum over all rows */
- ///
- int GetWidthOfColumn(int cell) const;
- ///
- int GetWidthOfTabular() const;
- ///
- int GetAscentOfRow(int row) const;
- ///
- int GetDescentOfRow(int row) const;
- ///
- int GetHeightOfTabular() const;
- /// Returns true if a complete update is necessary, otherwise false
- bool SetAscentOfRow(int row, int height);
- /// Returns true if a complete update is necessary, otherwise false
- bool SetDescentOfRow(int row, int height);
- /// Returns true if a complete update is necessary, otherwise false
- bool SetWidthOfCell(int cell, int new_width);
- /// Returns true if a complete update is necessary, otherwise false
- bool SetAllLines(int cell, bool line);
- /// Returns true if a complete update is necessary, otherwise false
- bool SetTopLine(int cell, bool line, bool onlycolumn=false);
- /// Returns true if a complete update is necessary, otherwise false
- bool SetBottomLine(int cell, bool line, bool onlycolumn=false);
- /// Returns true if a complete update is necessary, otherwise false
- bool SetLeftLine(int cell, bool line, bool onlycolumn=false);
- /// Returns true if a complete update is necessary, otherwise false
- bool SetRightLine(int cell, bool line, bool onlycolumn=false);
- /// Returns true if a complete update is necessary, otherwise false
- bool SetAlignment(int cell, LyXAlignment align, bool onlycolumn = false);
- /// Returns true if a complete update is necessary, otherwise false
- bool SetVAlignment(int cell, VAlignment align, bool onlycolumn = false);
- ///
- bool SetColumnPWidth(int cell, string const & width);
- ///
- bool SetMColumnPWidth(int cell, string const & width);
- ///
- bool SetAlignSpecial(int cell, string const & special, Feature what);
- ///
- LyXAlignment GetAlignment(int cell, bool onlycolumn = false) const;
- ///
- VAlignment GetVAlignment(int cell, bool onlycolumn = false) const;
- ///
- string const GetPWidth(int cell) const;
- ///
- string const GetColumnPWidth(int cell) const;
- ///
- string const GetMColumnPWidth(int cell) const;
- ///
- string const GetAlignSpecial(int cell, int what) const;
- ///
- int GetWidthOfCell(int cell) const;
- ///
- int GetBeginningOfTextInCell(int cell) const;
- ///
- void AppendRow(int cell);
- ///
- void DeleteRow(int row);
- ///
- void AppendColumn(int cell);
- ///
- void DeleteColumn(int column);
- ///
- bool IsFirstCellInRow(int cell) const;
- ///
- int GetFirstCellInRow(int row) const;
- ///
- bool IsLastCellInRow(int cell) const;
- ///
- int GetLastCellInRow(int row) const;
- ///
- int GetNumberOfCells() const;
- ///
- int NumberOfCellsInRow(int cell) const;
- ///
- void Write(Buffer const *, std::ostream &) const;
- ///
- void Read(Buffer const *, LyXLex &);
- ///
- void OldFormatRead(LyXLex &, string const &);
- //
- // helper function for Latex returns number of newlines
- ///
- int TeXTopHLine(std::ostream &, int row) const;
- ///
- int TeXBottomHLine(std::ostream &, int row) const;
- ///
- int TeXCellPreamble(std::ostream &, int cell) const;
- ///
- int TeXCellPostamble(std::ostream &, int cell) const;
- ///
- int Latex(Buffer const *, std::ostream &, bool, bool) const;
- ///
- int DocBook(Buffer const * buf, std::ostream & os) const;
- ///
- // helper function for Latex returns number of newlines
- ///
- int AsciiTopHLine(std::ostream &, int row,
- std::vector<unsigned int> const &) const;
- ///
- int AsciiBottomHLine(std::ostream &, int row,
- std::vector<unsigned int> const &) const;
- ///
- int AsciiPrintCell(Buffer const *, std::ostream &, int cell, int row,
- int column, std::vector<unsigned int> const &) const;
- ///
- int Ascii(Buffer const *, std::ostream &) const;
- ///
- int DocBookEndOfCell(std::ostream &, int cell, int & depth) const;
-#if 0
- ///
- int RoffEndOfCell(std::ostream &, int cell);
-#endif
- ///
- string const GetDocBookAlign(int cell, bool isColumn = false) const;
+ bool isPartOfMultiColumn(row_type row, col_type column) const;
+ ///
+ row_type row_of_cell(idx_type cell) const;
+ ///
+ col_type column_of_cell(idx_type cell) const;
+ ///
+ col_type right_column_of_cell(idx_type cell) const;
+ ///
+ void setBookTabs(bool);
+ ///
+ bool useBookTabs() const;
+ ///
+ void setLongTabular(bool);
+ ///
+ bool isLongTabular() const;
+ ///
+ void setRotateTabular(bool);
+ ///
+ bool getRotateTabular() const;
+ ///
+ void setRotateCell(idx_type cell, bool);
+ ///
+ bool getRotateCell(idx_type cell) const;
+ ///
+ bool needRotating() const;
+ ///
+ bool isLastCell(idx_type cell) const;
+ ///
+ idx_type getCellAbove(idx_type cell) const;
+ ///
+ idx_type getCellBelow(idx_type cell) const;
+ ///
+ idx_type getLastCellAbove(idx_type cell) const;
+ ///
+ idx_type getLastCellBelow(idx_type cell) const;
+ ///
+ idx_type getCellNumber(row_type row, col_type column) const;
+ ///
+ void setUsebox(idx_type cell, BoxType);
+ ///
+ BoxType getUsebox(idx_type cell) const;
+ //
+ // Long Tabular Options support functions
+ ///
+ bool checkLTType(row_type row, ltType const &) const;
+ ///
+ void setLTHead(row_type row, bool flag, ltType const &, bool first);
+ ///
+ bool getRowOfLTHead(row_type row, ltType &) const;
+ ///
+ bool getRowOfLTFirstHead(row_type row, ltType &) const;
+ ///
+ void setLTFoot(row_type row, bool flag, ltType const &, bool last);
+ ///
+ bool getRowOfLTFoot(row_type row, ltType &) const;
+ ///
+ bool getRowOfLTLastFoot(row_type row, ltType &) const;
+ ///
+ void setLTNewPage(row_type row, bool what);
+ ///
+ bool getLTNewPage(row_type row) const;
+ ///
+ bool haveLTHead() const;
+ ///
+ bool haveLTFirstHead() const;
+ ///
+ bool haveLTFoot() const;
+ ///
+ bool haveLTLastFoot() const;
+ ///
+ // end longtable support
+ ///
+ boost::shared_ptr<InsetText> getCellInset(idx_type cell) const;
+ ///
+ boost::shared_ptr<InsetText> getCellInset(row_type row,
+ col_type column) const;
+ ///
+ void setCellInset(row_type row, col_type column,
+ boost::shared_ptr<InsetText>) const;
+ /// Search for \param inset in the tabular, with the
+ ///
+ idx_type getCellFromInset(InsetBase const * inset) const;
+ ///
+ row_type rows() const { return rows_; }
+ ///
+ col_type columns() const { return columns_;}
+ ///
+ void validate(LaTeXFeatures &) const;
+ ///
+//private:
+ ///
+ class cellstruct {
+ public:
+ ///
+ cellstruct(BufferParams const &);
+ ///
+ cellstruct(cellstruct const &);
+ ///
+ cellstruct & operator=(cellstruct);
+ ///
+ void swap(cellstruct & rhs);
+ ///
+ idx_type cellno;
+ ///
+ int width_of_cell;
+ ///
+ int multicolumn;
+ ///
+ LyXAlignment alignment;
+ ///
+ VAlignment valignment;
+ ///
+ bool top_line;
+ ///
+ bool bottom_line;
+ ///
+ bool left_line;
+ ///
+ bool right_line;
+ ///
+ BoxType usebox;
+ ///
+ bool rotate;
+ ///
+ docstring align_special;
+ ///
+ LyXLength p_width; // this is only set for multicolumn!!!
+ ///
+ boost::shared_ptr<InsetText> inset;
+ };
+ cellstruct & cellinfo_of_cell(idx_type cell) const;
+ ///
+ typedef std::vector<cellstruct> cell_vector;
+ ///
+ typedef std::vector<cell_vector> cell_vvector;