1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of*
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
2002-03-21 17:09:55 +00:00
|
|
|
*
|
2000-03-09 03:36:48 +00:00
|
|
|
* Copyright 1997 LyX Team (this file was created this year)
|
2002-03-21 17:09:55 +00:00
|
|
|
*
|
1999-11-15 10:58:38 +00:00
|
|
|
* ====================================================== */
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
#ifndef INSET_REF_H
|
|
|
|
#define INSET_REF_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "insetcommand.h"
|
|
|
|
|
|
|
|
struct LaTeXFeatures;
|
|
|
|
|
2002-03-21 17:09:55 +00:00
|
|
|
/** The reference inset
|
1999-09-27 18:44:28 +00:00
|
|
|
*/
|
2000-07-15 23:51:46 +00:00
|
|
|
class InsetRef : public InsetCommand {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
2001-01-21 21:41:35 +00:00
|
|
|
struct type_info {
|
|
|
|
///
|
|
|
|
string latex_name;
|
|
|
|
///
|
|
|
|
string gui_name;
|
|
|
|
///
|
|
|
|
string short_gui_name;
|
|
|
|
};
|
|
|
|
static type_info types[];
|
2001-01-26 17:11:01 +00:00
|
|
|
///
|
|
|
|
static int getType(string const & name);
|
|
|
|
///
|
|
|
|
static string const & getName(int type);
|
2001-01-21 21:41:35 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-07-06 15:57:54 +00:00
|
|
|
InsetRef(InsetCommandParams const &, Buffer const &, bool same_id = false);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-07-06 15:57:54 +00:00
|
|
|
virtual Inset * clone(Buffer const & buffer, bool same_id = false) const {
|
|
|
|
return new InsetRef(params(), buffer, same_id);
|
2000-10-10 11:50:43 +00:00
|
|
|
}
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-07-28 12:24:16 +00:00
|
|
|
string const getScreenLabel(Buffer const *) const;
|
2000-08-04 13:12:30 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
EDITABLE editable() const { return IS_EDITABLE; }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
Inset::Code lyxCode() const { return Inset::REF_CODE; }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2002-05-26 17:33:14 +00:00
|
|
|
void edit(BufferView *, int, int, mouse_button::state);
|
2001-07-20 14:18:48 +00:00
|
|
|
///
|
|
|
|
void edit(BufferView * bv, bool front = true);
|
|
|
|
///
|
1999-11-22 16:19:48 +00:00
|
|
|
bool display() const { return false; }
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
int latex(Buffer const *, std::ostream &,
|
2002-03-21 17:09:55 +00:00
|
|
|
bool fragile, bool free_spc) const;
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
int ascii(Buffer const *, std::ostream &, int linelen) const;
|
2000-04-24 20:58:23 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
int linuxdoc(Buffer const *, std::ostream &) const;
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
2001-09-04 11:02:09 +00:00
|
|
|
int docbook(Buffer const *, std::ostream &) const;
|
2000-05-19 16:46:01 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
void validate(LaTeXFeatures & features) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
private:
|
2000-10-10 11:50:43 +00:00
|
|
|
///
|
|
|
|
bool isLatex;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
#endif
|