// -*- 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 {
+ struct type_info {
+ ///
+ string latex_name;
///
- REF,
+ string gui_name;
///
- PAGE_REF
+ string short_gui_name;
};
-
+ static type_info types[];
///
- InsetRef() : InsetCommand("ref") { flag = InsetRef::REF; }
+ static int getType(string const & name);
///
- InsetRef(string const &, Buffer *);
+ static string const & getName(int type);
+
+
+ InsetRef(InsetCommandParams const &, Buffer const &);
+
+ InsetRef(InsetRef const &);
+
+ ~InsetRef();
///
- InsetRef(InsetCommand const &, Buffer *);
- ///
- Inset * Clone() const {
- return new InsetRef (getCommand(), master);
+ virtual std::auto_ptr<InsetBase> clone() const {
+ return std::auto_ptr<InsetBase>(new InsetRef(*this));
}
///
- 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;
+ InsetOld::Code lyxCode() const { return InsetOld::REF_CODE; }
///
- InsetRef::Ref_Flags getFlag() { return flag; }
+ bool display() const { return false; }
///
- void setFlag(InsetRef::Ref_Flags f) { flag = f; }
- ///
- void gotoLabel();
+ int latex(Buffer const *, std::ostream &,
+ LatexRunParams const &) const;
///
- int Latex(std::ostream &, signed char fragile, bool free_spc) 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;
private:
- /// 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