X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsettabular.h;h=b6a6f93970afbe7cb5beb1799c06f86e05c2b3eb;hb=10ba1b8918e7da14334bb5573ce2a707671c8b51;hp=9d4a7eac5097114aa7af666790df5f841da50d45;hpb=357a3741c0655e174ad48ded68cca90b09a158e6;p=lyx.git diff --git a/src/insets/insettabular.h b/src/insets/insettabular.h index 9d4a7eac50..b6a6f93970 100644 --- a/src/insets/insettabular.h +++ b/src/insets/insettabular.h @@ -10,10 +10,7 @@ */ -// 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) @@ -27,10 +24,7 @@ // 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 @@ -56,12 +50,8 @@ public: /// InsetTabular(Buffer const &, int rows = 1, int columns = 1); /// - InsetTabular(InsetTabular const &); - /// ~InsetTabular(); /// - virtual std::auto_ptr clone() const; - /// void read(Buffer const &, LyXLex &); /// void write(Buffer const &, std::ostream &) const; @@ -72,7 +62,7 @@ public: /// 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 @@ -96,9 +86,9 @@ public: /// void validate(LaTeXFeatures & features) const; /// - InsetOld::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(CursorSlice const & cur, int & x, int & y) const; + void getCursorPos(LCursor const & cur, int & x, int & y) const; /// bool tabularFeatures(LCursor & cur, std::string const & what); /// @@ -108,17 +98,14 @@ public: void openLayoutDialog(BufferView *) const; /// bool showInsetDialog(BufferView *) const; - /// - FuncStatus getStatus(BufferView &, - std::string const & argument, int cell) const; /// Appends \c list with all labels found within this inset. void getLabelList(Buffer const &, std::vector & list) const; /// number of cells size_t nargs() const; /// - InsetText const & cell(int) const; + boost::shared_ptr cell(int) const; /// - InsetText & cell(int); + boost::shared_ptr cell(int); /// LyXText * getText(int) const; @@ -136,11 +123,11 @@ public: Buffer const & buffer() const; /// set the owning buffer - void buffer(Buffer * buf); + void buffer(Buffer const * buf); /// lock cell with given index void edit(LCursor & cur, bool left); /// - InsetBase * editXY(LCursor & cur, int x, int y); + InsetBase * editXY(LCursor & cur, int x, int y) const; /// can we go further down on mouse click? bool descendable() const { return true; } @@ -150,9 +137,15 @@ public: mutable LyXTabular tabular; protected: + InsetTabular(InsetTabular const &); + + virtual void doDispatch(LCursor & cur, FuncRequest & cmd); + /// - void priv_dispatch(LCursor & cur, FuncRequest const & cmd); + bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus &) const; private: + virtual std::auto_ptr doClone() const; + /// void drawCellLines(Painter &, int x, int baseline, int row, int cell) const; @@ -181,7 +174,7 @@ private: /// void cutSelection(LCursor & cur); /// - bool isRightToLeft(LCursor & cur); + bool isRightToLeft(LCursor & cur) const; /// void getSelection(LCursor & cur, int & rs, int & re, int & cs, int & ce) const; @@ -212,8 +205,8 @@ public: 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: