]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetText.h
Cocoa based Qt-4.6 needs to paint every character separately to match metrics computa...
[lyx.git] / src / insets / InsetText.h
index 64002f91d79888f850ef11c6dad28ca79bae05d9..704194c5d0212dee50e403e438e0ffdfe49eee35 100644 (file)
@@ -73,16 +73,24 @@ public:
        Text & text() { return text_; }
        Text const & text() const { return text_; }
        ///
-       int latex(odocstream &, OutputParams const &) const;
+       void latex(otexstream &, OutputParams const &) const;
        ///
        int plaintext(odocstream &, OutputParams const &) const;
        ///
        int docbook(odocstream &, OutputParams const &) const;
        ///
        docstring xhtml(XHTMLStream &, OutputParams const &) const;
-       // FIXME XHTMLStream to be removed
-       docstring xhtml(odocstream &, OutputParams const &) const 
-               { return docstring (); }
+       ///
+       enum XHTMLOptions {
+               JustText = 0,
+               WriteOuterTag = 1,
+               WriteLabel = 2,
+               WriteInnerTag = 4,
+               WriteEverything = 7
+       };
+       ///
+       docstring insetAsXHTML(XHTMLStream &, OutputParams const &, 
+                              XHTMLOptions) const;
        ///
        void validate(LaTeXFeatures & features) const;
 
@@ -104,8 +112,6 @@ public:
        ///
        void setFrameColor(ColorCode);
        ///
-       bool showInsetDialog(BufferView *) const;
-       ///
        Text * getText(int i) const {
                return (i == 0) ? const_cast<Text*>(&text_) : 0;
        }
@@ -126,7 +132,7 @@ public:
        void appendParagraphs(ParagraphList &);
 
        ///
-       void addPreview(graphics::PreviewLoader &) const;
+       void addPreview(DocIterator const &, graphics::PreviewLoader &) const;
 
        ///
        void edit(Cursor & cur, bool front, EntryDirection entry_from);
@@ -141,8 +147,8 @@ public:
        ParagraphList const & paragraphs() const;
        ///
        bool insetAllowed(InsetCode) const { return !getLayout().isPassThru(); }
-       /// Allow spellchecking, except for insets with latex_language
-       bool allowSpellCheck() const { return !getLayout().isPassThru(); }
+       ///
+       bool allowSpellCheck() const { return getLayout().spellcheck() && !getLayout().isPassThru(); }
        ///
        virtual bool isMacroScope() const { return false; }
        ///
@@ -156,11 +162,15 @@ public:
                { return getLayout().allowParagraphCustomization(); }
 
        /// Update the counters of this inset and of its contents
-       virtual void updateLabels(ParIterator const &);
-       /// the string that is passed to the TOC
-       void tocString(odocstream &) const;
+       virtual void updateBuffer(ParIterator const &, UpdateType);
+       /// 
+       void setMacrocontextPositionRecursive(DocIterator const & pos);
+       ///
+       void toString(odocstream &) const;
        ///
-       void addToToc(DocIterator const &);
+       void forToc(docstring &, size_t) const;
+       ///
+       void addToToc(DocIterator const &) const;
        ///
        Inset * clone() const { return new InsetText(*this); }
        ///
@@ -184,9 +194,18 @@ public:
        bool insertCompletion(Cursor & cur, docstring const & s, bool finished);
        ///
        void completionPosAndDim(Cursor const &, int & x, int & y, Dimension & dim) const;
+       /// returns the text to be used as tooltip
+       /// \param prefix: a string that will preced the tooltip,
+       /// e.g., "Index: ".
+       /// \param numlines: the number of lines in the tooltip
+       /// \param len: length of those lines
+       docstring toolTipText(docstring prefix = empty_docstring(),
+                       size_t numlines = 5, size_t len = 80) const;
 
        ///
-       virtual docstring contextMenu(BufferView const & bv, int x, int y) const;
+       docstring contextMenu(BufferView const &, int, int) const;
+       ///
+       docstring contextMenuName() const;
        ///
        void doDispatch(Cursor & cur, FuncRequest & cmd);
 protected:
@@ -197,10 +216,6 @@ protected:
        ///
        docstring getCaptionHTML(OutputParams const &) const;
 private:
-       ///
-       void initParagraphs(UsePlain type);
-       ///
-       void setParagraphOwner();
        ///
        bool drawFrame_;
        ///
@@ -211,6 +226,9 @@ private:
        mutable Text text_;
 };
 
+
+InsetText::XHTMLOptions operator|(InsetText::XHTMLOptions a1, InsetText::XHTMLOptions a2);
+
 } // namespace lyx
 
 #endif