* 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.
*/
#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; }
///
- lyx::docstring 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 text output in ucs4 encoding
- int plaintext(lyx::odocstream &, OutputParams const &) const;
/// docbook output
- int docbook(Buffer const & buf, lyx::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<InsetBase> doClone() const;
+ Inset * clone() const override;
};
+
+
+} // namespace lyx
#endif