X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathRef.h;h=6d7f0a10cf99341590871073810d24909a5bc7fa;hb=c609e9cbcf;hp=da324522b9de9e8be4a5531331dacb86976d57e4;hpb=f1cba8ff64b369792fd49f5ddf90e8126ab476ac;p=lyx.git diff --git a/src/mathed/InsetMathRef.h b/src/mathed/InsetMathRef.h index da324522b9..6d7f0a10cf 100644 --- a/src/mathed/InsetMathRef.h +++ b/src/mathed/InsetMathRef.h @@ -13,34 +13,50 @@ #define REF_INSET_H -#include "CommandInset.h" +#include "InsetMathCommand.h" namespace lyx { class Buffer; // for \ref -class InsetMathRef : public CommandInset { +class InsetMathRef : public InsetMathCommand { public: /// - InsetMathRef(); + explicit InsetMathRef(Buffer * buf); /// - explicit InsetMathRef(docstring 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(odocstream & 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 InsetMathRef * 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; } /// docbook output - int docbook(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 & name) const; + std::string const createDialogStr(std::string const & type = std::string()) const; struct ref_type_info { /// @@ -52,17 +68,18 @@ public: }; static ref_type_info types[]; /// - static int getType(docstring const & name); + docstring const getTarget() const; /// - static docstring const & getName(int type); + InsetCode lyxCode() const override { return MATH_REF_CODE; } + protected: /// - virtual void doDispatch(Cursor & cur, FuncRequest & cmd); + void doDispatch(Cursor & cur, FuncRequest & cmd) override; /// - bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; + bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override; private: /// - virtual Inset * clone() const; + Inset * clone() const override; };