2002-09-11 08:26:02 +00:00
|
|
|
// -*- C++ -*-
|
2002-12-01 22:59:25 +00:00
|
|
|
/**
|
2017-07-05 12:31:28 +00:00
|
|
|
* \file InsetMathCommand.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.
|
2002-09-11 08:26:02 +00:00
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2002-09-11 08:26:02 +00:00
|
|
|
*
|
2003-08-19 13:00:56 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-09-11 08:26:02 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2002-06-24 15:51:35 +00:00
|
|
|
#ifndef COMMAND_INSET_H
|
|
|
|
#define COMMAND_INSET_H
|
|
|
|
|
2006-09-17 09:14:18 +00:00
|
|
|
#include "InsetMathNest.h"
|
2004-02-16 11:58:51 +00:00
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
#include "insets/RenderButton.h"
|
2003-06-12 08:52:36 +00:00
|
|
|
|
2002-06-24 15:51:35 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
|
2002-09-11 08:26:02 +00:00
|
|
|
/// Inset for things like \name[options]{contents}
|
2017-07-05 12:31:28 +00:00
|
|
|
class InsetMathCommand : public InsetMathNest {
|
2002-06-24 15:51:35 +00:00
|
|
|
public:
|
2003-03-04 18:54:56 +00:00
|
|
|
///
|
2017-07-05 12:31:28 +00:00
|
|
|
explicit InsetMathCommand(Buffer * buf, docstring const & name,
|
2009-11-08 11:45:46 +00:00
|
|
|
bool needs_math_mode = true);
|
2002-06-24 15:51:35 +00:00
|
|
|
///
|
2017-02-08 15:42:14 +00:00
|
|
|
marker_type marker(BufferView const *) const { return NO_MARKER; }
|
2017-02-03 09:47:33 +00:00
|
|
|
///
|
2007-09-21 20:39:47 +00:00
|
|
|
void metrics(MetricsInfo & mi, Dimension & dim) const;
|
2003-06-12 08:52:36 +00:00
|
|
|
///
|
|
|
|
void draw(PainterInfo & pi, int x, int y) const;
|
|
|
|
///
|
2007-04-29 13:39:47 +00:00
|
|
|
Inset * editXY(Cursor &, int, int);
|
2005-11-22 13:52:25 +00:00
|
|
|
///
|
2002-06-24 15:51:35 +00:00
|
|
|
void write(WriteStream & os) const;
|
2003-06-28 01:23:11 +00:00
|
|
|
//
|
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
|
|
|
virtual docstring const screenLabel() const;
|
2004-04-18 19:57:58 +00:00
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
docstring const & commandname() const { return name_; }
|
2007-06-11 18:26:42 +00:00
|
|
|
///
|
|
|
|
bool isActive() const { return false; }
|
|
|
|
|
2003-06-12 08:52:36 +00:00
|
|
|
private:
|
2007-08-30 18:03:17 +00:00
|
|
|
virtual Inset * clone() const;
|
2004-11-23 23:04:52 +00:00
|
|
|
|
2004-04-18 19:57:58 +00:00
|
|
|
///
|
2006-10-22 10:15:23 +00:00
|
|
|
docstring name_;
|
2004-04-18 19:57:58 +00:00
|
|
|
///
|
2008-06-16 01:21:17 +00:00
|
|
|
bool needs_math_mode_;
|
|
|
|
///
|
2003-06-12 08:52:36 +00:00
|
|
|
mutable bool set_label_;
|
2004-04-18 19:57:58 +00:00
|
|
|
///
|
2003-10-10 21:08:55 +00:00
|
|
|
mutable RenderButton button_;
|
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
|