1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/*
|
|
|
|
* File: formula.h
|
|
|
|
* Purpose: Declaration of formula inset
|
|
|
|
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
|
|
|
* Created: January 1996
|
|
|
|
* Description: Allows the edition of math paragraphs inside Lyx.
|
|
|
|
*
|
2000-03-09 03:36:48 +00:00
|
|
|
* Copyright: 1996, Alejandro Aguilar Sierra
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
|
|
|
* Version: 0.4, Lyx project.
|
|
|
|
*
|
|
|
|
* You are free to use and modify this code under the terms of
|
|
|
|
* the GNU General Public Licence version 2 or later.
|
|
|
|
*/
|
|
|
|
|
1999-11-15 11:06:41 +00:00
|
|
|
#ifndef INSET_FORMULA_MACRO_H
|
|
|
|
#define INSET_FORMULA_MACRO_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2001-03-01 14:07:43 +00:00
|
|
|
#include "formula.h"
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class MathMacroTemplate;
|
|
|
|
|
2001-04-24 16:13:38 +00:00
|
|
|
// InsetFormulaMacro's ParInset is the ParInset of the macro definition
|
|
|
|
// which in turn is stored in the global MathMacroTable.
|
|
|
|
// No copying/updating needed anymore...
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
class InsetFormulaMacro: public InsetFormula {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
InsetFormulaMacro();
|
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
explicit
|
2001-03-01 14:07:43 +00:00
|
|
|
InsetFormulaMacro(string name, int na);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-07-05 14:57:48 +00:00
|
|
|
int ascent(BufferView *, LyXFont const &) const;
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-07-05 14:57:48 +00:00
|
|
|
int descent(BufferView *, LyXFont const &) const;
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-07-05 14:57:48 +00:00
|
|
|
int width(BufferView *, LyXFont const &) const;
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2000-06-23 15:02:46 +00:00
|
|
|
void draw(BufferView *,LyXFont const &, int, float &, bool) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-06-12 11:27:15 +00:00
|
|
|
void Read(Buffer const *, LyXLex & lex);
|
2001-04-24 16:13:38 +00:00
|
|
|
///
|
2000-06-12 11:27:15 +00:00
|
|
|
void Write(Buffer const *, std::ostream & os) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-06-12 11:27:15 +00:00
|
|
|
int Latex(Buffer const *, std::ostream & os, bool fragile,
|
|
|
|
bool free_spc) const;
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
2000-06-12 11:27:15 +00:00
|
|
|
int Linuxdoc(Buffer const *, std::ostream & os) const;
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
2000-06-12 11:27:15 +00:00
|
|
|
int DocBook(Buffer const *, std::ostream &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-10-10 11:50:43 +00:00
|
|
|
Inset * Clone(Buffer const &) const;
|
2000-11-02 16:31:05 +00:00
|
|
|
///
|
2001-02-26 12:53:35 +00:00
|
|
|
Inset::Code LyxCode() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// what appears in the minibuffer when opening
|
2000-09-14 17:53:12 +00:00
|
|
|
string const EditMessage() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-02-23 16:10:03 +00:00
|
|
|
RESULT LocalDispatch(BufferView *, kb_action, string const &);
|
1999-09-27 18:44:28 +00:00
|
|
|
private:
|
2001-04-24 16:13:38 +00:00
|
|
|
/// prefix in inset
|
|
|
|
string prefix() const;
|
1999-12-07 00:44:53 +00:00
|
|
|
///
|
2001-04-24 16:13:38 +00:00
|
|
|
MathMacroTemplate * tmacro() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
2001-04-24 16:13:38 +00:00
|
|
|
inline Inset::Code InsetFormulaMacro::LyxCode() const
|
2001-02-26 12:53:35 +00:00
|
|
|
{
|
|
|
|
return Inset::MATHMACRO_CODE;
|
|
|
|
}
|
1999-09-27 18:44:28 +00:00
|
|
|
#endif
|