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.
|
|
|
|
*
|
|
|
|
* Copyright: (c) 1996, Alejandro Aguilar Sierra
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "formula.h"
|
|
|
|
|
|
|
|
class MathMacroTemplate;
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
class InsetFormulaMacro: public InsetFormula {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
InsetFormulaMacro();
|
|
|
|
///
|
1999-11-24 22:14:46 +00:00
|
|
|
InsetFormulaMacro(string name, int na = 0, bool env = false);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
~InsetFormulaMacro();
|
|
|
|
///
|
1999-11-24 22:14:46 +00:00
|
|
|
int Ascent(LyXFont const & font) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-24 22:14:46 +00:00
|
|
|
int Descent(LyXFont const & font) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-24 22:14:46 +00:00
|
|
|
int Width(LyXFont const & font) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-24 22:14:46 +00:00
|
|
|
void Draw(LyXFont font, LyXScreen & scr, int baseline, float & x);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-24 22:14:46 +00:00
|
|
|
void Read(LyXLex & lex);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-24 22:14:46 +00:00
|
|
|
void Write(FILE * file);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-24 22:14:46 +00:00
|
|
|
int Latex(FILE * file, signed char fragile);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-24 22:14:46 +00:00
|
|
|
int Latex(string & file, signed char fragile);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-24 22:14:46 +00:00
|
|
|
int Linuxdoc(string & file);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-24 22:14:46 +00:00
|
|
|
int DocBook(string & file);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-24 22:14:46 +00:00
|
|
|
Inset * Clone() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// what appears in the minibuffer when opening
|
1999-11-25 13:15:52 +00:00
|
|
|
char const * EditMessage() const {return _("Math macro editor mode");}
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
void Edit(int x, int y);
|
|
|
|
///
|
|
|
|
void InsetUnlock();
|
|
|
|
|
1999-11-24 22:14:46 +00:00
|
|
|
bool LocalDispatch(int, char const *);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void UpdateLocal();
|
|
|
|
private:
|
|
|
|
bool opened;
|
1999-10-02 16:21:10 +00:00
|
|
|
string name;
|
1999-11-24 22:14:46 +00:00
|
|
|
class MathMacroTemplate * tmacro;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|