*/
-// This is the rewrite of the tabular (table) support.
-
-// Ideally the tabular support should do as the mathed and use
-// LaTeX in the .lyx file too.
+// This is Juergen's rewrite of the tabular (table) support.
// Things to think of when designing the new tabular support:
// - color support (colortbl, color)
// This is what I have written about tabular support in the LyX3-Tasks file:
//
// o rewrite of table code. Should probably be written as some
-// kind of an inset. At least get the code out of the kernel.
-// - colortbl -multirow
-// - hhline -multicolumn
-// - dcolumn
+// kind of an inset. [Done]
// o enhance longtable support
// Lgb
///
InsetTabular(Buffer const &, int rows = 1, int columns = 1);
///
- InsetTabular(InsetTabular const &);
- ///
~InsetTabular();
///
- virtual std::auto_ptr<InsetBase> clone() const;
- ///
void read(Buffer const &, LyXLex &);
///
void write(Buffer const &, std::ostream &) const;
///
std::string const editMessage() const;
///
- bool insetAllowed(InsetOld::Code) const { return true; }
+ bool insetAllowed(InsetBase::Code) const { return true; }
///
bool isTextInset() const { return true; }
/** returns true if, when outputing LaTeX, font changes should
///
void validate(LaTeXFeatures & features) const;
///
- Code lyxCode() const { return InsetOld::TABULAR_CODE; }
+ Code lyxCode() const { return InsetBase::TABULAR_CODE; }
/// get the absolute screen x,y of the cursor
void getCursorPos(LCursor const & cur, int & x, int & y) const;
///
/// number of cells
size_t nargs() const;
///
- InsetText const & cell(int) const;
+ boost::shared_ptr<InsetText const> cell(int) const;
///
- InsetText & cell(int);
+ boost::shared_ptr<InsetText> cell(int);
///
LyXText * getText(int) const;
mutable LyXTabular tabular;
protected:
- ///
- void priv_dispatch(LCursor & cur, FuncRequest & cmd);
+ InsetTabular(InsetTabular const &);
+
+ virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
+
///
bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus &) const;
private:
+ virtual std::auto_ptr<InsetBase> doClone() const;
+
///
void drawCellLines(Painter &, int x, int baseline,
int row, int cell) const;
virtual std::string const & name() const { return name_; }
///
virtual std::string const inset2string(Buffer const &) const;
- /// Returns the active cell if successful, else -1.
- static int string2params(std::string const &, InsetTabular &);
+ ///
+ static void string2params(std::string const &, InsetTabular &);
///
static std::string const params2string(InsetTabular const &);
private: