X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathRef.h;h=6d7f0a10cf99341590871073810d24909a5bc7fa;hb=c609e9cbcf;hp=c70158252f2aeee63e605fceb797974c6998689e;hpb=6c300f72a217722652dc27db9108e1050028979c;p=lyx.git diff --git a/src/mathed/InsetMathRef.h b/src/mathed/InsetMathRef.h index c70158252f..6d7f0a10cf 100644 --- a/src/mathed/InsetMathRef.h +++ b/src/mathed/InsetMathRef.h @@ -4,7 +4,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author André Pönitz + * \author André Pönitz * * Full author contact details are available in file CREDITS. */ @@ -20,49 +20,66 @@ namespace lyx { class Buffer; // for \ref -class RefInset : public CommandInset { +class InsetMathRef : public InsetMathCommand { public: /// - RefInset(); + explicit InsetMathRef(Buffer * buf); /// - explicit RefInset(std::string const & data); + explicit InsetMathRef(Buffer * buf, docstring const & data); /// - //void write(WriteStream & os) const; + void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false) override; /// - void infoize(std::ostream & os) const; + void write(TeXMathStream & os) const override; /// - docstring const screenLabel() const; + void infoize(odocstream & os) const override; /// - void validate(LaTeXFeatures & features) const; + bool hasSettings() const override { return true; } /// - virtual RefInset * asRefInset() { return this; } + bool clickable(BufferView const &, int, int) const override { return true; } + /// + std::string contextMenuName() const override { return "context-mathref"; } + /// + mode_type currentMode() const override { return TEXT_MODE; } + /// + bool lockedMode() const override { return true; } + /// + bool asciiOnly() const override { return true; } + /// + docstring const screenLabel() const override; + /// + void validate(LaTeXFeatures & features) const override; + /// + void changeTarget(docstring const & target); + /// + InsetMathRef * asRefInset() override { return this; } - /// plain text output in ucs4 encoding - int plaintext(odocstream &, OutputParams const &) const; /// docbook output - int docbook(Buffer const & buf, odocstream & os, OutputParams const &) const; + void docbook(XMLStream &, OutputParams const &) const override; + /// generate something that will be understood by the Dialogs. + std::string const createDialogStr(std::string const & type = std::string()) const; struct ref_type_info { /// - std::string latex_name; + docstring latex_name; /// - std::string gui_name; + docstring gui_name; /// - std::string short_gui_name; + docstring short_gui_name; }; static ref_type_info types[]; /// - static int getType(std::string const & name); + docstring const getTarget() const; /// - static std::string const & getName(int type); + InsetCode lyxCode() const override { return MATH_REF_CODE; } + protected: /// - virtual void doDispatch(LCursor & cur, FuncRequest & cmd); + void doDispatch(Cursor & cur, FuncRequest & cmd) override; /// - bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const; + bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override; private: /// - virtual std::auto_ptr doClone() const; + Inset * clone() const override; };