class LyXTabular {
public:
///
- enum {
+ enum Feature {
///
APPEND_ROW = 0,
///
///
M_VALIGN_CENTER,
///
- DELETE_TABULAR,
- ///
MULTICOLUMN,
///
SET_ALL_LINES,
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;
+ 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;
+ 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;
+ 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 RightLine(int cell, bool onlycolumn = false) const;
///
bool TopAlreadyDrawed(int cell) const;
/// 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, char align, bool onlycolumn = false);
+ bool SetAlignment(int cell, LyXAlignment align, bool onlycolumn = false);
/// Returns true if a complete update is necessary, otherwise false
- bool SetVAlignment(int cell, char align, bool onlycolumn = 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, int what);
+ bool SetAlignSpecial(int cell, string const & special, Feature what);
///
- char GetAlignment(int cell, bool onlycolumn = false) const;
+ LyXAlignment GetAlignment(int cell, bool onlycolumn = false) const;
///
- char GetVAlignment(int cell, bool onlycolumn = false) const;
+ VAlignment GetVAlignment(int cell, bool onlycolumn = false) const;
///
- string GetPWidth(int cell) const;
+ string const GetPWidth(int cell) const;
///
- string GetColumnPWidth(int cell) const;
+ string const GetColumnPWidth(int cell) const;
///
- string GetMColumnPWidth(int cell) const;
+ string const GetMColumnPWidth(int cell) const;
///
- string GetAlignSpecial(int cell, int what) const;
+ string const GetAlignSpecial(int cell, int what) const;
///
int GetWidthOfCell(int cell) const;
///
///
void AppendRow(int cell);
///
- void DeleteRow(int cell);
+ void DeleteRow(int row);
///
void AppendColumn(int cell);
///
- void DeleteColumn(int cell);
+ void DeleteColumn(int column);
///
bool IsFirstCellInRow(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
///
- char const * GetDocBookAlign(int cell, bool isColumn = false) const;
+ string const GetDocBookAlign(int cell, bool isColumn = false) const;
///
bool IsMultiColumn(int cell, bool real = false) const;
///
int right_column_of_cell(int cell) const;
///
- void SetLongTabular(int what);
+ void SetLongTabular(bool);
///
bool IsLongTabular() const;
///
///
void SetUsebox(int cell, BoxType);
///
- int GetUsebox(int cell) const;
+ BoxType GetUsebox(int cell) const;
//
// Long Tabular Options
///
bool GetLTNewPage(int cell) const;
///
InsetText * GetCellInset(int cell) const;
+ InsetText * GetCellInset(int row, int column) const;
///
int rows() const { return rows_; }
///
///
int multicolumn;
///
- int alignment;
+ LyXAlignment alignment;
///
- int valignment;
+ VAlignment valignment;
///
bool top_line;
///
///
bool right_line;
///
- int usebox;
+ BoxType usebox;
///
bool rotate;
///
///
columnstruct();
///
- int alignment;
+ LyXAlignment alignment;
///
- int valignment;
+ VAlignment valignment;
///
bool left_line;
///
///
int numberofcells;
///
- int * rowofcell;
+ std::vector<int> rowofcell;
///
- int * columnofcell;
+ std::vector<int> columnofcell;
///
row_vector row_info;
///
///
void Reinit();
///
- void set_row_column_number_info();
+ void set_row_column_number_info(bool oldformat = false);
/// Returns true if a complete update is necessary, otherwise false
bool SetWidthOfMulticolCell(int cell, int new_width);
+ ///
void recalculateMulticolCells(int cell, int new_width);
/// Returns true if change
bool calculate_width_of_column(int column);
///
int cells_in_multicolumn(int cell) const;
///
- bool UseParbox(int cell) const;
+ BoxType UseParbox(int cell) const;
};
#endif