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();
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
|
|
|
int ascent(Painter &, LyXFont const &) const;
|
|
|
|
///
|
|
|
|
int descent(Painter &, LyXFont const &) const;
|
|
|
|
///
|
|
|
|
int width(Painter &, LyXFont const &) const;
|
|
|
|
///
|
2000-02-25 16:42:21 +00:00
|
|
|
void draw(Painter &, LyXFont const &, int baseline, float & x) const;
|
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
|
|
|
///
|
2000-02-18 22:22:42 +00:00
|
|
|
void Write(ostream & os) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-02-18 22:22:42 +00:00
|
|
|
int Latex(ostream & os, signed char fragile) const;
|
2000-03-02 02:19:43 +00:00
|
|
|
#ifndef USE_OSTREAM_ONLY
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-02-18 22:22:42 +00:00
|
|
|
int Latex(string & file, signed char fragile) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-02-18 22:22:42 +00:00
|
|
|
int Linuxdoc(string & file) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-02-18 22:22:42 +00:00
|
|
|
int DocBook(string & file) const;
|
2000-03-06 02:42:40 +00:00
|
|
|
#else
|
|
|
|
///
|
|
|
|
int Linuxdoc(ostream &) const;
|
|
|
|
///
|
|
|
|
int DocBook(ostream &) const;
|
|
|
|
#endif
|
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
|
2000-02-25 12:06:15 +00:00
|
|
|
const char * EditMessage() const {return _("Math macro editor mode");}
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-02-25 12:06:15 +00:00
|
|
|
void Edit(BufferView *, int x, int y, unsigned int button);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-02-22 00:36:17 +00:00
|
|
|
void InsetUnlock(BufferView *);
|
1999-12-07 00:44:53 +00:00
|
|
|
///
|
2000-02-25 13:35:38 +00:00
|
|
|
RESULT LocalDispatch(BufferView *, int, string const &);
|
2000-02-25 12:06:15 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
protected:
|
1999-12-07 00:44:53 +00:00
|
|
|
///
|
2000-02-22 00:36:17 +00:00
|
|
|
//void UpdateLocal();
|
2000-02-25 12:06:15 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
private:
|
1999-12-07 00:44:53 +00:00
|
|
|
///
|
1999-09-27 18:44:28 +00:00
|
|
|
bool opened;
|
1999-12-07 00:44:53 +00:00
|
|
|
///
|
|
|
|
string name;
|
|
|
|
///
|
|
|
|
MathMacroTemplate * tmacro;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|