]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetTabular.h
* new function to set border around selection
[lyx.git] / src / insets / InsetTabular.h
index d40b9c6ba119b30a3c74703925138157437e93b4..829c9e9e6cb7c095afc93202c79681b15ba01bd9 100644 (file)
@@ -55,6 +55,7 @@ class BufferView;
 class Buffer;
 class BufferParams;
 class Paragraph;
+class CompletionList;
 class CursorSlice;
 
 namespace frontend { class Painter; }
@@ -106,14 +107,6 @@ public:
                ///
                VALIGN_MIDDLE,
                ///
-               M_TOGGLE_LINE_TOP,
-               ///
-               M_TOGGLE_LINE_BOTTOM,
-               ///
-               M_TOGGLE_LINE_LEFT,
-               ///
-               M_TOGGLE_LINE_RIGHT,
-               ///
                M_ALIGN_LEFT,
                ///
                M_ALIGN_RIGHT,
@@ -182,6 +175,8 @@ public:
                ///
                SET_INTERLINE_SPACE,
                ///
+               SET_BORDER_LINES,
+               ///
                LAST_ACTION
        };
        ///
@@ -244,13 +239,13 @@ public:
        Tabular(Buffer const &, col_type columns_arg, row_type rows_arg);
 
        /// Returns true if there is a topline, returns false if not
-       bool topLine(idx_type cell, bool wholerow = false) const;
+       bool topLine(idx_type cell) const;
        /// Returns true if there is a topline, returns false if not
-       bool bottomLine(idx_type cell, bool wholerow = false) const;
+       bool bottomLine(idx_type cell) const;
        /// Returns true if there is a topline, returns false if not
-       bool leftLine(idx_type cell, bool wholecolumn = false) const;
+       bool leftLine(idx_type cell) const;
        /// Returns true if there is a topline, returns false if not
-       bool rightLine(idx_type cell, bool wholecolumn = false) const;
+       bool rightLine(idx_type cell) const;
 
        ///
        bool topAlreadyDrawn(idx_type cell) const;
@@ -285,14 +280,22 @@ public:
        ///
        void setAllLines(idx_type cell, bool line);
        ///
-       void setTopLine(idx_type cell, bool line, bool wholerow = false);
+       void setTopLine(idx_type cell, bool line);
+       ///
+       void setBottomLine(idx_type cell, bool line);
        ///
-       void setBottomLine(idx_type cell, bool line, bool wholerow = false);
+       void setLeftLine(idx_type cell, bool line);
        ///
-       void setLeftLine(idx_type cell, bool line, bool wholecolumn = false);
+       void setRightLine(idx_type cell, bool line);
        ///
-       void setRightLine(idx_type cell, bool line, bool wholecolumn = false);
+       bool rowTopLine(row_type row) const;
        ///
+       bool rowBottomLine(row_type row) const;
+       ///
+       bool columnLeftLine(col_type column) const;
+       ///
+       bool columnRightLine(col_type column) const;
+
        void setAlignment(idx_type cell, LyXAlignment align,
                          bool onlycolumn = false);
        ///
@@ -459,16 +462,16 @@ public:
        ///
 //private:
        ///
-       class cellstruct {
+       class CellData {
        public:
                ///
-               cellstruct(Buffer const &);
+               CellData(Buffer const &);
                ///
-               cellstruct(cellstruct const &);
+               CellData(CellData const &);
                ///
-               cellstruct & operator=(cellstruct);
+               CellData & operator=(CellData);
                ///
-               void swap(cellstruct & rhs);
+               void swap(CellData & rhs);
                ///
                idx_type cellno;
                ///
@@ -498,17 +501,17 @@ public:
                ///
                boost::shared_ptr<InsetText> inset;
        };
-       cellstruct & cellinfo_of_cell(idx_type cell) const;
+       CellData & cellinfo_of_cell(idx_type cell) const;
        ///
-       typedef std::vector<cellstruct> cell_vector;
+       typedef std::vector<CellData> cell_vector;
        ///
        typedef std::vector<cell_vector> cell_vvector;
 
        ///
-       class rowstruct {
+       class RowData {
        public:
                ///
-               rowstruct();
+               RowData();
                ///
                int ascent;
                ///
@@ -542,13 +545,13 @@ public:
                bool newpage;
        };
        ///
-       typedef std::vector<rowstruct> row_vector;
+       typedef std::vector<RowData> row_vector;
 
        ///
-       class columnstruct {
+       class ColumnData {
                public:
                ///
-               columnstruct();
+               ColumnData();
                ///
                LyXAlignment alignment;
                ///
@@ -565,7 +568,7 @@ public:
                docstring align_special;
        };
        ///
-       typedef std::vector<columnstruct> column_vector;
+       typedef std::vector<ColumnData> column_vector;
 
        ///
        idx_type numberofcells;
@@ -610,7 +613,7 @@ public:
        ///
        bool calculate_width_of_column_NMC(col_type column); // no multi cells
        ///
-       idx_type cells_in_multicolumn(idx_type cell) const;
+       idx_type columnSpan(idx_type cell) const;
        ///
        BoxType useParbox(idx_type cell) const;
        ///
@@ -737,12 +740,18 @@ public:
        /// should all paragraphs be output with "Standard" layout?
        virtual bool allowParagraphCustomization(idx_type cell = 0) const;
        ///
-       virtual bool forceEmptyLayout() { return true; }
+       virtual bool forceEmptyLayout(idx_type cell = 0) const;
+       ///
+       virtual bool useEmptyLayout() { return true; }
        ///
        void addPreview(graphics::PreviewLoader &) const;
 
        /// lock cell with given index
        void edit(Cursor & cur, bool front, EntryDirection entry_from);
+       /// get table row from x coordinate
+       int rowFromY(Cursor & cur, int y) const;
+       /// get table column from y coordinate
+       int columnFromX(Cursor & cur, int x) const;
        ///
        Inset * editXY(Cursor & cur, int x, int y);
        /// can we go further down on mouse click?
@@ -750,23 +759,41 @@ public:
        // Update the counters of this inset and of its contents
        void updateLabels(ParIterator const &);
 
+       ///
+       bool completionSupported(Cursor const &) const;
+       ///
+       bool inlineCompletionSupported(Cursor const & cur) const;
+       ///
+       bool automaticInlineCompletion() const;
+       ///
+       bool automaticPopupCompletion() const;
+       ///
+       bool showCompletionCursor() const;
+       ///
+       CompletionList const * createCompletionList(Cursor const & cur) const;
+       ///
+       docstring completionPrefix(Cursor const & cur) const;
+       ///
+       bool insertCompletion(Cursor & cur, docstring const & s, bool finished);
+       ///
+       void completionPosAndDim(Cursor const &, int & x, int & y, Dimension & dim) const;
+
        //
        // Public structures and variables
        ///
        mutable Tabular tabular;
 
-protected:
+private:
        ///
        InsetTabular(InsetTabular const &);
        ///
-       virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
+       void doDispatch(Cursor & cur, FuncRequest & cmd);
        ///
        bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
        ///
        int scroll() const { return scx_; }
-
-private:
-       Inset * clone() const;
+       ///
+       Inset * clone() const { return new InsetTabular(*this); }
 
        ///
        void drawCellLines(frontend::Painter &, int x, int y, row_type row,