2003-08-19 13:00:56 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/**
|
|
|
|
|
* \file ref_inset.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
|
2002-06-24 15:51:35 +00:00
|
|
|
|
#include "command_inset.h"
|
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
|
2002-06-24 15:51:35 +00:00
|
|
|
|
class RefInset : public CommandInset {
|
|
|
|
|
public:
|
|
|
|
|
///
|
|
|
|
|
RefInset();
|
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
explicit RefInset(std::string const & data);
|
2002-06-24 15:51:35 +00:00
|
|
|
|
///
|
|
|
|
|
//void write(WriteStream & os) const;
|
|
|
|
|
///
|
|
|
|
|
void infoize(std::ostream & os) const;
|
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string const screenLabel() const;
|
2002-06-24 15:51:35 +00:00
|
|
|
|
///
|
|
|
|
|
void validate(LaTeXFeatures & features) const;
|
2003-02-25 18:21:48 +00:00
|
|
|
|
///
|
|
|
|
|
virtual RefInset * asRefInset() { return this; }
|
2002-06-24 15:51:35 +00:00
|
|
|
|
|
|
|
|
|
/// plain ascii output
|
2003-11-05 12:06:20 +00:00
|
|
|
|
int plaintext(std::ostream & os, OutputParams const &) const;
|
2002-06-24 15:51:35 +00:00
|
|
|
|
/// linuxdoc output
|
2003-11-05 12:06:20 +00:00
|
|
|
|
int linuxdoc(std::ostream & os, OutputParams const &) const;
|
2002-06-24 15:51:35 +00:00
|
|
|
|
/// docbook output
|
2004-11-02 11:25:20 +00:00
|
|
|
|
int docbook(Buffer const & buf, std::ostream & os, OutputParams const &) 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
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string latex_name;
|
2002-06-24 15:51:35 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string gui_name;
|
2002-06-24 15:51:35 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::string 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
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
static int getType(std::string const & name);
|
2002-06-24 15:51:35 +00:00
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
static std::string const & getName(int type);
|
2003-10-17 18:01:15 +00:00
|
|
|
|
protected:
|
2004-11-24 21:58:42 +00:00
|
|
|
|
virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
|
2005-02-23 12:01:50 +00:00
|
|
|
|
private:
|
|
|
|
|
///
|
|
|
|
|
virtual std::auto_ptr<InsetBase> doClone() const;
|
2002-06-24 15:51:35 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|