]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetText.h
Strip et al. for citation search
[lyx.git] / src / insets / InsetText.h
index 2f32bd25392611d694d10b2286e9ef48c2174081..b9e2dc936ebed495464cbdd0660f7775c33ed718 100644 (file)
 #include "ColorCode.h"
 #include "Text.h"
 
+
 namespace lyx {
 
 class CompletionList;
 class CursorSlice;
 class Dimension;
 class ParagraphList;
-class InsetCaption;
-class InsetTabular;
-class TocBuilder;
 
 /**
  A text inset is like a TeX box to write full text
@@ -56,6 +54,8 @@ public:
        void read(Lexer & lex) override;
        ///
        void write(std::ostream & os) const override;
+       /// Let the inset compute and store its reference font from \c outer.
+       void setOuterFont(BufferView & bv, FontInfo const & outer) const;
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const override;
        ///
@@ -93,9 +93,9 @@ public:
        ///
        docstring insetAsXHTML(XMLStream &, OutputParams const &,
                               XHTMLOptions) const;
-       ///
+       /// Outputs the inset as DocBook, with the given options regarding outer tags.
        void docbook(XMLStream &, OutputParams const &, XHTMLOptions opts) const;
-       ///
+       /// Outputs the whole inset as DocBook.
        void docbook(XMLStream &, OutputParams const &) const override;
        ///
        void validate(LaTeXFeatures & features) const override;
@@ -117,8 +117,8 @@ public:
        ///
        void setFrameColor(ColorCode);
        ///
-       Text * getText(int i) const override {
-               return (i == 0) ? const_cast<Text*>(&text_) : 0;
+       Text * getText(int idx) const override {
+               return (idx == 0) ? const_cast<Text*>(&text_) : nullptr;
        }
        ///
        bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const override;
@@ -157,23 +157,20 @@ public:
        ///
        bool insetAllowed(InsetCode) const override;
        ///
-       bool allowSpellCheck() const override { return getLayout().spellcheck() && !getLayout().isPassThru(); }
+       bool allowSpellCheck() const override;
        ///
        virtual bool isMacroScope() const { return false; }
        ///
-       bool allowMultiPar() const override { return getLayout().isMultiPar(); }
+       bool allowMultiPar() const override;
        ///
        bool isInTitle() const override { return intitle_context_; }
        ///
        /// should paragraphs be forced to use the empty layout?
-       bool forcePlainLayout(idx_type = 0) const override
-               { return getLayout().forcePlainLayout(); }
+       bool forcePlainLayout(idx_type = 0) const override;
        /// should the user be allowed to customize alignment, etc.?
-       bool allowParagraphCustomization(idx_type = 0) const override
-               { return getLayout().allowParagraphCustomization(); }
+       bool allowParagraphCustomization(idx_type = 0) const override;
        /// should paragraphs be forced to use a local font language switch?
-       bool forceLocalFontSwitch() const override
-               { return getLayout().forceLocalFontSwitch(); }
+       bool forceLocalFontSwitch() const override;
 
        /// Update the counters of this inset and of its contents
        void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false) override;
@@ -206,7 +203,7 @@ public:
        ///
        docstring completionPrefix(Cursor const & cur) const override;
        ///
-       bool insertCompletion(Cursor & cur, docstring const & s, bool finished) override;
+       bool insertCompletion(Cursor & cur, docstring const & s, bool /*finished*/) override;
        ///
        void completionPosAndDim(Cursor const &, int & x, int & y, Dimension & dim) const override;
        /// returns the text to be used as tooltip
@@ -218,7 +215,7 @@ public:
        /// of that sort. (Note: unnecessary internal copies have been removed
        /// since the previous note. The efficiency would have to be assessed
        /// again by profiling.)
-       docstring toolTipText(docstring prefix = empty_docstring(),
+       docstring toolTipText(docstring const & prefix = empty_docstring(),
                              size_t len = 400) const;
 
        ///
@@ -241,6 +238,10 @@ protected:
        ///
        void iterateForToc(DocIterator const & cdit, bool output_active,
                                           UpdateType utype, TocBackend & backend) const;
+       /// Outputs an inset that must be first rendered (with the given options regarding outer tags).
+       void docbookRenderAsImage(XMLStream & xs, OutputParams const & rp, XHTMLOptions opts) const;
+       /// Outputs the text of the inset with the correct DocBook tags (with the given options regarding outer tags).
+       void docbookText(XMLStream & xs, OutputParams const & rp, XHTMLOptions opts) const;
 private:
        /// Open the toc item for paragraph pit. Returns the paragraph index where
        /// it should end.