X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetnote.h;h=9b21f8c8d7835d32a14fe789f0c6d567ce94ef2d;hb=b0eb70e869128e30ab7e4538aa32a244fd4cea57;hp=5d5a7b16db4688f8a99c4b70818935031c5de5cc;hpb=d32d0cbb9552186e0d69ee2320baf2570402fc72;p=lyx.git diff --git a/src/insets/insetnote.h b/src/insets/insetnote.h index 5d5a7b16db..9b21f8c8d7 100644 --- a/src/insets/insetnote.h +++ b/src/insets/insetnote.h @@ -1,49 +1,112 @@ // -*- C++ -*- -/* This file is part of - * ====================================================== - * - * LyX, The Document Processor +/** + * \file insetnote.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * Copyright 2001 The LyX Team. + * \author Angus Leeming * - *====================================================== + * Full author contact details are available in file CREDITS. */ #ifndef INSETNOTE_H #define INSETNOTE_H -#ifdef __GNUG__ -#pragma interface -#endif #include "insetcollapsable.h" -/** The PostIt note inset - + + struct InsetNoteParams { + /// + void write(std::ostream & os) const; + /// + void read(LyXLex & lex); + /// + std::string type; +}; + + +/** The PostIt note inset, and other annotations + */ class InsetNote : public InsetCollapsable { public: - /// - InsetNote(); /// - InsetNote(InsetNote const &, bool same_id = false); + + + InsetNote(BufferParams const &, std::string const &); + /// Copy constructor + InsetNote(InsetNote const &); + /// + ~InsetNote(); + /// + virtual std::auto_ptr clone() const; + /// + std::string const editMessage() const; + /// + InsetOld::Code lyxCode() const { return InsetOld::NOTE_CODE; } + /// + void write(Buffer const &, std::ostream &) const; + /// + void read(Buffer const & buf, LyXLex & lex); + /// + void setButtonLabel(); + /// + void metrics(MetricsInfo &, Dimension &) const; + /// show the note dialog + bool showInsetDialog(BufferView * bv) const; + /// + int latex(Buffer const &, std::ostream &, + LatexRunParams const &) const; /// - Inset * clone(Buffer const &, bool same_id = false) const; - /// constructor with initial contents - InsetNote(Buffer const *, string const & contents, bool collapsed); + int linuxdoc(Buffer const &, std::ostream &) const; /// - virtual string const editMessage() const; + int docbook(Buffer const &, std::ostream &, bool) const; /// - virtual Inset::Code lyxCode() const { return Inset::IGNORE_CODE; } + int ascii(Buffer const &, std::ostream &, int) const; /// - virtual void write(Buffer const *, std::ostream &) const; + void validate(LaTeXFeatures &) const; /// - virtual int latex(Buffer const *, std::ostream &, bool, bool) const - { return 0; } + InsetNoteParams const & params() const { return params_; } +protected: + /// + virtual + DispatchResult + priv_dispatch(FuncRequest const &, idx_type &, pos_type &); private: + friend class InsetNoteParams; + /// used by the constructors void init(); + /// + InsetNoteParams params_; +}; + +#include "mailinset.h" + +class InsetNoteMailer : public MailInset { +public: + /// + InsetNoteMailer(std::string const & name, InsetNote & inset); + /// + virtual InsetBase & 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(std::string const &, InsetNoteParams const &); + /// + static void string2params(std::string const &, InsetNoteParams &); + +private: + /// + std::string const name_; + /// + InsetNote & inset_; }; + + #endif