]> git.lyx.org Git - lyx.git/blobdiff - src/tabular.h
minimal effort implementation of:
[lyx.git] / src / tabular.h
index b7e1dc8de33234590f5dd66da6f625fabc15f7bb..6b2fb6afde9a3be5e239dc8f14314500a46f90ae 100644 (file)
@@ -24,6 +24,7 @@
 #include <vector>
 
 class InsetTabular;
+class LCursor;
 class OutputParams;
 
 /* The features the text class offers for tables */
@@ -126,6 +127,16 @@ public:
                ///
                SET_SPECIAL_MULTI,
                ///
+               SET_BOOKTABS,
+               ///
+               UNSET_BOOKTABS,
+               ///
+               SET_TOP_SPACE,
+               ///
+               SET_BOTTOM_SPACE,
+               ///
+               SET_INTERLINE_SPACE,
+               ///
                LAST_ACTION
        };
        ///
@@ -157,7 +168,8 @@ public:
                BOX_MINIPAGE = 2
        };
 
-       struct ltType {
+       class ltType {
+       public:
                // constructor
                ltType();
                // we have this header type (is set in the getLT... functions)
@@ -183,7 +195,7 @@ public:
 
        /// constructor
        LyXTabular(BufferParams const &, col_type columns_arg,
-                  row_type rows_arg);
+                  row_type rows_arg);
 
        /// Returns true if there is a topline, returns false if not
        bool topLine(idx_type cell, bool onlycolumn = false) const;
@@ -201,7 +213,8 @@ public:
        ///
        bool isLastRow(idx_type cell) const;
 
-       ///
+       /// return space occupied by the second horizontal line and
+       /// interline space above row \p row in pixels
        int getAdditionalHeight(row_type row) const;
        ///
        int getAdditionalWidth(idx_type cell) const;
@@ -240,18 +253,18 @@ public:
        void setVAlignment(idx_type cell, VAlignment align,
                           bool onlycolumn = false);
        ///
-       void setColumnPWidth(idx_type cell, LyXLength const & width);
+       void setColumnPWidth(LCursor &, idx_type, LyXLength const &);
        ///
-       bool setMColumnPWidth(idx_type cell, LyXLength const & width);
+       bool setMColumnPWidth(LCursor &, idx_type, LyXLength const &);
        ///
        void setAlignSpecial(idx_type cell, std::string const & special,
-                            Feature what);
+                            Feature what);
        ///
        LyXAlignment getAlignment(idx_type cell,
-                                 bool onlycolumn = false) const;
+                                 bool onlycolumn = false) const;
        ///
        VAlignment getVAlignment(idx_type cell,
-                                bool onlycolumn = false) const;
+                                bool onlycolumn = false) const;
        ///
        LyXLength const getPWidth(idx_type cell) const;
        ///
@@ -292,9 +305,6 @@ public:
        int latex(Buffer const &, std::ostream &,
                  OutputParams const &) const;
        //
-       int linuxdoc(Buffer const & buf, std::ostream & os,
-                    OutputParams const &) const;
-       ///
        int docbook(Buffer const & buf, std::ostream & os,
                    OutputParams const &) const;
        ///
@@ -319,6 +329,10 @@ public:
        ///
        col_type right_column_of_cell(idx_type cell) const;
        ///
+       void setBookTabs(bool);
+       ///
+       bool useBookTabs() const;
+       ///
        void setLongTabular(bool);
        ///
        bool isLongTabular() const;
@@ -382,7 +396,10 @@ public:
        boost::shared_ptr<InsetText> getCellInset(idx_type cell) const;
        ///
        boost::shared_ptr<InsetText> getCellInset(row_type row,
-                                                 col_type column) const;
+                                                 col_type column) const;
+       ///
+       void setCellInset(row_type row, col_type column,
+                         boost::shared_ptr<InsetText>) const;
        /// Search for \param inset in the tabular, with the
        ///
        idx_type getCellFromInset(InsetBase const * inset) const;
@@ -392,12 +409,11 @@ public:
        col_type columns() const { return columns_;}
        ///
        void validate(LaTeXFeatures &) const;
-       /// Appends \c list with all labels found within this inset.
-       void getLabelList(Buffer const &, std::vector<std::string> & list) const;
        ///
 //private:
        ///
-       struct cellstruct {
+       class cellstruct {
+       public:
                ///
                cellstruct(BufferParams const &);
                ///
@@ -442,7 +458,8 @@ public:
        typedef std::vector<cell_vector> cell_vvector;
 
        ///
-       struct rowstruct {
+       class rowstruct {
+       public:
                ///
                rowstruct();
                ///
@@ -453,6 +470,18 @@ public:
                bool top_line;
                ///
                bool bottom_line;
+               /// Extra space between the top line and this row
+               LyXLength top_space;
+               /// Ignore top_space if true and use the default top space
+               bool top_space_default;
+               /// Extra space between this row and the bottom line
+               LyXLength bottom_space;
+               /// Ignore bottom_space if true and use the default bottom space
+               bool bottom_space_default;
+               /// Extra space between the bottom line and the next top line
+               LyXLength interline_space;
+               /// Ignore interline_space if true and use the default interline space
+               bool interline_space_default;
                /// This are for longtabulars only
                /// a row of endhead
                bool endhead;
@@ -469,7 +498,8 @@ public:
        typedef std::vector<rowstruct> row_vector;
 
        ///
-       struct columnstruct {
+       class columnstruct {
+               public:
                ///
                columnstruct();
                ///
@@ -509,6 +539,8 @@ public:
        ///
        int width_of_tabular;
        ///
+       bool use_booktabs;
+       ///
        bool rotate;
        //
        // for long tabulars
@@ -525,7 +557,7 @@ public:
 
        ///
        void init(BufferParams const &, row_type rows_arg,
-                 col_type columns_arg);
+                 col_type columns_arg);
        ///
        void set_row_column_number_info();
        /// Returns true if a complete update is necessary, otherwise false
@@ -545,9 +577,6 @@ public:
        ///
        BoxType useParbox(idx_type cell) const;
        ///
-       void setHeaderFooterRows(row_type header, row_type fheader,
-                                row_type footer, row_type lfooter);
-       ///
        // helper function for Latex returns number of newlines
        ///
        int TeXTopHLine(std::ostream &, row_type row) const;