X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Finsets%2FInsetNote.h;h=32bb26bbf663f5fcf368d8f94d8c58d0bcf3e196;hb=b198a36a363bb6a084407d476942d68ef5fb5e86;hp=1d51ee74d18488186acdb830d5b09136b627b40a;hpb=36dbec45069bf3d9db923200835e44f44d904eb8;p=lyx.git diff --git a/src/insets/InsetNote.h b/src/insets/InsetNote.h index 1d51ee74d1..32bb26bbf6 100644 --- a/src/insets/InsetNote.h +++ b/src/insets/InsetNote.h @@ -9,16 +9,16 @@ * Full author contact details are available in file CREDITS. */ -#ifndef INSETNOTE_H -#define INSETNOTE_H +#ifndef INSET_NOTE_H +#define INSET_NOTE_H -#include "InsetCollapsable.h" -#include "MailInset.h" +#include "InsetCollapsible.h" namespace lyx { -class InsetNoteParams { +class InsetNoteParams +{ public: enum Type { Note, @@ -36,86 +36,76 @@ public: }; -/** The PostIt note inset, and other annotations +///////////////////////////////////////////////////////////////////////// +// +// InsetNote +// +///////////////////////////////////////////////////////////////////////// -*/ -class InsetNote : public InsetCollapsable { +/// The PostIt note inset, and other annotations +class InsetNote : public InsetCollapsible +{ public: /// - InsetNote(BufferParams const &, std::string const &); + InsetNote(Buffer *, std::string const &); /// ~InsetNote(); /// - virtual docstring const editMessage() const; + static std::string params2string(InsetNoteParams const &); /// - InsetCode lyxCode() const { return NOTE_CODE; } + static void string2params(std::string const &, InsetNoteParams &); /// - docstring name() const; + InsetNoteParams const & params() const { return params_; } +private: /// - virtual DisplayType display() const; + InsetCode lyxCode() const override { return NOTE_CODE; } /// - void write(Buffer const &, std::ostream &) const; + docstring layoutName() const override; /// - void read(Buffer const & buf, Lexer & lex); + bool inheritFont() const override { return params_.type == InsetNoteParams::Note; } + /// Is the content of this inset part of the output document? + bool producesOutput() const override + { return params_.type == InsetNoteParams::Greyedout; } /// - void setButtonLabel(); - /// show the note dialog - bool showInsetDialog(BufferView * bv) const; + bool allowSpellCheck() const override; /// - bool isMacroScope(Buffer const & buf) const; + FontInfo getFont() const override; /// - int latex(Buffer const &, odocstream &, OutputParams const &) const; + void write(std::ostream &) const override; /// - int plaintext(Buffer const &, odocstream &, OutputParams const &) const; - /// - int docbook(Buffer const &, odocstream &, OutputParams const &) const; + void read(Lexer & lex) override; + /// show the note dialog + bool showInsetDialog(BufferView * bv) const override; /// - void validate(LaTeXFeatures &) const; + bool isMacroScope() const override; /// - InsetNoteParams const & params() const { return params_; } + void latex(otexstream &, OutputParams const &) const override; /// - bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; - // Update the counters of this inset and of its contents - virtual void updateLabels(Buffer const &, ParIterator const &); -protected: - InsetNote(InsetNote const &); + int plaintext(odocstringstream & ods, OutputParams const & op, + size_t max_length = INT_MAX) const override; /// - virtual void doDispatch(Cursor & cur, FuncRequest & cmd); -private: - friend class InsetNoteParams; - - virtual Inset * clone() const; - - /// used by the constructors - void init(); + void docbook(XMLStream &, OutputParams const &) const override; /// - InsetNoteParams params_; -}; - - -class InsetNoteMailer : public MailInset { -public: + docstring xhtml(XMLStream &, OutputParams const &) const override; /// - InsetNoteMailer(InsetNote & inset); + void validate(LaTeXFeatures &) const override; /// - virtual Inset & inset() const { return inset_; } + bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override; /// - virtual std::string const & name() const { return name_; } + void doDispatch(Cursor & cur, FuncRequest & cmd) override; /// - virtual std::string const inset2string(Buffer const &) const; + Inset * clone() const override { return new InsetNote(*this); } + /// used by the constructors + void init(); /// - static std::string const params2string(InsetNoteParams const &); + std::string contextMenuName() const override; /// - static void string2params(std::string const &, InsetNoteParams &); + friend class InsetNoteParams; -private: /// - static std::string const name_; - /// - InsetNote & inset_; + InsetNoteParams params_; }; - } // namespace lyx -#endif +#endif // INSET_NOTE_H