]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetText.h
Move isMultiCell() to Cursor, and use it.
[lyx.git] / src / insets / InsetText.h
index e9f7c6b7c54d8ba16f09ffb23abfc48b0a94da0e..f20fd4a0b36e88098410c90d9e48c41e6871371c 100644 (file)
@@ -22,6 +22,7 @@ namespace lyx {
 class Buffer;
 class BufferParams;
 class BufferView;
+class CompletionList;
 class CursorSlice;
 class Dimension;
 class ParagraphList;
@@ -34,11 +35,11 @@ class InsetTabular;
 class InsetText : public Inset {
 public:
        ///
-       explicit InsetText(BufferParams const &);
-       ///
-       InsetText();
+       explicit InsetText(Buffer const & buffer);
        ///
        InsetText(InsetText const &);
+       ///
+       void setBuffer(Buffer &);
 
        ///
        Dimension const dimension(BufferView const &) const;
@@ -64,6 +65,9 @@ public:
        ///
        InsetText const * asInsetText() const { return this; }
        ///
+       Text & text() { return text_; }
+       Text const & text() const { return text_; }
+       ///
        int latex(odocstream &, OutputParams const &) const;
        ///
        int plaintext(odocstream &, OutputParams const &) const;
@@ -126,19 +130,19 @@ public:
        bool insetAllowed(InsetCode) const { return true; }
        ///
        bool allowSpellCheck() const { return true; }
-       /// should paragraph indendation be ommitted in any case?
-       bool neverIndent() const;
        ///
-       virtual bool isMacroScope() const { return true; }
+       virtual bool isMacroScope() const { return false; }
        ///
        virtual bool allowMultiPar() const { return true; }
 
        // Update the counters of this inset and of its contents
        void updateLabels(ParIterator const &);
        ///
-       Inset * clone() const;
+       void addToToc(DocIterator const &);
        ///
-       virtual bool notifyCursorLeaves(Cursor const & old, Cursor & cur);
+       Inset * clone() const { return new InsetText(*this); }
+       ///
+       bool notifyCursorLeaves(Cursor const & old, Cursor & cur);
 
        ///
        bool completionSupported(Cursor const &) const;
@@ -149,6 +153,8 @@ public:
        ///
        bool automaticPopupCompletion() const;
        ///
+       bool showCompletionCursor() const;
+       ///
        CompletionList const * createCompletionList(Cursor const & cur) const;
        ///
        docstring completionPrefix(Cursor const & cur) const;
@@ -157,11 +163,13 @@ public:
        ///
        void completionPosAndDim(Cursor const &, int & x, int & y, Dimension & dim) const;
 
-protected:
        ///
-       virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
-
+       virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
+       ///
+       void doDispatch(Cursor & cur, FuncRequest & cmd);
 private:
+       ///
+       void initParagraphs(BufferParams const &);
        ///
        void setParagraphOwner();
        ///
@@ -170,10 +178,6 @@ private:
        ColorCode frame_color_;
        ///
        mutable pit_type old_pit;
-       ///
-       docstring previousWord(CursorSlice const & sl) const;
-
-public:
        ///
        mutable Text text_;
 };