2001-02-13 17:08:51 +00:00
|
|
|
|
// -*- C++ -*-
|
2003-08-19 13:00:56 +00:00
|
|
|
|
/**
|
2006-09-17 09:14:18 +00:00
|
|
|
|
* \file MathMacroArgument.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.
|
|
|
|
|
*
|
|
|
|
|
* \author Alejandro Aguilar Sierra
|
|
|
|
|
* \author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
2001-02-13 17:08:51 +00:00
|
|
|
|
#ifndef MATHMACROARGUMENT_H
|
|
|
|
|
#define MATHMACROARGUMENT_H
|
|
|
|
|
|
2006-09-17 09:14:18 +00:00
|
|
|
|
#include "InsetMathDim.h"
|
2001-02-13 17:08:51 +00:00
|
|
|
|
|
2001-02-26 12:53:35 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
|
|
|
2003-08-19 13:00:56 +00:00
|
|
|
|
/// A macro argument.
|
2006-09-16 18:11:38 +00:00
|
|
|
|
class MathMacroArgument : public InsetMathDim {
|
2001-02-13 17:08:51 +00:00
|
|
|
|
public:
|
2001-02-26 12:53:35 +00:00
|
|
|
|
///
|
2004-07-23 22:31:14 +00:00
|
|
|
|
explicit MathMacroArgument(std::size_t);
|
2001-02-26 12:53:35 +00:00
|
|
|
|
///
|
2003-06-02 10:03:27 +00:00
|
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const;
|
2001-02-26 12:53:35 +00:00
|
|
|
|
///
|
2003-03-21 14:20:48 +00:00
|
|
|
|
void draw(PainterInfo &, int x, int y) const;
|
2001-02-26 12:53:35 +00:00
|
|
|
|
///
|
2004-07-23 22:31:14 +00:00
|
|
|
|
std::size_t number() const { return number_; }
|
2004-04-13 06:27:29 +00:00
|
|
|
|
///
|
|
|
|
|
InsetBase::Code lyxCode() const { return MATHMACROARG_CODE; }
|
2001-11-09 14:23:44 +00:00
|
|
|
|
|
2001-02-26 12:53:35 +00:00
|
|
|
|
///
|
2001-11-09 08:35:57 +00:00
|
|
|
|
void normalize(NormalStream &) const;
|
2001-04-25 15:43:57 +00:00
|
|
|
|
///
|
2001-11-09 14:23:44 +00:00
|
|
|
|
void write(WriteStream & os) const;
|
2001-04-24 16:13:38 +00:00
|
|
|
|
|
|
|
|
|
private:
|
2004-11-23 23:04:52 +00:00
|
|
|
|
virtual std::auto_ptr<InsetBase> doClone() const;
|
2001-04-24 16:13:38 +00:00
|
|
|
|
/// A number between 1 and 9
|
2004-07-23 22:31:14 +00:00
|
|
|
|
std::size_t number_;
|
2001-08-03 17:55:10 +00:00
|
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
|
docstring str_;
|
2001-02-13 17:08:51 +00:00
|
|
|
|
};
|
2001-04-24 16:13:38 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2001-02-13 17:08:51 +00:00
|
|
|
|
#endif
|