]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.h
Routines for calculating numerical labels for BibTeX citations.
[lyx.git] / src / insets / InsetTabular.h
index 1f71350aeb264d36c45206b69bdd4aa70b7410a6..922e13ae3191b11b154239c8fdb2d6a8ec2e03d8 100644 (file)
@@ -48,7 +48,6 @@
 namespace lyx {
 
 class Buffer;
-class BufferParams;
 class BufferView;
 class CompletionList;
 class CursorSlice;
@@ -56,6 +55,7 @@ class InsetTableCell;
 class FuncStatus;
 class Lexer;
 class Paragraph;
+class XHTMLStream;
 
 namespace frontend { class Painter; }
 
@@ -184,6 +184,12 @@ public:
                ///
                TABULAR_VALIGN_BOTTOM,
                ///
+               LONGTABULAR_ALIGN_LEFT,
+               ///
+               LONGTABULAR_ALIGN_CENTER,
+               ///
+               LONGTABULAR_ALIGN_RIGHT,
+               ///
                LAST_ACTION
        };
        ///
@@ -201,9 +207,19 @@ public:
                ///
                LYX_VALIGN_TOP = 0,
                ///
-               LYX_VALIGN_BOTTOM = 1,
+               LYX_VALIGN_MIDDLE = 1,
+               ///
+               LYX_VALIGN_BOTTOM = 2
+               
+       };
+       ///
+       enum HAlignment {
+               ///
+               LYX_LONGTABULAR_ALIGN_LEFT = 0,
+               ///
+               LYX_LONGTABULAR_ALIGN_CENTER = 1,
                ///
-               LYX_VALIGN_MIDDLE = 2
+               LYX_LONGTABULAR_ALIGN_RIGHT = 2
        };
 
        enum BoxType {
@@ -241,7 +257,7 @@ public:
        static const idx_type npos = static_cast<idx_type>(-1);
 
        /// constructor
-       Tabular(Buffer &, col_type columns_arg, row_type rows_arg);
+       Tabular(Buffer * buf, col_type columns_arg, row_type rows_arg);
 
        /// Returns true if there is a topline, returns false if not
        bool topLine(idx_type cell) const;
@@ -353,9 +369,11 @@ public:
        void read(Lexer &);
        ///
        int latex(odocstream &, OutputParams const &) const;
-       //
+       ///
        int docbook(odocstream & os, OutputParams const &) const;
        ///
+       docstring xhtml(XHTMLStream & os, OutputParams const &) const;
+       ///
        void plaintext(odocstream &,
                       OutputParams const & runparams, int const depth,
                       bool onlydata, char_type delim) const;
@@ -450,7 +468,7 @@ public:
        class CellData {
        public:
                ///
-               CellData(Buffer &);
+               CellData(Buffer *);
                ///
                CellData(CellData const &);
                ///
@@ -569,6 +587,8 @@ public:
        VAlignment tabular_valignment;
        //
        // for long tabulars
+       ///
+       HAlignment longtabular_alignment;
        //
        bool is_long_tabular;
        /// endhead data
@@ -581,7 +601,7 @@ public:
        ltType endlastfoot;
 
        ///
-       void init(Buffer &, row_type rows_arg,
+       void init(Buffer *, row_type rows_arg,
                  col_type columns_arg);
        ///
        void updateIndexes();
@@ -628,6 +648,8 @@ public:
                                bool onlydata) const;
        /// auxiliary function for docbook
        int docbookRow(odocstream & os, row_type, OutputParams const &) const;
+       ///
+       docstring xhtmlRow(XHTMLStream & xs, row_type, OutputParams const &) const;
 
        /// change associated Buffer
        void setBuffer(Buffer & buffer);
@@ -645,7 +667,7 @@ class InsetTableCell : public InsetText
 {
 public:
        ///
-       InsetTableCell(Buffer & buf);
+       InsetTableCell(Buffer * buf);
        ///
        InsetCode lyxCode() const { return CELL_CODE; }
        ///
@@ -660,6 +682,8 @@ public:
        /// writes the contents of the cell as a string, optionally
        /// descending into insets
        docstring asString(bool intoInsets = true);
+       ///
+       docstring xhtml(XHTMLStream &, OutputParams const &) const;
 private:
        /// unimplemented
        InsetTableCell();
@@ -712,7 +736,7 @@ class InsetTabular : public Inset
 {
 public:
        ///
-       InsetTabular(Buffer &, row_type rows = 1,
+       InsetTabular(Buffer *, row_type rows = 1,
                     col_type columns = 1);
        ///
        ~InsetTabular();
@@ -734,9 +758,9 @@ public:
        ///
        void drawSelection(PainterInfo & pi, int x, int y) const;
        ///
-       docstring editMessage() const;
+       bool editable() const { return true; }
        ///
-       EDITABLE editable() const { return HIGHLY_EDITABLE; }
+       bool hasSettings() const { return true; }
        ///
        bool insetAllowed(InsetCode code) const;
        ///
@@ -748,7 +772,7 @@ public:
            insets that may contain several paragraphs */
        bool noFontChange() const { return true; }
        ///
-       DisplayType display() const { return tabular.is_long_tabular ? AlignCenter : Inline; }
+       DisplayType display() const;
        ///
        int latex(odocstream &, OutputParams const &) const;
        ///
@@ -756,6 +780,8 @@ public:
        ///
        int docbook(odocstream &, OutputParams const &) const;
        ///
+       docstring xhtml(XHTMLStream &, OutputParams const &) const;
+       ///
        void validate(LaTeXFeatures & features) const;
        ///
        InsetCode lyxCode() const { return TABULAR_CODE; }
@@ -785,9 +811,9 @@ public:
        /// set the change for the entire inset
        void setChange(Change const & change);
        /// accept the changes within the inset
-       void acceptChanges(BufferParams const & bparams);
+       void acceptChanges();
        /// reject the changes within the inset
-       void rejectChanges(BufferParams const & bparams);
+       void rejectChanges();
 
        // this should return true if we have a "normal" cell, otherwise false.
        // "normal" means without width set!
@@ -796,9 +822,8 @@ public:
        ///
        virtual bool forcePlainLayout(idx_type cell = 0) const;
        ///
-       virtual bool usePlainLayout() { return true; }
-       ///
-       void addPreview(graphics::PreviewLoader &) const;
+       void addPreview(DocIterator const & inset_pos,
+               graphics::PreviewLoader &) const;
 
        /// lock cell with given index
        void edit(Cursor & cur, bool front, EntryDirection entry_from);
@@ -809,9 +834,9 @@ public:
        ///
        Inset * editXY(Cursor & cur, int x, int y);
        /// can we go further down on mouse click?
-       bool descendable() const { return true; }
+       bool descendable(BufferView const &) const { return true; }
        // Update the counters of this inset and of its contents
-       void updateLabels(ParIterator const &);
+       void updateLabels(ParIterator const &, bool);
 
        ///
        bool completionSupported(Cursor const &) const;