X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetPreview.h;h=db2a2af96b1a1bd02b2e7ca5144137f6986113fc;hb=8124e6c02ea1fd6779bb6c47ffe2bca2c8bd2d97;hp=123d947c99b8428e354edbbfa541284b1bab0eef;hpb=5d4e6dfb68cfa045e4929fc0b49a89a8f6686ab0;p=lyx.git diff --git a/src/insets/InsetPreview.h b/src/insets/InsetPreview.h index 123d947c99..db2a2af96b 100644 --- a/src/insets/InsetPreview.h +++ b/src/insets/InsetPreview.h @@ -14,13 +14,13 @@ #include "InsetText.h" -#include "Dimension.h" - #include "support/unique_ptr.h" namespace lyx { +class Dimension; +class MacroNameSet; class RenderPreview; namespace graphics { @@ -42,37 +42,35 @@ public: /// \name Methods inherited from Inset class //@{ - Inset * clone() const { return new InsetPreview(*this); } - - bool neverIndent() const { return true; } + Inset * clone() const override { return new InsetPreview(*this); } - bool inheritFont() const { return false; } + bool neverIndent() const override { return true; } - InsetCode lyxCode() const { return PREVIEW_CODE; } + InsetCode lyxCode() const override { return PREVIEW_CODE; } - docstring layoutName() const { return from_ascii("Preview"); } + docstring layoutName() const override { return from_ascii("Preview"); } - bool descendable(BufferView const & /*bv*/) const { return true; } + bool descendable(BufferView const & /*bv*/) const override { return true; } - std::string contextMenuName() const + std::string contextMenuName() const override { return "context-preview"; } - void metrics(MetricsInfo & mi, Dimension & dim) const; + void metrics(MetricsInfo & mi, Dimension & dim) const override; - Inset * editXY(Cursor & cur, int x, int y); + Inset * editXY(Cursor & cur, int x, int y) override; - void draw(PainterInfo & pi, int x, int y) const; + void draw(PainterInfo & pi, int x, int y) const override; void addPreview(DocIterator const & inset_pos, - graphics::PreviewLoader & ploader) const; + graphics::PreviewLoader & ploader) const override; - bool notifyCursorLeaves(Cursor const & old, Cursor & cur); + bool notifyCursorLeaves(Cursor const & old, Cursor & cur) override; - void write(std::ostream & os) const; + void write(std::ostream & os) const override; - void edit(Cursor & cur, bool front, EntryDirection entry_from); + void edit(Cursor & cur, bool front, EntryDirection entry_from) override; - bool canPaintChange(BufferView const &) const { return true; }; + bool canPaintChange(BufferView const &) const override { return true; } //@} protected: @@ -90,6 +88,12 @@ protected: }; +/// gathers the list of macro definitions used in the given inset +MacroNameSet gatherMacroDefinitions(const Buffer* buffer, const Inset * inset); +/// returns the LaTeX snippet to compute the preview of the given inset +docstring insetToLaTeXSnippet(const Buffer* buffer, const Inset * inset); + + } // namespace lyx