1999-09-27 18:44:28 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-09-25 14:26:13 +00:00
|
|
|
|
/**
|
2007-04-25 01:24:38 +00:00
|
|
|
|
* \file InsetRef.h
|
2002-09-25 14:26:13 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
1999-09-27 18:44:28 +00:00
|
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
|
* \author Jos<EFBFBD> Matos
|
2002-03-21 17:09:55 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-09-25 14:26:13 +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
|
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
|
#include "InsetCommand.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
|
|
|
2004-02-13 11:05:29 +00:00
|
|
|
|
/// The reference inset
|
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 {
|
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string latex_name;
|
2001-01-21 21:41:35 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string gui_name;
|
2001-01-21 21:41:35 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string short_gui_name;
|
2001-01-21 21:41:35 +00:00
|
|
|
|
};
|
|
|
|
|
static type_info types[];
|
2001-01-26 17:11:01 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
static int getType(std::string const & name);
|
2001-01-26 17:11:01 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
static std::string const & getName(int type);
|
2001-01-21 21:41:35 +00:00
|
|
|
|
|
2003-06-03 15:10:14 +00:00
|
|
|
|
|
2003-05-26 09:13:55 +00:00
|
|
|
|
InsetRef(InsetCommandParams const &, Buffer const &);
|
2003-06-03 15:10:14 +00:00
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
docstring 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
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
Code lyxCode() const { return REF_CODE; }
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2007-05-18 14:32:29 +00:00
|
|
|
|
DisplayType display() const { return Inline; }
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
int latex(Buffer const &, odocstream &, OutputParams const &) const;
|
2000-03-06 02:42:40 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
int plaintext(Buffer const &, odocstream &, OutputParams const &) const;
|
2000-04-24 20:58:23 +00:00
|
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
|
int docbook(Buffer const &, odocstream &, OutputParams const &) const;
|
2005-11-25 14:40:34 +00:00
|
|
|
|
/// the string that is passed to the TOC
|
2006-10-21 00:16:43 +00:00
|
|
|
|
virtual int textString(Buffer const &, odocstream &,
|
2005-11-25 14:40:34 +00:00
|
|
|
|
OutputParams const &) const;
|
2000-05-19 16:46:01 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
void validate(LaTeXFeatures & features) const;
|
2003-10-17 18:01:15 +00:00
|
|
|
|
protected:
|
2004-11-23 23:04:52 +00:00
|
|
|
|
InsetRef(InsetRef const &);
|
|
|
|
|
|
2003-10-17 18:01:15 +00:00
|
|
|
|
///
|
2007-04-26 14:56:30 +00:00
|
|
|
|
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
private:
|
2007-08-30 18:03:17 +00:00
|
|
|
|
virtual Inset * clone() const {
|
|
|
|
|
return new InsetRef(*this);
|
2004-11-23 23:04:52 +00:00
|
|
|
|
}
|
2000-10-10 11:50:43 +00:00
|
|
|
|
///
|
|
|
|
|
bool isLatex;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
};
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
#endif
|