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
|
|
|
|
|
|
2007-04-30 10:31:51 +00:00
|
|
|
|
#include "InsetMath.h"
|
2001-02-13 17:08:51 +00:00
|
|
|
|
|
2008-03-15 00:22:54 +00:00
|
|
|
|
#include "support/docstring.h"
|
|
|
|
|
|
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.
|
2007-04-30 10:31:51 +00:00
|
|
|
|
class MathMacroArgument : public InsetMath {
|
2001-02-13 17:08:51 +00:00
|
|
|
|
public:
|
2001-02-26 12:53:35 +00:00
|
|
|
|
///
|
2008-03-15 00:22:54 +00:00
|
|
|
|
explicit MathMacroArgument(int number);
|
2001-02-26 12:53:35 +00:00
|
|
|
|
///
|
2007-09-21 20:39:47 +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
|
|
|
|
///
|
2008-03-15 00:22:54 +00:00
|
|
|
|
int number() const { return number_; }
|
2004-04-13 06:27:29 +00:00
|
|
|
|
///
|
2008-03-15 00:22:54 +00:00
|
|
|
|
void setNumber(int n);
|
2007-11-01 11:13:07 +00:00
|
|
|
|
///
|
2007-10-13 09:04:52 +00:00
|
|
|
|
InsetCode 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:
|
2008-03-15 00:22:54 +00:00
|
|
|
|
Inset * clone() const;
|
2001-04-24 16:13:38 +00:00
|
|
|
|
/// A number between 1 and 9
|
2008-03-15 00:22:54 +00:00
|
|
|
|
int 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
|