]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathRef.h
Avoid full metrics computation with Update:FitCursor
[lyx.git] / src / mathed / InsetMathRef.h
index 7b788c78145cdda6d94153cbcc06f63a4479e16a..6d7f0a10cf99341590871073810d24909a5bc7fa 100644 (file)
 #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(Buffer * buf);
+       explicit InsetMathRef(Buffer * buf);
        ///
        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,20 +68,18 @@ public:
        };
        static ref_type_info types[];
        ///
-       static int getType(docstring const & name);
-       ///
-       static docstring const & getName(int type);
+       docstring const getTarget() const;
        ///
-       InsetCode lyxCode() const { return MATH_REF_CODE; }
+       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;
 };