2003-08-19 13:00:56 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2006-09-17 09:14:18 +00:00
|
|
|
* \file InsetMathRef.h
|
2003-08-19 13:00:56 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2003-08-19 13:00:56 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
2002-06-24 15:51:35 +00:00
|
|
|
#ifndef REF_INSET_H
|
|
|
|
#define REF_INSET_H
|
|
|
|
|
2002-09-11 09:14:57 +00:00
|
|
|
|
2007-04-25 16:11:45 +00:00
|
|
|
#include "CommandInset.h"
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace lyx {
|
2004-11-02 11:25:20 +00:00
|
|
|
class Buffer;
|
2002-06-24 15:51:35 +00:00
|
|
|
|
2002-12-01 22:59:25 +00:00
|
|
|
// for \ref
|
2007-04-28 20:49:56 +00:00
|
|
|
class InsetMathRef : public CommandInset {
|
2002-06-24 15:51:35 +00:00
|
|
|
public:
|
|
|
|
///
|
2007-04-28 20:49:56 +00:00
|
|
|
InsetMathRef();
|
2002-06-24 15:51:35 +00:00
|
|
|
///
|
2007-04-28 20:49:56 +00:00
|
|
|
explicit InsetMathRef(docstring const & data);
|
2002-06-24 15:51:35 +00:00
|
|
|
///
|
|
|
|
//void write(WriteStream & os) const;
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
void infoize(odocstream & os) const;
|
2002-06-24 15:51:35 +00:00
|
|
|
///
|
2006-10-21 00:16:43 +00:00
|
|
|
docstring const screenLabel() const;
|
2002-06-24 15:51:35 +00:00
|
|
|
///
|
|
|
|
void validate(LaTeXFeatures & features) const;
|
2003-02-25 18:21:48 +00:00
|
|
|
///
|
2007-04-28 20:49:56 +00:00
|
|
|
virtual InsetMathRef * asRefInset() { return this; }
|
2002-06-24 15:51:35 +00:00
|
|
|
|
|
|
|
/// docbook output
|
2008-02-27 20:43:16 +00:00
|
|
|
int docbook(odocstream & os, OutputParams const &) const;
|
2007-04-06 08:30:37 +00:00
|
|
|
/// generate something that will be understood by the Dialogs.
|
|
|
|
std::string const createDialogStr(std::string const & name) const;
|
2002-06-24 15:51:35 +00:00
|
|
|
|
2003-02-13 08:12:51 +00:00
|
|
|
struct ref_type_info {
|
2002-06-24 15:51:35 +00:00
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
docstring latex_name;
|
2002-06-24 15:51:35 +00:00
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
docstring gui_name;
|
2002-06-24 15:51:35 +00:00
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
docstring short_gui_name;
|
2002-06-24 15:51:35 +00:00
|
|
|
};
|
2003-02-13 08:12:51 +00:00
|
|
|
static ref_type_info types[];
|
2002-06-24 15:51:35 +00:00
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
static int getType(docstring const & name);
|
2002-06-24 15:51:35 +00:00
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
static docstring const & getName(int type);
|
2009-07-16 19:00:24 +00:00
|
|
|
///
|
|
|
|
InsetCode lyxCode() const { return MATH_REF_CODE; }
|
|
|
|
|
2003-10-17 18:01:15 +00:00
|
|
|
protected:
|
2005-11-22 13:52:25 +00:00
|
|
|
///
|
2007-04-26 14:56:30 +00:00
|
|
|
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
|
2005-11-22 13:52:25 +00:00
|
|
|
///
|
2007-04-26 14:56:30 +00:00
|
|
|
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
|
2005-02-23 12:01:50 +00:00
|
|
|
private:
|
|
|
|
///
|
2007-08-30 18:03:17 +00:00
|
|
|
virtual Inset * clone() const;
|
2002-06-24 15:51:35 +00:00
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
2002-06-24 15:51:35 +00:00
|
|
|
#endif
|