* 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,
};
-/** 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(Buffer const &, std::string const &);
+ InsetNote(Buffer *, std::string const &);
///
~InsetNote();
///
+ static std::string params2string(InsetNoteParams const &);
+ ///
+ static void string2params(std::string const &, InsetNoteParams &);
+ ///
InsetNoteParams const & params() const { return params_; }
private:
///
- docstring editMessage() const;
+ InsetCode lyxCode() const override { return NOTE_CODE; }
///
- InsetCode lyxCode() const { return NOTE_CODE; }
+ docstring layoutName() const override;
///
- docstring name() 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; }
///
- virtual DisplayType display() const;
+ bool allowSpellCheck() const override;
///
- bool noFontChange() const { return params_.type != InsetNoteParams::Note; }
+ FontInfo getFont() const override;
///
- void write(std::ostream &) const;
+ void write(std::ostream &) const override;
///
- void read(Lexer & lex);
- ///
- void setButtonLabel();
+ void read(Lexer & lex) override;
/// show the note dialog
- bool showInsetDialog(BufferView * bv) const;
+ bool showInsetDialog(BufferView * bv) const override;
///
- bool isMacroScope() const;
+ bool isMacroScope() const override;
///
- int latex(odocstream &, OutputParams const &) const;
+ void latex(otexstream &, OutputParams const &) const override;
///
- int plaintext(odocstream &, OutputParams const &) const;
+ int plaintext(odocstringstream & ods, OutputParams const & op,
+ size_t max_length = INT_MAX) const override;
///
- int docbook(odocstream &, OutputParams const &) const;
+ void docbook(XMLStream &, OutputParams const &) const override;
///
- void validate(LaTeXFeatures &) const;
+ docstring xhtml(XMLStream &, OutputParams const &) const override;
///
- bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
- // Update the counters of this inset and of its contents
- void updateLabels(ParIterator const &);
+ void validate(LaTeXFeatures &) const override;
///
- void addToToc(ParConstIterator const &) const;
+ bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override;
///
- void doDispatch(Cursor & cur, FuncRequest & cmd);
+ void doDispatch(Cursor & cur, FuncRequest & cmd) override;
///
- Inset * clone() const { return new InsetNote(*this); }
+ Inset * clone() const override { return new InsetNote(*this); }
/// used by the constructors
void init();
///
+ std::string contextMenuName() const override;
+ ///
friend class InsetNoteParams;
///
InsetNoteParams params_;
};
-
-class InsetNoteMailer : public MailInset {
-public:
- ///
- InsetNoteMailer(InsetNote & inset);
- ///
- virtual Inset & inset() const { return inset_; }
- ///
- virtual std::string const & name() const { return name_; }
- ///
- virtual std::string const inset2string(Buffer const &) const;
- ///
- static std::string const params2string(InsetNoteParams const &);
- ///
- static void string2params(std::string const &, InsetNoteParams &);
-
-private:
- ///
- static std::string const name_;
- ///
- InsetNote & inset_;
-};
-
-
} // namespace lyx
-#endif
+#endif // INSET_NOTE_H