]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/ref_inset.h
Fix to bug 2362: Deleting superscript also deletes subscript.
[lyx.git] / src / mathed / ref_inset.h
index 52c5f936d9b0f4fc4469794c3811712a2e58bac3..cf5298ef1a138b16a74dabaadee7633b2a46de6c 100644 (file)
@@ -1,49 +1,67 @@
+// -*- C++ -*-
+/**
+ * \file ref_inset.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
 #ifndef REF_INSET_H
 #define REF_INSET_H
 
+
 #include "command_inset.h"
+class Buffer;
 
-// for \ref 
+// for \ref
 class RefInset : public CommandInset {
 public:
        ///
        RefInset();
        ///
-       explicit RefInset(string const & data);
-       ///
-       MathInset * clone() const;
+       explicit RefInset(std::string const & data);
        ///
        //void write(WriteStream & os) const;
        ///
        void infoize(std::ostream & os) const;
        ///
-       int dispatch(FuncRequest const & cmd, idx_type idx, pos_type pos);
-       ///
-       string screenLabel() const;
+       std::string const screenLabel() const;
        ///
        void validate(LaTeXFeatures & features) const;
+       ///
+       virtual RefInset * asRefInset() { return this; }
 
        /// plain ascii output
-       int ascii(std::ostream & os, int) const;
+       int plaintext(std::ostream & os, OutputParams const &) const;
        /// linuxdoc output
-       int linuxdoc(std::ostream & os) const;
+       int linuxdoc(std::ostream & os, OutputParams const &) const;
        /// docbook output
-       int docbook(std::ostream & os, bool) const;
+       int docbook(Buffer const & buf, std::ostream & os, OutputParams const &) const;
 
-
-       struct type_info {
+       struct ref_type_info {
                ///
-               string latex_name;
+               std::string latex_name;
                ///
-               string gui_name;
+               std::string gui_name;
                ///
-               string short_gui_name;
+               std::string short_gui_name;
        };
-       static type_info types[];
+       static ref_type_info types[];
+       ///
+       static int getType(std::string const & name);
+       ///
+       static std::string const & getName(int type);
+protected:
+       ///
+       virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
        ///
-       static int getType(string const & name);
+       bool getStatus(LCursor &, FuncRequest const &, FuncStatus &) const;
+private:
        ///
-       static string const & getName(int type);
+       virtual std::auto_ptr<InsetBase> doClone() const;
 };
 
 #endif