class Buffer;
class BufferParams;
class Paragraph;
+class CompletionList;
class CursorSlice;
namespace frontend { class Painter; }
/// constructor
Tabular();
/// constructor
- Tabular(BufferParams const &, col_type columns_arg,
- row_type rows_arg);
+ Tabular(Buffer const &, col_type columns_arg, row_type rows_arg);
/// Returns true if there is a topline, returns false if not
bool topLine(idx_type cell, bool wholerow = false) const;
///
int getBeginningOfTextInCell(idx_type cell) const;
///
- void appendRow(BufferParams const &, idx_type cell);
+ void appendRow(idx_type cell);
///
void deleteRow(row_type row);
///
- void copyRow(BufferParams const &, row_type);
+ void copyRow(row_type);
///
- void appendColumn(BufferParams const &, idx_type cell);
+ void appendColumn(idx_type cell);
///
void deleteColumn(col_type column);
///
- void copyColumn(BufferParams const &, col_type);
+ void copyColumn(col_type);
///
bool isFirstCellInRow(idx_type cell) const;
///
///
idx_type numberOfCellsInRow(idx_type cell) const;
///
- void write(Buffer const &, std::ostream &) const;
+ void write(std::ostream &) const;
///
- void read(Buffer const &, Lexer &);
+ void read(Lexer &);
///
- int latex(Buffer const &, odocstream &, OutputParams const &) const;
+ int latex(odocstream &, OutputParams const &) const;
//
- int docbook(Buffer const & buf, odocstream & os, OutputParams const &) const;
+ int docbook(odocstream & os, OutputParams const &) const;
///
- void plaintext(Buffer const &, odocstream &,
+ void plaintext(odocstream &,
OutputParams const & runparams, int const depth,
bool onlydata, char_type delim) const;
///
///
bool isMultiColumnReal(idx_type cell) const;
///
- void setMultiColumn(Buffer *, idx_type cell, idx_type number);
+ void setMultiColumn(idx_type cell, idx_type number);
///
idx_type unsetMultiColumn(idx_type cell); // returns number of new cells
///
///
//private:
///
- class cellstruct {
+ class CellData {
public:
///
- cellstruct(BufferParams const &);
+ CellData(Buffer const &);
///
- cellstruct(cellstruct const &);
+ CellData(CellData const &);
///
- cellstruct & operator=(cellstruct);
+ CellData & operator=(CellData);
///
- void swap(cellstruct & rhs);
+ void swap(CellData & rhs);
///
idx_type cellno;
///
///
boost::shared_ptr<InsetText> inset;
};
- cellstruct & cellinfo_of_cell(idx_type cell) const;
+ CellData & cellinfo_of_cell(idx_type cell) const;
///
- typedef std::vector<cellstruct> cell_vector;
+ typedef std::vector<CellData> cell_vector;
///
typedef std::vector<cell_vector> cell_vvector;
///
- class rowstruct {
+ class RowData {
public:
///
- rowstruct();
+ RowData();
///
int ascent;
///
bool newpage;
};
///
- typedef std::vector<rowstruct> row_vector;
+ typedef std::vector<RowData> row_vector;
///
- class columnstruct {
+ class ColumnData {
public:
///
- columnstruct();
+ ColumnData();
///
LyXAlignment alignment;
///
docstring align_special;
};
///
- typedef std::vector<columnstruct> column_vector;
+ typedef std::vector<ColumnData> column_vector;
///
idx_type numberofcells;
ltType endlastfoot;
///
- void init(BufferParams const &, row_type rows_arg,
+ void init(Buffer const &, row_type rows_arg,
col_type columns_arg);
///
void updateIndexes();
///
int TeXCellPostamble(odocstream &, idx_type cell) const;
///
- int TeXLongtableHeaderFooter(odocstream &, Buffer const & buf,
- OutputParams const &) const;
+ int TeXLongtableHeaderFooter(odocstream &, OutputParams const &) const;
///
bool isValidRow(row_type const row) const;
///
- int TeXRow(odocstream &, row_type const row, Buffer const & buf,
+ int TeXRow(odocstream &, row_type const row,
OutputParams const &) const;
///
// helper functions for plain text
bool plaintextBottomHLine(odocstream &, row_type row,
std::vector<unsigned int> const &) const;
///
- void plaintextPrintCell(Buffer const &, odocstream &,
+ void plaintextPrintCell(odocstream &,
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;
+ int docbookRow(odocstream & os, row_type, OutputParams const &) const;
+
+ /// change associated Buffer
+ void setBuffer(Buffer const & buffer) { buffer_ = &buffer; }
+ /// retrieve associated Buffer
+ Buffer const & buffer() const { return *buffer_; }
private:
+ Buffer const * buffer_;
+
/// renumber cells after structural changes
void fixCellNums();
};
///
~InsetTabular();
///
- void read(Buffer const &, Lexer &);
+ void read(Lexer &);
///
- void write(Buffer const &, std::ostream &) const;
+ void write(std::ostream &) const;
///
void metrics(MetricsInfo &, Dimension &) const;
///
///
void drawSelection(PainterInfo & pi, int x, int y) const;
///
- virtual docstring const editMessage() const;
+ docstring editMessage() const;
///
EDITABLE editable() const { return HIGHLY_EDITABLE; }
///
///
DisplayType display() const { return tabular.isLongTabular() ? AlignCenter : Inline; }
///
- int latex(Buffer const &, odocstream &,
- OutputParams const &) const;
+ int latex(odocstream &, OutputParams const &) const;
///
- int plaintext(Buffer const &, odocstream &,
- OutputParams const &) const;
+ int plaintext(odocstream &, OutputParams const &) const;
///
- int docbook(Buffer const &, odocstream &,
- OutputParams const &) const;
+ int docbook(odocstream &, OutputParams const &) const;
///
void validate(LaTeXFeatures & features) const;
///
///
void addPreview(graphics::PreviewLoader &) const;
- ///
- Buffer const & buffer() const;
-
- /// set the owning buffer
- void buffer(Buffer const * buf);
/// lock cell with given index
void edit(Cursor & cur, bool front, EntryDirection entry_from);
///
/// can we go further down on mouse click?
bool descendable() const { return true; }
// Update the counters of this inset and of its contents
- virtual void updateLabels(Buffer const &, ParIterator const &);
+ void updateLabels(ParIterator const &);
+
+ ///
+ bool completionSupported(Cursor const &) const;
+ ///
+ bool inlineCompletionSupported(Cursor const & cur) const;
+ ///
+ bool automaticInlineCompletion() const;
+ ///
+ bool automaticPopupCompletion() const;
+ ///
+ bool showCompletionCursor() const;
+ ///
+ CompletionList const * createCompletionList(Cursor const & cur) const;
+ ///
+ docstring completionPrefix(Cursor const & cur) const;
+ ///
+ bool insertCompletion(Cursor & cur, docstring const & s, bool finished);
+ ///
+ void completionPosAndDim(Cursor const &, int & x, int & y, Dimension & dim) const;
//
// Public structures and variables
///
mutable Tabular tabular;
-protected:
+private:
///
InsetTabular(InsetTabular const &);
///
- virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
+ void doDispatch(Cursor & cur, FuncRequest & cmd);
///
bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
///
int scroll() const { return scx_; }
-
-private:
- virtual Inset * clone() const;
+ ///
+ Inset * clone() const { return new InsetTabular(*this); }
///
void drawCellLines(frontend::Painter &, int x, int y, row_type row,
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_;