X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetScript.h;h=9eb80dbbd5032c9866366b19cf6c72082f5d79e4;hb=e26a60edef3eae39c2e8379f395febedc5ba7efa;hp=c9ac1d30e0abebfa3c50c326587586c068242df4;hpb=1ef605f6254ef3f3b8cec5440a2e67e6f23a707b;p=features.git diff --git a/src/insets/InsetScript.h b/src/insets/InsetScript.h index c9ac1d30e0..9eb80dbbd5 100644 --- a/src/insets/InsetScript.h +++ b/src/insets/InsetScript.h @@ -12,6 +12,7 @@ #ifndef INSET_SCRIPT_H #define INSET_SCRIPT_H +#include "FontInfo.h" #include "InsetText.h" @@ -63,66 +64,71 @@ public: /// \name Public functions inherited from Inset class //@{ /// - InsetCode lyxCode() const { return SCRIPT_CODE; } + InsetCode lyxCode() const override { return SCRIPT_CODE; } /// - docstring name() const; + docstring layoutName() const override; + /// - DisplayType display() const; + int topOffset(BufferView const *) const override { return 0; } /// - void metrics(MetricsInfo &, Dimension &) const; + int bottomOffset(BufferView const *) const override { return 0; } /// - void draw(PainterInfo & pi, int x, int y) const; + int leftOffset(BufferView const *) const override { return 0; } /// - void cursorPos(BufferView const & bv, - CursorSlice const & sl, bool boundary, int & x, int & y) const; + int rightOffset(BufferView const *) const override { return 0; } + /// - void write(std::ostream &) const; + void metrics(MetricsInfo &, Dimension &) const override; /// - void read(Lexer & lex); + void draw(PainterInfo & pi, int x, int y) const override; + /// + void cursorPos(BufferView const & bv, + CursorSlice const & sl, bool boundary, int & x, int & y) const override; /// - bool neverIndent() const { return true; } + void write(std::ostream &) const override; /// - bool forcePlainLayout(idx_type = 0) const { return true; } + void read(Lexer & lex) override; /// - bool allowParagraphCustomization(idx_type = 0) const { return false; } + bool forcePlainLayout(idx_type = 0) const override { return true; } /// - virtual void validate(LaTeXFeatures &) const; + bool allowParagraphCustomization(idx_type = 0) const override { return false; } /// - int latex(otexstream &, OutputParams const &) const; + bool neverIndent() const override { return true; } /// - int plaintext(odocstream &, OutputParams const &) const; + bool inheritFont() const override { return true; } /// - int docbook(odocstream &, OutputParams const &) const; + int plaintext(odocstringstream & ods, OutputParams const & op, + size_t max_length = INT_MAX) const override; /// - docstring xhtml(XHTMLStream &, OutputParams const &) const; + void docbook(XMLStream &, OutputParams const &) const override; /// void edit(Cursor & cur, bool front, - EntryDirection entry_from = ENTRY_DIRECTION_IGNORE); + EntryDirection entry_from = ENTRY_DIRECTION_IGNORE) override; /// - Inset * editXY(Cursor & cur, int x, int y); + Inset * editXY(Cursor & cur, int x, int y) override; /// - bool insetAllowed(InsetCode code) const; + bool insetAllowed(InsetCode code) const override; /// - bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; + bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override; /// - docstring toolTip(BufferView const & bv, int x, int y) const; + docstring toolTip(BufferView const & bv, int x, int y) const override; /// - Inset * clone() const { return new InsetScript(*this); } + Inset * clone() const override { return new InsetScript(*this); } /// - docstring contextMenuName() const; + std::string contextMenuName() const override; //@} /// \name Public functions inherited from InsetText class //@{ /// - bool allowMultiPar() const { return false; } + bool allowMultiPar() const override { return false; } //@} protected: /// \name Protected functions inherited from Inset class //@{ /// - void doDispatch(Cursor & cur, FuncRequest & cmd); + void doDispatch(Cursor & cur, FuncRequest & cmd) override; //@} private: @@ -132,6 +138,8 @@ private: friend class InsetScriptParams; /// InsetScriptParams params_; + /// The font of containing inset; this is necessary to compute shift + mutable FontInfo outer_font_; };