]> git.lyx.org Git - lyx.git/blobdiff - src/tabular.h
next step...
[lyx.git] / src / tabular.h
index 5af58996edc2a3c3448dfc4e3faa8276a46924dc..b434ab4a9538b067232f4ff15816ace4a53e33f6 100644 (file)
@@ -4,7 +4,7 @@
  * 
  *           LyX, The Document Processor
  *      
- *           Copyright 2000 The LyX Team.
+ *           Copyright 2000-2001 The LyX Team.
  *
  *           @author: Jürgen Vigna
  *
@@ -108,12 +108,16 @@ public:
                SET_USEBOX,
                ///
                SET_LTHEAD,
+               UNSET_LTHEAD,
                ///
                SET_LTFIRSTHEAD,
+               UNSET_LTFIRSTHEAD,
                ///
                SET_LTFOOT,
+               UNSET_LTFOOT,
                ///
                SET_LTLASTFOOT,
+               UNSET_LTLASTFOOT,
                ///
                SET_LTNEWPAGE,
                ///
@@ -152,6 +156,19 @@ public:
                BOX_MINIPAGE = 2
        };
 
+       struct lttype {
+               // constructor
+               lttype();
+               // row of the header/footer type end definition
+               int row;
+               // double borders on top
+               bool topDL;
+               // double borders on bottom
+               bool bottomDL;
+       };
+       ///
+       typedef struct lttype ltType;
+       
        /* konstruktor */
        ///
        LyXTabular(InsetTabular *, int columns_arg, int rows_arg);
@@ -163,7 +180,7 @@ public:
        ///
        LyXTabular & operator=(LyXTabular const &);
        ///
-       LyXTabular * Clone(InsetTabular *);
+       LyXTabular * clone(InsetTabular *);
        
        /// Returns true if there is a topline, returns false if not
        bool TopLine(int cell, bool onlycolumn = false) const;
@@ -180,9 +197,9 @@ public:
        bool LeftAlreadyDrawed(int cell) const;
        ///
        bool IsLastRow(int cell) const;
-       
+
        ///
-       int GetAdditionalHeight(int cell) const;
+       int GetAdditionalHeight(int row) const;
        ///
        int GetAdditionalWidth(int cell) const;
        
@@ -206,17 +223,19 @@ public:
        /// Returns true if a complete update is necessary, otherwise false
        bool SetAllLines(int cell, bool line);
        /// Returns true if a complete update is necessary, otherwise false
-       bool SetTopLine(int cell, bool line, bool onlycolumn=false);
+       bool SetTopLine(int cell, bool line, bool onlycolumn = false);
        /// Returns true if a complete update is necessary, otherwise false
-       bool SetBottomLine(int cell, bool line, bool onlycolumn=false);
+       bool SetBottomLine(int cell, bool line, bool onlycolumn = false);
        /// Returns true if a complete update is necessary, otherwise false
-       bool SetLeftLine(int cell, bool line, bool onlycolumn=false);
+       bool SetLeftLine(int cell, bool line, bool onlycolumn = false);
        /// Returns true if a complete update is necessary, otherwise false
-       bool SetRightLine(int cell, bool line, bool onlycolumn=false);
+       bool SetRightLine(int cell, bool line, bool onlycolumn = false);
        /// Returns true if a complete update is necessary, otherwise false
-       bool SetAlignment(int cell, LyXAlignment align, bool onlycolumn = false);
+       bool SetAlignment(int cell, LyXAlignment align,
+                         bool onlycolumn = false);
        /// Returns true if a complete update is necessary, otherwise false
-       bool SetVAlignment(int cell, VAlignment align, bool onlycolumn = false);
+       bool SetVAlignment(int cell, VAlignment align,
+                          bool onlycolumn = false);
        ///
        bool SetColumnPWidth(int cell, string const & width);
        ///
@@ -277,19 +296,22 @@ public:
        int TeXCellPostamble(std::ostream &, int cell) const;
        ///
        int Latex(Buffer const *, std::ostream &, bool, bool) const;
+       /// auxiliary function for docbook rows
+       int docbookRow(Buffer const * buf, std::ostream & os, int row) const;
        ///
        int DocBook(Buffer const * buf, std::ostream & os) const;
        ///
        // helper function for Latex returns number of newlines
        ///
        int AsciiTopHLine(std::ostream &, int row,
-                                         std::vector<unsigned int> const &) const;
+                         std::vector<unsigned int> const &) const;
        ///
        int AsciiBottomHLine(std::ostream &, int row,
-                                                std::vector<unsigned int> const &) const;
+                            std::vector<unsigned int> const &) const;
        ///
-       int AsciiPrintCell(Buffer const *, std::ostream &, int cell, int row,
-                                          int column, std::vector<unsigned int> const &) const;
+       int AsciiPrintCell(Buffer const *, std::ostream &,
+                          int cell, int row, int column,
+                          std::vector<unsigned int> const &) const;
        ///
        int Ascii(Buffer const *, std::ostream &) const;
        ///
@@ -339,17 +361,19 @@ public:
        //
        // Long Tabular Options
        ///
-       void SetLTHead(int cell, bool first);
+       bool checkLTType(int row, ltType const &) const;
        ///
-       bool GetRowOfLTHead(int cell, int & row) const;
+       void SetLTHead(ltType const &, bool first);
        ///
-       bool GetRowOfLTFirstHead(int cell, int & row) const;
+       bool GetRowOfLTHead(int row, ltType &) const;
        ///
-       void SetLTFoot(int cell, bool last);
+       bool GetRowOfLTFirstHead(int row, ltType &) const;
        ///
-       bool GetRowOfLTFoot(int cell, int & row) const;
+       void SetLTFoot(ltType const &, bool last);
        ///
-       bool GetRowOfLTLastFoot(int cell, int & row) const;
+       bool GetRowOfLTFoot(int row, ltType &) const;
+       ///
+       bool GetRowOfLTLastFoot(int row, ltType &) const;
        ///
        void SetLTNewPage(int cell, bool what);
        ///
@@ -366,8 +390,11 @@ public:
        InsetTabular * owner() const { return owner_; }
        ///
        void Validate(LaTeXFeatures &) const;
-
-private: //////////////////////////////////////////////////////////////////
+       ///
+       std::vector<string> const getLabelList() const;
+       ///
+       mutable int cur_cell;
+private:
        ///
        struct cellstruct {
                ///
@@ -477,18 +504,18 @@ private: //////////////////////////////////////////////////////////////////
        ///
        bool is_long_tabular;
        /// row of endhead
-       int endhead;
+       ltType endhead;
        /// row of endfirsthead
-       int endfirsthead;
+       ltType endfirsthead;
        /// row of endfoot
-       int endfoot;
+       ltType endfoot;
        /// row of endlastfoot
-       int endlastfoot;
+       ltType endlastfoot;
        ///
        InsetTabular * owner_;
-   
+
        ///
-       void Init(int columns_arg, int rows_arg);
+       void Init(int columns_arg, int rows_arg, LyXTabular const * lt = 0);
        ///
        void Reinit();
        ///