#include "Inset.h"
#include "MailInset.h"
-#include "LyXLength.h"
+#include "Length.h"
#include "InsetText.h"
//
// A helper struct for tables
-//
+//
class Tabular {
public:
///
///
UNSET_ROTATE_TABULAR,
///
+ TOGGLE_ROTATE_TABULAR,
+ ///
SET_ROTATE_CELL,
///
UNSET_ROTATE_CELL,
///
+ TOGGLE_ROTATE_CELL,
+ ///
SET_USEBOX,
///
SET_LTHEAD,
void setVAlignment(idx_type cell, VAlignment align,
bool onlycolumn = false);
///
- void setColumnPWidth(Cursor &, idx_type, LyXLength const &);
+ void setColumnPWidth(Cursor &, idx_type, Length const &);
///
- bool setMColumnPWidth(Cursor &, idx_type, LyXLength const &);
+ bool setMColumnPWidth(Cursor &, idx_type, Length const &);
///
void setAlignSpecial(idx_type cell, docstring const & special,
Feature what);
VAlignment getVAlignment(idx_type cell,
bool onlycolumn = false) const;
///
- LyXLength const getPWidth(idx_type cell) const;
+ Length const getPWidth(idx_type cell) const;
///
- LyXLength const getColumnPWidth(idx_type cell) const;
+ Length const getColumnPWidth(idx_type cell) const;
///
- LyXLength const getMColumnPWidth(idx_type cell) const;
+ Length const getMColumnPWidth(idx_type cell) const;
///
docstring const getAlignSpecial(idx_type cell, int what) const;
///
int docbook(Buffer const & buf, odocstream & os, OutputParams const &) const;
///
void plaintext(Buffer const &, odocstream &,
- OutputParams const & runparams, int const depth,
- bool onlydata, unsigned char delim) const;
+ OutputParams const & runparams, int const depth,
+ bool onlydata, unsigned char delim) const;
///
bool isMultiColumn(idx_type cell) const;
///
boost::shared_ptr<InsetText>) const;
/// Search for \param inset in the tabular, with the
///
- idx_type getCellFromInset(InsetBase const * inset) const;
+ idx_type getCellFromInset(Inset const * inset) const;
///
row_type rows() const { return rows_; }
///
///
docstring align_special;
///
- LyXLength p_width; // this is only set for multicolumn!!!
+ Length p_width; // this is only set for multicolumn!!!
///
boost::shared_ptr<InsetText> inset;
};
///
bool bottom_line;
/// Extra space between the top line and this row
- LyXLength top_space;
+ Length top_space;
/// Ignore top_space if true and use the default top space
bool top_space_default;
/// Extra space between this row and the bottom line
- LyXLength bottom_space;
+ Length bottom_space;
/// Ignore bottom_space if true and use the default bottom space
bool bottom_space_default;
/// Extra space between the bottom line and the next top line
- LyXLength interline_space;
+ Length interline_space;
/// Ignore interline_space if true and use the default interline space
bool interline_space_default;
/// This are for longtabulars only
///
int width_of_column;
///
- LyXLength p_width;
+ Length p_width;
///
docstring align_special;
};
// helper functions for plain text
///
bool plaintextTopHLine(odocstream &, row_type row,
- std::vector<unsigned int> const &) const;
+ std::vector<unsigned int> const &) const;
///
bool plaintextBottomHLine(odocstream &, row_type row,
- std::vector<unsigned int> const &) const;
+ std::vector<unsigned int> const &) const;
///
void plaintextPrintCell(Buffer const &, odocstream &,
- OutputParams const &,
- idx_type cell, row_type row, col_type column,
- std::vector<unsigned int> const &,
- bool onlydata) const;
+ OutputParams const &,
+ idx_type cell, row_type row, col_type column,
+ std::vector<unsigned int> const &,
+ bool onlydata) const;
/// auxiliary function for docbook
int docbookRow(Buffer const & buf, odocstream & os, row_type,
OutputParams const &) const;
-class InsetTabular : public InsetOld {
+class InsetTabular : public Inset {
public:
///
InsetTabular(Buffer const &, row_type rows = 1,
///
EDITABLE editable() const { return HIGHLY_EDITABLE; }
///
- bool insetAllowed(InsetBase::Code) const { return true; }
+ bool insetAllowed(Inset::Code) const { return true; }
///
bool allowSpellCheck() const { return true; }
///
insets that may contain several paragraphs */
bool noFontChange() const { return true; }
///
- bool display() const { return tabular.isLongTabular(); }
+ DisplayType display() const { return tabular.isLongTabular() ? AlignCenter : Inline; }
///
int latex(Buffer const &, odocstream &,
- OutputParams const &) const;
+ OutputParams const &) const;
///
int plaintext(Buffer const &, odocstream &,
- OutputParams const &) const;
+ OutputParams const &) const;
///
int docbook(Buffer const &, odocstream &,
- OutputParams const &) const;
+ OutputParams const &) const;
///
void validate(LaTeXFeatures & features) const;
///
- Code lyxCode() const { return InsetBase::TABULAR_CODE; }
+ Code lyxCode() const { return Inset::TABULAR_CODE; }
/// get offset of this cursor slice relative to our upper left corner
void cursorPos(BufferView const & bv, CursorSlice const & sl,
bool boundary, int & x, int & y) const;
///
boost::shared_ptr<InsetText> cell(idx_type);
///
- LyXText * getText(int) const;
+ Text * getText(int) const;
/// set the change for the entire inset
void setChange(Change const & change);
/// lock cell with given index
void edit(Cursor & cur, bool left);
///
- InsetBase * editXY(Cursor & cur, int x, int y);
+ Inset * editXY(Cursor & cur, int x, int y);
/// can we go further down on mouse click?
bool descendable() const { return true; }
int scroll() const { return scx_; }
private:
- virtual std::auto_ptr<InsetBase> doClone() const;
+ virtual std::auto_ptr<Inset> doClone() const;
///
void drawCellLines(frontend::Painter &, int x, int y, row_type row,
/// return the cell nearest to x, y
idx_type getNearestCell(BufferView &, int x, int y) const;
+ /// test the rotation state of the give cell range.
+ bool oneCellHasRotationState(bool rotated,
+ row_type row_start, row_type row_end,
+ col_type col_start, col_type col_end) const;
///
Buffer const * buffer_;
///
mutable idx_type first_visible_cell;
///
mutable int scx_;
- /// Ugly boolean used when this inset is dissolved and
- /// InsetTabularMailer should not be used.
- bool is_deleted_;
};
///
InsetTabularMailer(InsetTabular const & inset);
///
- virtual InsetBase & inset() const { return inset_; }
+ virtual Inset & inset() const { return inset_; }
///
virtual std::string const & name() const { return name_; }
///