]> git.lyx.org Git - lyx.git/blobdiff - src/tabular.h
fix reading the author field.
[lyx.git] / src / tabular.h
index 211daf0b4f627a93221c0dea631c32a9726aef4e..b2cccd45811ed9dd40b60aaef6e0f145ef0ddd00 100644 (file)
@@ -22,7 +22,7 @@
 #include <vector>
 
 class InsetTabular;
-class LatexRunParams;
+class OutputParams;
 
 /* The features the text class offers for tables */
 
@@ -171,14 +171,7 @@ public:
        };
 
        /// constructor
-       LyXTabular(BufferParams const &,
-                  InsetTabular *, int columns_arg, int rows_arg);
-       /// sort of copy constructor
-       LyXTabular(BufferParams const &,
-                  InsetTabular *, LyXTabular const &);
-       ///
-       explicit
-       LyXTabular(Buffer const &, InsetTabular *, LyXLex & lex);
+       LyXTabular(BufferParams const &, int columns_arg, int rows_arg);
 
        /// Returns true if there is a topline, returns false if not
        bool topLine(int cell, bool onlycolumn = false) const;
@@ -212,11 +205,11 @@ public:
        int getDescentOfRow(int row) const;
        ///
        int getHeightOfTabular() const;
-       /// Returns true if a complete update is necessary, otherwise false
+       /// 
        void setAscentOfRow(int row, int height);
-       /// Returns true if a complete update is necessary, otherwise false
+       /// 
        void setDescentOfRow(int row, int height);
-       /// Returns true if a complete update is necessary, otherwise false
+       /// 
        void setWidthOfCell(int cell, int new_width);
        ///
        void setAllLines(int cell, bool line);
@@ -239,7 +232,7 @@ public:
        ///
        bool setMColumnPWidth(int cell, LyXLength const & width);
        ///
-       void setAlignSpecial(int cell, string const & special, Feature what);
+       void setAlignSpecial(int cell, std::string const & special, Feature what);
        ///
        LyXAlignment getAlignment(int cell, bool onlycolumn = false) const;
        ///
@@ -251,7 +244,7 @@ public:
        ///
        LyXLength const getMColumnPWidth(int cell) const;
        ///
-       string const getAlignSpecial(int cell, int what) const;
+       std::string const getAlignSpecial(int cell, int what) const;
        ///
        int getWidthOfCell(int cell) const;
        ///
@@ -282,16 +275,22 @@ public:
        void read(Buffer const &, LyXLex &);
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        //
-       int linuxdoc(Buffer const & buf, std::ostream & os) const;
+       int linuxdoc(Buffer const & buf, std::ostream & os,
+                    OutputParams const &) const;
        ///
-       int docbook(Buffer const & buf, std::ostream & os, bool mixcont) const;
+       int docbook(Buffer const & buf, std::ostream & os,
+                   OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &, int const depth,
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const & runparams,
+                 int const depth,
                  bool onlydata, unsigned char delim) const;
        ///
-       bool isMultiColumn(int cell, bool real = false) const;
+       bool isMultiColumn(int cell) const;
+       ///
+       bool isMultiColumnReal(int cell) const;
        ///
        void setMultiColumn(Buffer *, int cell, int number);
        ///
@@ -369,8 +368,8 @@ public:
        ///
        InsetText & getCellInset(int row, int column) const;
        /// Search for \param inset in the tabular, with the
-       /// additional hint that it could be at \param maybe_cell
-       int getCellFromInset(InsetOld const * inset, int maybe_cell = -1) const;
+       ///
+       int getCellFromInset(InsetBase const * inset) const;
        ///
        int rows() const { return rows_; }
        ///
@@ -378,14 +377,9 @@ public:
        ///
        void validate(LaTeXFeatures &) const;
        /// Appends \c list with all labels found within this inset.
-       void getLabelList(Buffer const &, std::vector<string> & list) const;
-       ///
-       /// recalculate the widths/heights only!
-       void reinit();
+       void getLabelList(Buffer const &, std::vector<std::string> & list) const;
        ///
 //private:
-       ///
-       mutable int cur_cell;
        ///
        struct cellstruct {
                ///
@@ -413,7 +407,7 @@ public:
                ///
                bool rotate;
                ///
-               string align_special;
+               std::string align_special;
                ///
                LyXLength p_width; // this is only set for multicolumn!!!
                ///
@@ -469,7 +463,7 @@ public:
                ///
                LyXLength p_width;
                ///
-               string align_special;
+               std::string align_special;
        };
        ///
        typedef std::vector<columnstruct> column_vector;
@@ -506,17 +500,11 @@ public:
        ltType endfoot;
        /// endlastfoot data
        ltType endlastfoot;
-       //
-       ///
-       InsetTabular * owner_;
 
        ///
-       void init(BufferParams const &,
-                 int columns_arg, int rows_arg, LyXTabular const * lt = 0);
+       void init(BufferParams const &, int rows_arg, int columns_arg);
        ///
-       void Reinit(bool reset_widths = true);
-       ///
-       void set_row_column_number_info(bool oldformat = false);
+       void set_row_column_number_info();
        /// Returns true if a complete update is necessary, otherwise false
        bool setWidthOfMulticolCell(int cell, int new_width);
        ///
@@ -547,12 +535,12 @@ public:
        int TeXCellPostamble(std::ostream &, int cell) const;
        ///
        int TeXLongtableHeaderFooter(std::ostream &, Buffer const & buf,
-                                    LatexRunParams const &) const;
+                                    OutputParams const &) const;
        ///
        bool isValidRow(int const row) const;
        ///
        int TeXRow(std::ostream &, int const row, Buffer const & buf,
-                  LatexRunParams const &) const;
+                  OutputParams const &) const;
        ///
        // helper function for ASCII returns number of newlines
        ///
@@ -563,11 +551,17 @@ public:
                             std::vector<unsigned int> const &) const;
        ///
        int asciiPrintCell(Buffer const &, std::ostream &,
+                          OutputParams const &,
                           int cell, int row, int column,
                           std::vector<unsigned int> const &,
                                           bool onlydata) const;
        /// auxiliary function for docbook
-       int docbookRow(Buffer const & buf, std::ostream & os, int row) const;
+       int docbookRow(Buffer const & buf, std::ostream & os, int,
+                      OutputParams const &) const;
+
+private:
+       /// renumber cells after structural changes
+       void fixCellNums();
 };
 
 #endif