]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.h
getting rid of more superfluous lyx::support:: statements.
[lyx.git] / src / insets / InsetTabular.h
index dc0edf82ecdab549a28310415c5c22eedcbfaaee..8950077de263bd4dc71f0e2d4b9ed13f02ef4795 100644 (file)
 #define INSETTABULAR_H
 
 #include "Inset.h"
-#include "MailInset.h"
-#include "Length.h"
 #include "InsetText.h"
-
+#include "Layout.h"
+#include "Length.h"
+#include "MailInset.h"
 
 #include <boost/shared_ptr.hpp>
 
@@ -67,7 +67,7 @@ class OutputParams;
 //
 // A helper struct for tables
 //
-class Tabular  {
+class Tabular {
 public:
        ///
        enum Feature {
@@ -238,6 +238,8 @@ public:
        /// index indicating an invalid position
        static const idx_type npos = static_cast<idx_type>(-1);
 
+       /// constructor
+       Tabular();
        /// constructor
        Tabular(BufferParams const &, col_type columns_arg,
                   row_type rows_arg);
@@ -266,21 +268,21 @@ public:
 
        /* returns the maximum over all rows */
        ///
-       int getWidthOfColumn(idx_type cell) const;
+       int columnWidth(idx_type cell) const;
        ///
-       int getWidthOfTabular() const;
+       int width() const;
        ///
-       int getAscentOfRow(row_type row) const;
+       int height() const;
        ///
-       int getDescentOfRow(row_type row) const;
+       int rowAscent(row_type row) const;
        ///
-       int getHeightOfTabular() const;
+       int rowDescent(row_type row) const;
        ///
-       void setAscentOfRow(row_type row, int height);
+       void setRowAscent(row_type row, int height);
        ///
-       void setDescentOfRow(row_type row, int height);
+       void setRowDescent(row_type row, int height);
        ///
-       void setWidthOfCell(idx_type cell, int new_width);
+       void setCellWidth(idx_type cell, int new_width);
        ///
        void setAllLines(idx_type cell, bool line);
        ///
@@ -319,7 +321,7 @@ public:
        ///
        docstring const getAlignSpecial(idx_type cell, int what) const;
        ///
-       int getWidthOfCell(idx_type cell) const;
+       int cellWidth(idx_type cell) const;
        ///
        int getBeginningOfTextInCell(idx_type cell) const;
        ///
@@ -343,7 +345,7 @@ public:
        ///
        idx_type getLastCellInRow(row_type row) const;
        ///
-       idx_type getNumberOfCells() const;
+       idx_type cellCount() const;
        ///
        idx_type numberOfCellsInRow(idx_type cell) const;
        ///
@@ -357,7 +359,7 @@ public:
        ///
        void plaintext(Buffer const &, odocstream &,
                       OutputParams const & runparams, int const depth,
-                      bool onlydata, unsigned char delim) const;
+                      bool onlydata, char_type delim) const;
        ///
        bool isMultiColumn(idx_type cell) const;
        ///
@@ -369,11 +371,11 @@ public:
        ///
        bool isPartOfMultiColumn(row_type row, col_type column) const;
        ///
-       row_type row_of_cell(idx_type cell) const;
+       row_type cellRow(idx_type cell) const;
        ///
-       col_type column_of_cell(idx_type cell) const;
+       col_type cellColumn(idx_type cell) const;
        ///
-       col_type right_column_of_cell(idx_type cell) const;
+       col_type cellRightColumn(idx_type cell) const;
        ///
        void setBookTabs(bool);
        ///
@@ -403,7 +405,7 @@ public:
        ///
        idx_type getLastCellBelow(idx_type cell) const;
        ///
-       idx_type getCellNumber(row_type row, col_type column) const;
+       idx_type cellIndex(row_type row, col_type column) const;
        ///
        void setUsebox(idx_type cell, BoxType);
        ///
@@ -450,9 +452,9 @@ public:
        ///
        idx_type getCellFromInset(Inset const * inset) const;
        ///
-       row_type rows() const { return rows_; }
+       row_type rowCount() const { return row_info.size(); }
        ///
-       col_type columns() const { return columns_;}
+       col_type columnCount() const { return column_info.size();}
        ///
        void validate(LaTeXFeatures &) const;
        ///
@@ -471,7 +473,7 @@ public:
                ///
                idx_type cellno;
                ///
-               int width_of_cell;
+               int width;
                ///
                int multicolumn;
                ///
@@ -509,9 +511,9 @@ public:
                ///
                rowstruct();
                ///
-               int ascent_of_row;
+               int ascent;
                ///
-               int descent_of_row;
+               int descent;
                ///
                bool top_line;
                ///
@@ -537,7 +539,7 @@ public:
                bool endfoot;
                /// row of endlastfoot
                bool endlastfoot;
-               /// row for a pagebreak
+               /// row for a newpage
                bool newpage;
        };
        ///
@@ -557,7 +559,7 @@ public:
                ///
                bool right_line;
                ///
-               int  width_of_column;
+               int width;
                ///
                Length p_width;
                ///
@@ -566,10 +568,6 @@ public:
        ///
        typedef std::vector<columnstruct> column_vector;
 
-       ///
-       row_type rows_;
-       ///
-       col_type columns_;
        ///
        idx_type numberofcells;
        ///
@@ -583,8 +581,6 @@ public:
        ///
        mutable cell_vvector cell_info;
        ///
-       int width_of_tabular;
-       ///
        bool use_booktabs;
        ///
        bool rotate;
@@ -605,7 +601,7 @@ public:
        void init(BufferParams const &, row_type rows_arg,
                  col_type columns_arg);
        ///
-       void set_row_column_number_info();
+       void updateIndexes();
        /// Returns true if a complete update is necessary, otherwise false
        bool setWidthOfMulticolCell(idx_type cell, int new_width);
        ///
@@ -615,10 +611,6 @@ public:
        ///
        bool calculate_width_of_column_NMC(col_type column); // no multi cells
        ///
-       void calculate_width_of_tabular();
-       ///
-       void delete_column(col_type column);
-       ///
        idx_type cells_in_multicolumn(idx_type cell) const;
        ///
        BoxType useParbox(idx_type cell) const;
@@ -677,7 +669,7 @@ public:
        ///
        void write(Buffer const &, std::ostream &) const;
        ///
-       bool metrics(MetricsInfo &, Dimension &) const;
+       void metrics(MetricsInfo &, Dimension &) const;
        ///
        void draw(PainterInfo & pi, int x, int y) const;
        ///
@@ -687,7 +679,7 @@ public:
        ///
        EDITABLE editable() const { return HIGHLY_EDITABLE; }
        ///
-       bool insetAllowed(Inset::Code) const { return true; }
+       bool insetAllowed(InsetCode) const { return true; }
        ///
        bool allowSpellCheck() const { return true; }
        ///
@@ -710,7 +702,7 @@ public:
        ///
        void validate(LaTeXFeatures & features) const;
        ///
-       Code lyxCode() const { return Inset::TABULAR_CODE; }
+       InsetCode lyxCode() const { return TABULAR_CODE; }
        /// get offset of this cursor slice relative to our upper left corner
        void cursorPos(BufferView const & bv, CursorSlice const & sl,
                bool boundary, int & x, int & y) const;
@@ -724,7 +716,7 @@ public:
        ///
        bool showInsetDialog(BufferView *) const;
        /// number of cells
-       size_t nargs() const { return tabular.getNumberOfCells(); }
+       size_t nargs() const { return tabular.cellCount(); }
        ///
        boost::shared_ptr<InsetText const> cell(idx_type) const;
        ///