X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathGrid.h;h=7ff533be998e4f978b16d500c3e9cb95c3a39434;hb=704328d3488c75733ddeb9ad5439b1907e323e39;hp=da309998d19142ba8128a23bac9f322257ce8dfc;hpb=97aa558caca65a79a6fd57504564b51819f8cd79;p=lyx.git diff --git a/src/mathed/InsetMathGrid.h b/src/mathed/InsetMathGrid.h index da309998d1..7ff533be99 100644 --- a/src/mathed/InsetMathGrid.h +++ b/src/mathed/InsetMathGrid.h @@ -4,7 +4,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author André Pönitz + * \author André Pönitz * * Full author contact details are available in file CREDITS. */ @@ -49,7 +49,7 @@ public: /// RowInfo(); /// - int skipPixels() const; + int skipPixels(MetricsInfo const & mi) const; /// cached descent mutable int descent_; /// cached ascent @@ -73,8 +73,6 @@ public: ColInfo(); /// currently possible: 'l', 'c', 'r' char align_; - /// cache for drawing - int h_offset; /// cached width mutable int width_; /// cached offset @@ -91,14 +89,13 @@ public: }; public: - /// sets nrows and ncols to 1 - InsetMathGrid(); - /// constructor from columns description, creates one row - InsetMathGrid(char valign, docstring const & halign); + /// sets nrows and ncols to 1, vertical alingment to 'c' + InsetMathGrid(Buffer * buf); /// Note: columns first! - InsetMathGrid(col_type m, row_type n); + InsetMathGrid(Buffer * buf, col_type m, row_type n); /// - InsetMathGrid(col_type m, row_type n, char valign, docstring const & halign); + InsetMathGrid(Buffer * buf, col_type m, row_type n, char valign, + docstring const & halign); /// void metrics(MetricsInfo & mi, Dimension &) const; /// @@ -114,17 +111,21 @@ public: /// void drawT(TextPainter & pi, int x, int y) const; /// - void halign(docstring const & align); - /// - void halign(char c, col_type col); + void updateBuffer(ParIterator const &, UpdateType); + /// extract number of columns from alignment string + static col_type guessColumns(docstring const & halign); + /// accepts some LaTeX column codes: p,m,!,@,M,<,> + void setHorizontalAlignments(docstring const & align); /// - char halign(col_type col) const; + void setHorizontalAlignment(char c, col_type col); /// - docstring halign() const; + char horizontalAlignment(col_type col) const; /// - void valign(char c); + docstring horizontalAlignments() const; + /// 't', 'b', or 'm' + void setVerticalAlignment(char c); /// - char valign() const; + char verticalAlignment() const; /// void vcrskip(Length const &, row_type row); /// @@ -184,8 +185,6 @@ public: /// swap two columns virtual void swapCol(col_type c); /// - virtual void appendRow(); - /// idx_type index(row_type r, col_type c) const; /// bool idxBetween(idx_type idx, idx_type from, idx_type to) const; @@ -195,6 +194,8 @@ public: virtual char defaultColAlign(col_type) { return 'c'; } /// void setDefaults(); + /// + virtual bool interpretString(Cursor & cur, docstring const & str); /// virtual int colsep() const; @@ -210,16 +211,25 @@ public: /// void write(WriteStream & os) const; /// + void write(WriteStream & os, + row_type beg_row, col_type beg_col, + row_type end_row, col_type end_col) const; + /// void normalize(NormalStream &) const; /// //void maple(MapleStream &) const; /// void mathmlize(MathStream &) const; + /// + void htmlize(HtmlStream &) const; + /// + void htmlize(HtmlStream &, std::string attrib) const; /// //void octave(OctaveStream &) const; protected: - virtual void doDispatch(Cursor & cur, FuncRequest & cmd); + /// + void doDispatch(Cursor & cur, FuncRequest & cmd); /// bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus & flag) const; @@ -228,14 +238,16 @@ protected: /// returns y offset of cell compared to inset int cellYOffset(idx_type idx) const; /// returns proper 'end of line' code for LaTeX - virtual docstring eolString(row_type row, bool emptyline, - bool fragile) const; + virtual docstring eolString(row_type row, bool fragile, bool latex, + bool last_eoln) const; /// returns proper 'end of column' code for LaTeX virtual docstring eocString(col_type col, col_type lastcol) const; - /// extract number of columns from alignment string - col_type guessColumns(docstring const & halign) const; /// splits cells and shifts right part to the next cell void splitCell(Cursor & cur); + /// Column aligmment for display of cell at (\p row, \p col). + /// Must not be written to file! + virtual char displayColAlign(col_type col, row_type) const { return colinfo_[col].align_; } + /// row info. /// rowinfo_[nrows()] is a dummy row used only for hlines. @@ -246,12 +258,16 @@ protected: /// cell info std::vector cellinfo_; /// - char v_align_; // add approp. type + InsetCode lyxCode() const { return MATH_GRID_CODE; } + private: - virtual Inset * clone() const; + /// + char v_align_; // add approp. type + /// + Inset * clone() const; }; - } // namespace lyx + #endif