X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetNote.h;h=32bb26bbf663f5fcf368d8f94d8c58d0bcf3e196;hb=b198a36a363bb6a084407d476942d68ef5fb5e86;hp=0cb7313305276614e6f2b4880847b0b8b3be5551;hpb=ed858d73e57ce7aa89e38c1bc4d799362edb0227;p=lyx.git diff --git a/src/insets/InsetNote.h b/src/insets/InsetNote.h index 0cb7313305..32bb26bbf6 100644 --- a/src/insets/InsetNote.h +++ b/src/insets/InsetNote.h @@ -9,23 +9,21 @@ * 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, Comment, - Greyedout, - Framed, - Shaded + Greyedout }; /// \c type defaults to Note InsetNoteParams(); @@ -38,84 +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 &); /// - Inset::Code lyxCode() const { return Inset::NOTE_CODE; } + static void string2params(std::string const &, InsetNoteParams &); /// - docstring name() const; - /// framed and shaded notes are displayed - virtual DisplayType display() const; + InsetNoteParams const & params() const { return params_; } +private: /// - void write(Buffer const &, std::ostream &) const; + InsetCode lyxCode() const override { return NOTE_CODE; } /// - void read(Buffer const & buf, Lexer & lex); + docstring layoutName() const override; /// - void setButtonLabel(); - /// show the note dialog - bool showInsetDialog(BufferView * bv) const; + 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; } /// - int latex(Buffer const &, odocstream &, OutputParams const &) const; + bool allowSpellCheck() const override; /// - int plaintext(Buffer const &, odocstream &, OutputParams const &) const; + FontInfo getFont() const override; /// - int docbook(Buffer const &, odocstream &, OutputParams const &) const; + void write(std::ostream &) const override; /// - void validate(LaTeXFeatures &) const; + void read(Lexer & lex) override; + /// show the note dialog + bool showInsetDialog(BufferView * bv) const override; /// - InsetNoteParams const & params() const { return params_; } + bool isMacroScope() 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 &); + void latex(otexstream &, OutputParams const &) const override; /// - virtual void doDispatch(Cursor & cur, FuncRequest & cmd); -private: - friend class InsetNoteParams; - - virtual Inset * clone() const; - - /// used by the constructors - void init(); + int plaintext(odocstringstream & ods, OutputParams const & op, + size_t max_length = INT_MAX) const override; /// - InsetNoteParams params_; -}; - - -class InsetNoteMailer : public MailInset { -public: + void docbook(XMLStream &, OutputParams const &) const override; /// - InsetNoteMailer(InsetNote & inset); + docstring xhtml(XMLStream &, OutputParams const &) const override; /// - virtual Inset & inset() const { return inset_; } + void validate(LaTeXFeatures &) const override; /// - virtual std::string const & name() const { return name_; } + bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override; /// - virtual std::string const inset2string(Buffer const &) const; + void doDispatch(Cursor & cur, FuncRequest & cmd) override; /// - static std::string const params2string(InsetNoteParams const &); + Inset * clone() const override { return new InsetNote(*this); } + /// used by the constructors + void init(); /// - static void string2params(std::string const &, InsetNoteParams &); - -private: + std::string contextMenuName() const override; /// - static std::string const name_; + friend class InsetNoteParams; + /// - InsetNote & inset_; + InsetNoteParams params_; }; - } // namespace lyx -#endif +#endif // INSET_NOTE_H