]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetref.h
Rename LatexRunParams::fragile as moving_arg.
[lyx.git] / src / insets / insetref.h
index c1e12cc90b710bdfd5c575ec232186b4dda46fbd..532c7eaa2a60a1dc4e634a12e3209b776436df85 100644 (file)
 // -*- C++ -*-
-/* This file is part of*
- * ======================================================
+/**
+ * \file insetref.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
- *      
- *         Copyright 1997 LyX Team (this file was created this year)
- * 
- * ====================================================== */
+ * \author José Matos
+ *
+ * Full author contact details are available in file CREDITS
+ */
 
 #ifndef INSET_REF_H
 #define INSET_REF_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
 
 #include "insetcommand.h"
-#include "buffer.h"
 
 struct LaTeXFeatures;
 
-/** The reference inset  
+/** The reference inset
  */
-class InsetRef: public InsetCommand {
+class InsetRef : public InsetCommand {
 public:
-        ///
-        enum Ref_Flags {
-               ///
-               REF = 0,
+       struct type_info {
                ///
-               PAGE_REF,
+               string latex_name;
                ///
-               VREF,
+               string gui_name;
                ///
-               VPAGE_REF,
-               ///
-               PRETTY_REF,
-               ///
-               REF_LAST = PRETTY_REF,
-               ///
-               REF_FIRST = REF
+               string short_gui_name;
        };
-       
+       static type_info types[];
+       ///
+       static int getType(string const & name);
        ///
-       InsetRef() : InsetCommand("ref") { flag = InsetRef::REF; }
+       static string const & getName(int type);
+
+       ///
+       InsetRef(InsetCommandParams const &, Buffer const &, bool same_id = false);
        ///
-       InsetRef(string const &, Buffer *);
+       ~InsetRef();
        ///
-       InsetRef(InsetCommand const &, Buffer *);
-        ///
-        Inset * Clone() const {
-               return new InsetRef (getCommand(), master);
+       virtual Inset * clone(Buffer const & buffer, bool same_id = false) const {
+               return new InsetRef(params(), buffer, same_id);
        }
        ///
-       Inset::Code LyxCode() const { return Inset::REF_CODE; }
+       dispatch_result localDispatch(FuncRequest const & cmd);
        ///
-       void Edit(BufferView *, int, int, unsigned int);
+       string const getScreenLabel(Buffer const *) const;
        ///
-       EDITABLE Editable() const {
-               return IS_EDITABLE;
-       }
-        ///
-       bool display() const { return false; }
+       EDITABLE editable() const { return IS_EDITABLE; }
        ///
-       string getScreenLabel() const;
+       Inset::Code lyxCode() const { return Inset::REF_CODE; }
        ///
-       void Toggle();
-        ///
-        void gotoLabel();
+       bool display() const { return false; }
        ///
-       int Latex(std::ostream &, bool fragile, bool free_spc) const;
+       int latex(Buffer const *, std::ostream &,
+                 LatexRunParams const &) const;
        ///
-       int Ascii(std::ostream &) const;
+       int ascii(Buffer const *, std::ostream &, int linelen) const;
        ///
-       int Linuxdoc(std::ostream &) const;
+       int linuxdoc(Buffer const *, std::ostream &) const;
        ///
-       int DocBook(std::ostream &) const;
+       int docbook(Buffer const *, std::ostream &, bool mixcont) const;
        ///
-       void Validate(LaTeXFeatures & features) const;
+       void validate(LaTeXFeatures & features) const;
 private:
        ///
-       void GenerateFlag();
-       /// This function escapes 8-bit characters
-       string escape(string const &) const;
-       ///
-        Ref_Flags flag;
-        ///
-       Buffer * master;
+       bool isLatex;
 };
-
-
-inline
-void InsetRef::gotoLabel()
-{
-    if (master) {
-       master->getUser()->gotoLabel(getContents());
-    }
-}
 #endif