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_H
|
|
|
|
#define INSET_FORMULA_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2001-07-06 12:09:32 +00:00
|
|
|
#include "LString.h"
|
2001-06-25 00:06:33 +00:00
|
|
|
#include "mathed/formulabase.h"
|
|
|
|
#include "math_defs.h"
|
2000-03-28 02:18:55 +00:00
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
class MathMatrixInset;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
class InsetFormula : public InsetFormulaBase {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
InsetFormula();
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
explicit InsetFormula(MathInsetTypes);
|
2000-02-10 17:53:36 +00:00
|
|
|
///
|
2001-07-06 12:09:32 +00:00
|
|
|
explicit InsetFormula(string const &);
|
|
|
|
///
|
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
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
void draw(BufferView *, LyXFont const &, int, float &, bool) const;
|
2001-07-06 12:09:32 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-07-06 12:09:32 +00:00
|
|
|
void write(std::ostream &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-07-06 12:09:32 +00:00
|
|
|
void read(LyXLex & lex);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-07-06 12:09:32 +00:00
|
|
|
int latex(std::ostream &,
|
2000-07-15 23:51:46 +00:00
|
|
|
bool fragile, bool free_spc) const;
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
2001-07-06 12:09:32 +00:00
|
|
|
int ascii(std::ostream &, int linelen) const;
|
2000-04-24 20:58:23 +00:00
|
|
|
///
|
2001-07-06 12:09:32 +00:00
|
|
|
int linuxdoc(std::ostream &) const;
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
2001-07-06 12:09:32 +00:00
|
|
|
int docBook(std::ostream &) const;
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
Inset * clone(Buffer const &) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
void validate(LaTeXFeatures & features) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
Inset::Code lyxCode() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
virtual RESULT localDispatch(BufferView *, kb_action, string const &);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-09-14 17:53:12 +00:00
|
|
|
std::vector<string> const getLabelList() const;
|
2001-04-25 15:43:57 +00:00
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
void handleExtern(string const & arg, BufferView * bv);
|
2000-07-15 23:51:46 +00:00
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
MathMatrixInset * par() const;
|
2000-07-15 23:51:46 +00:00
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
bool display() const;
|
2000-07-15 23:51:46 +00:00
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
bool ams() const;
|
2001-07-06 12:09:32 +00:00
|
|
|
private:
|
|
|
|
/// Safe setting of contents
|
|
|
|
void par(MathInset *);
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
#endif
|