]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.h
remove remaining MailInsets.
[lyx.git] / src / insets / InsetTabular.h
index f71a9e59854b487cfba6cd8fb88a48242418a350..390fc2ab0768e09ce12ee04fe142741e71de48cc 100644 (file)
 
 // Lgb
 
-#ifndef INSETTABULAR_H
-#define INSETTABULAR_H
+#ifndef INSET_TABULAR_H
+#define INSET_TABULAR_H
 
 #include "Inset.h"
 #include "InsetText.h"
 #include "Layout.h"
 #include "Length.h"
-#include "MailInset.h"
 
 #include <boost/shared_ptr.hpp>
 
@@ -399,9 +398,9 @@ public:
        ///
        bool isLastCell(idx_type cell) const;
        ///
-       idx_type getCellAbove(idx_type cell) const;
+       idx_type cellAbove(idx_type cell) const;
        ///
-       idx_type getCellBelow(idx_type cell) const;
+       idx_type cellBelow(idx_type cell) const;
        ///
        idx_type cellIndex(row_type row, col_type column) const;
        ///
@@ -439,16 +438,16 @@ public:
        ///
        // end longtable support
        ///
-       boost::shared_ptr<InsetTableCell> getCellInset(idx_type cell) const;
+       boost::shared_ptr<InsetTableCell> cellInset(idx_type cell) const;
        ///
-       boost::shared_ptr<InsetTableCell> getCellInset(row_type row,
+       boost::shared_ptr<InsetTableCell> cellInset(row_type row,
                                                  col_type column) const;
        ///
        void setCellInset(row_type row, col_type column,
                          boost::shared_ptr<InsetTableCell>) const;
        /// Search for \param inset in the tabular, with the
        ///
-       idx_type getCellFromInset(Inset const * inset) const;
+       idx_type cellFromInset(Inset const * inset) const;
        ///
        row_type rowCount() const { return row_info.size(); }
        ///
@@ -497,7 +496,7 @@ public:
                ///
                boost::shared_ptr<InsetTableCell> inset;
        };
-       CellData & cellinfo_of_cell(idx_type cell) const;
+       CellData & cellInfo(idx_type cell) const;
        ///
        typedef std::vector<CellData> cell_vector;
        ///
@@ -600,14 +599,8 @@ public:
                  col_type columns_arg);
        ///
        void updateIndexes();
-       /// Returns true if a complete update is necessary, otherwise false
-       bool setWidthOfMulticolCell(idx_type cell, int new_width);
-       ///
-       void recalculateMulticolumnsOfColumn(col_type column);
-       /// Returns true if change
-       void calculate_width_of_column(col_type column);
-       ///
-       bool calculate_width_of_column_NMC(col_type column); // no multi cells
+       /// return true of update is needed
+       bool updateColumnWidths();
        ///
        idx_type columnSpan(idx_type cell) const;
        ///
@@ -619,9 +612,9 @@ public:
        ///
        int TeXBottomHLine(odocstream &, row_type row) const;
        ///
-       int TeXCellPreamble(odocstream &, idx_type cell) const;
+       int TeXCellPreamble(odocstream &, idx_type cell, bool & ismulticol) const;
        ///
-       int TeXCellPostamble(odocstream &, idx_type cell) const;
+       int TeXCellPostamble(odocstream &, idx_type cell, bool ismulticol) const;
        ///
        int TeXLongtableHeaderFooter(odocstream &, OutputParams const &) const;
        ///
@@ -654,19 +647,18 @@ public:
 private:
        Buffer const * buffer_;
 
-       /// renumber cells after structural changes
-       void fixCellNums();
 }; // Tabular
 
 
 ///
-class InsetTableCell : public InsetText {
+class InsetTableCell : public InsetText
+{
 public:
        ///
-       explicit InsetTableCell(Buffer const & buf,
+       InsetTableCell(Buffer const & buf,
                Tabular::CellData const * cd, Tabular const * t);
        ///
-       virtual InsetCode lyxCode() const { return CELL_CODE; }
+       InsetCode lyxCode() const { return CELL_CODE; }
        ///
        Inset * clone() { return new InsetTableCell(*this); }
        ///
@@ -685,18 +677,20 @@ public:
        ///
        void setTabular(Tabular const * t) { table_ = t; }
 private:
-       /// 
-       Tabular::CellData const * cell_data_;
-       /// 
-       Tabular const * table_;
        /// unimplemented
        InsetTableCell();
        /// unimplemented
        void operator=(InsetTableCell const &);
+
+       /// 
+       Tabular::CellData const * cell_data_;
+       /// 
+       Tabular const * table_;
 };
 
 
-class InsetTabular : public Inset {
+class InsetTabular : public Inset
+{
 public:
        ///
        InsetTabular(Buffer const &, row_type rows = 1,
@@ -704,6 +698,10 @@ public:
        ///
        ~InsetTabular();
        ///
+       static void string2params(std::string const &, InsetTabular &);
+       ///
+       static std::string params2string(InsetTabular const &);
+       ///
        void read(Lexer &);
        ///
        void write(std::ostream &) const;
@@ -838,7 +836,7 @@ private:
        ///
        void movePrevCell(Cursor & cur);
        ///
-       int getCellXPos(idx_type cell) const;
+       int cellXPos(idx_type cell) const;
        ///
        void resetPos(Cursor & cur) const;
        ///
@@ -872,32 +870,14 @@ private:
        mutable idx_type first_visible_cell;
        ///
        mutable int scx_;
-};
-
-
-class InsetTabularMailer : public MailInset {
-public:
-       ///
-       InsetTabularMailer(InsetTabular const & inset);
-       ///
-       virtual Inset & inset() const { return inset_; }
-       ///
-       virtual std::string const & name() const { return name_; }
-       ///
-       virtual std::string const inset2string(Buffer const &) const;
-       ///
-       static void string2params(std::string const &, InsetTabular &);
-       ///
-       static std::string const params2string(InsetTabular const &);
-private:
-       ///
-       static std::string const name_;
-       ///
-       InsetTabular & inset_;
+       /// true when selecting rows with the mouse
+       bool rowselect_;
+       /// true when selecting columns with the mouse
+       bool colselect_;
 };
 
 std::string const featureAsString(Tabular::Feature feature);
 
 } // namespace lyx
 
-#endif
+#endif // INSET_TABULAR_H