*
* LyX, The Document Processor
*
- * Copyright (C) 1997 LyX Team (this file was created this year)
+ * Copyright 1997 LyX Team (this file was created this year)
*
- *======================================================*/
+ * ====================================================== */
-#ifndef _INSET_REF_H
-#define _INSET_REF_H
+#ifndef INSET_REF_H
+#define INSET_REF_H
#ifdef __GNUG__
#pragma interface
#endif
#include "insetcommand.h"
-#include "buffer.h"
struct LaTeXFeatures;
/** 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;
};
-
- ///
- InsetRef(): InsetCommand("ref") { flag = InsetRef::REF; }
- ///
- InsetRef(string const &, Buffer*);
+ static type_info types[];
///
- InsetRef(InsetCommand const&, Buffer*);
+ static int getType(string const & name);
///
- ~InsetRef();
- ///
- Inset* Clone() { return new InsetRef (getCommand(), master); }
- ///
- Inset::Code LyxCode() const { return Inset::REF_CODE; }
+ static string const & getName(int type);
+
///
- void Edit(int, int);
+ InsetRef(InsetCommandParams const &, Buffer const &);
///
- unsigned char Editable() const {
- return 1;
+ Inset * Clone(Buffer const & buffer) const {
+ return new InsetRef(params(), buffer);
}
- ///
- bool Display() const { return false; }
///
- string getScreenLabel() const;
+ string const getScreenLabel() const;
+ ///
+ EDITABLE Editable() const { return IS_EDITABLE; }
///
- InsetRef::Ref_Flags getFlag() { return flag; }
+ Inset::Code LyxCode() const { return Inset::REF_CODE; }
///
- void setFlag(InsetRef::Ref_Flags f) { flag = f; }
+ void Edit(BufferView *, int, int, unsigned int);
///
- void gotoLabel();
+ bool display() const { return false; }
+ ///
+ int Latex(Buffer const *, std::ostream &,
+ bool fragile, bool free_spc) const;
///
- int Latex(FILE *file, signed char fragile);
+ int Ascii(Buffer const *, std::ostream &, int linelen) const;
///
- int Latex(string &file, signed char fragile);
+ int Linuxdoc(Buffer const *, std::ostream &) const;
///
- int Linuxdoc(string &file);
+ int DocBook(Buffer const *, std::ostream &) const;
///
- int DocBook(string &file);
+ void Validate(LaTeXFeatures & features) const;
private:
/// This function escapes 8-bit characters
- string escape(string const &) const;
+ string const escape(string const &) const;
///
- Ref_Flags flag;
- ///
- Buffer *master;
+ bool isLatex;
};
-
-
-inline
-void InsetRef::gotoLabel()
-{
- if (master) {
- master->gotoLabel(getContents());
- }
-}
-
#endif