]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathRef.h
New DocBook support
[lyx.git] / src / mathed / InsetMathRef.h
index daf0c8c3169ed6119bb031546134fbd209e6c491..1f5e0b8bb8327d8aee6388d3470635918faf5cb7 100644 (file)
@@ -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.
  */
 
 
 #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);
        ///
-       explicit RefInset(std::string const & data);
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted = false);
        ///
        //void write(WriteStream & os) const;
        ///
-       void infoize(std::ostream & os) const;
+       void infoize(odocstream & os) const;
+       ///
+       mode_type currentMode() const { return TEXT_MODE; }
+       ///
+       bool lockedMode() const { return true; }
+       ///
+       bool asciiOnly() const { return true; }
        ///
-       std::string const screenLabel() const;
+       docstring const screenLabel() const;
        ///
        void validate(LaTeXFeatures & features) const;
        ///
-       virtual RefInset * asRefInset() { return this; }
+       void changeTarget(docstring const & target);
+       ///
+       virtual InsetMathRef * asRefInset() { 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;
+       /// generate something that will be understood by the Dialogs.
+       std::string const createDialogStr() 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);
+       static int getType(docstring const & name);
+       ///
+       static docstring const & getName(int type);
+       ///
+       docstring const getTarget() const;
        ///
-       static std::string const & getName(int type);
+       InsetCode lyxCode() const { return MATH_REF_CODE; }
+
 protected:
        ///
-       virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
+       virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
        ///
-       bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
+       bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
 private:
        ///
-       virtual std::auto_ptr<InsetBase> doClone() const;
+       virtual Inset * clone() const;
 };
 
+
+
+} // namespace lyx
 #endif