X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathRef.h;h=6d7f0a10cf99341590871073810d24909a5bc7fa;hb=c609e9cbcf;hp=daf0c8c3169ed6119bb031546134fbd209e6c491;hpb=e89625ef28143545a511cdabc67dee8b7be1b216;p=lyx.git diff --git a/src/mathed/InsetMathRef.h b/src/mathed/InsetMathRef.h index daf0c8c316..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. */ @@ -14,52 +14,75 @@ #include "InsetMathCommand.h" + + +namespace lyx { class Buffer; // for \ref -class RefInset : public CommandInset { +class InsetMathRef : public InsetMathCommand { public: /// - RefInset(); + explicit InsetMathRef(Buffer * buf); + /// + explicit InsetMathRef(Buffer * buf, docstring const & data); + /// + void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false) override; + /// + void write(TeXMathStream & os) const override; + /// + void infoize(odocstream & os) const override; + /// + bool hasSettings() const override { return true; } /// - explicit RefInset(std::string const & data); + bool clickable(BufferView const &, int, int) const override { return true; } /// - //void write(WriteStream & os) const; + std::string contextMenuName() const override { return "context-mathref"; } /// - void infoize(std::ostream & os) const; + mode_type currentMode() const override { return TEXT_MODE; } /// - std::string const screenLabel() const; + bool lockedMode() const override { return true; } /// - void validate(LaTeXFeatures & features) const; + bool asciiOnly() const override { return true; } /// - virtual RefInset * asRefInset() { return this; } + docstring const screenLabel() const override; + /// + void validate(LaTeXFeatures & features) const override; + /// + void changeTarget(docstring const & target); + /// + InsetMathRef * asRefInset() override { return this; } - /// plain ascii output - int plaintext(std::ostream & os, OutputParams const &) const; /// docbook output - int docbook(Buffer const & buf, std::ostream & 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; }; + + +} // namespace lyx #endif