#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 {
///
};
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;
};