X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetText.h;h=1c8d5468fe918845d069376f83cf73fec006364e;hb=d6f1915684328c6e3fe61c6eef8846b5cabec334;hp=9a75d67d366f756842d0784d2b75a4191f13253d;hpb=69de04feac27ca813a34e765b7f16cc537493206;p=lyx.git diff --git a/src/insets/InsetText.h b/src/insets/InsetText.h index 9a75d67d36..1c8d5468fe 100644 --- a/src/insets/InsetText.h +++ b/src/insets/InsetText.h @@ -17,20 +17,17 @@ #include "ColorCode.h" #include "Text.h" -#include - namespace lyx { class Buffer; class BufferParams; class BufferView; +class CompletionList; class CursorSlice; class Dimension; class ParagraphList; class InsetTabular; -class WordList : public std::set {}; - /** A text inset is like a TeX box to write full text (including styles and other insets) in a given space. @@ -38,11 +35,11 @@ class WordList : public std::set {}; 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; @@ -50,15 +47,15 @@ public: /// empty inset to empty par void clear(); /// - void read(Buffer const & buf, Lexer & lex); + void read(Lexer & lex); /// - void write(Buffer const & buf, std::ostream & os) const; + void write(std::ostream & os) const; /// void metrics(MetricsInfo & mi, Dimension & dim) const; /// void draw(PainterInfo & pi, int x, int y) const; /// - virtual docstring const editMessage() const; + docstring editMessage() const; /// EDITABLE editable() const { return HIGHLY_EDITABLE; } /// @@ -68,11 +65,14 @@ public: /// InsetText const * asInsetText() const { return this; } /// - int latex(Buffer const &, odocstream &, OutputParams const &) const; + Text & text() { return text_; } + Text const & text() const { return text_; } /// - int plaintext(Buffer const &, odocstream &, OutputParams const &) const; + int latex(odocstream &, OutputParams const &) const; /// - int docbook(Buffer const &, odocstream &, OutputParams const &) const; + int plaintext(odocstream &, OutputParams const &) const; + /// + int docbook(odocstream &, OutputParams const &) const; /// void validate(LaTeXFeatures & features) const; @@ -110,7 +110,7 @@ public: void rejectChanges(BufferParams const & bparams); /// append text onto the existing text - void appendParagraphs(Buffer * bp, ParagraphList &); + void appendParagraphs(ParagraphList &); /// void addPreview(graphics::PreviewLoader &) const; @@ -130,17 +130,19 @@ public: bool insetAllowed(InsetCode) const { return true; } /// bool allowSpellCheck() const { return true; } - /// should paragraph indendation be ommitted in any case? - bool neverIndent(Buffer const &) const; /// - virtual bool isMacroScope(Buffer const &) 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 - virtual void updateLabels(Buffer const &, ParIterator const &); + void updateLabels(ParIterator const &); + /// + void addToToc(DocIterator const &); + /// + Inset * clone() const { return new InsetText(*this); } /// - virtual Inset * clone() const; + bool notifyCursorLeaves(Cursor const & old, Cursor & cur); /// bool completionSupported(Cursor const &) const; @@ -151,6 +153,8 @@ public: /// bool automaticPopupCompletion() const; /// + bool showCompletionCursor() const; + /// CompletionList const * createCompletionList(Cursor const & cur) const; /// docstring completionPrefix(Cursor const & cur) const; @@ -159,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(); /// void setParagraphOwner(); /// @@ -172,10 +178,6 @@ private: ColorCode frame_color_; /// mutable pit_type old_pit; - /// - docstring previousWord(Buffer const & buffer, CursorSlice const & sl) const; - -public: /// mutable Text text_; };