]> git.lyx.org Git - lyx.git/blob - src/mathed/formulamacro.h
- fix nasty bug due to missing InsetFormula copy c'tor
[lyx.git] / src / mathed / formulamacro.h
1 // -*- C++ -*-
2 /*
3  *  File:        formula.h
4  *  Purpose:     Declaration of formula inset
5  *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx> 
6  *  Created:     January 1996
7  *  Description: Allows the edition of math paragraphs inside Lyx. 
8  *
9  *  Copyright: 1996, Alejandro Aguilar Sierra
10  *
11  *  Version: 0.4, Lyx project.
12  *
13  *   You are free to use and modify this code under the terms of
14  *   the GNU General Public Licence version 2 or later.
15  */
16
17 #ifndef INSET_FORMULA_MACRO_H 
18 #define INSET_FORMULA_MACRO_H
19
20 #include "formulabase.h"
21
22 #ifdef __GNUG__
23 #pragma interface
24 #endif
25
26 class MathMacroTemplate;
27
28 // InsetFormulaMacro's ParInset is the ParInset of the macro definition
29 // which in turn is stored in the global MathMacroTable.
30 // No copying/updating needed anymore...
31
32 ///
33 class InsetFormulaMacro: public InsetFormulaBase {
34 public:
35         ///
36         InsetFormulaMacro();
37         ///
38         InsetFormulaMacro(InsetFormulaMacro const &);
39         ///
40         explicit InsetFormulaMacro(string name, int na);
41         ///
42         ~InsetFormulaMacro();
43         ///
44         void operator=(InsetFormulaMacro const &);
45         ///
46         int ascent(BufferView *, LyXFont const &) const;
47         ///
48         int descent(BufferView *, LyXFont const &) const;
49         ///
50         int width(BufferView *, LyXFont const &) const;
51         ///
52         void draw(BufferView *,LyXFont const &, int, float &, bool) const;
53
54         ///
55         void read(LyXLex & lex);
56         ///
57         void write(std::ostream & os) const;
58         ///
59         int ascii(std::ostream &, int linelen) const;
60         ///
61         int latex(std::ostream & os, bool fragile, bool free_spc) const;
62         ///
63         int linuxdoc(std::ostream & os) const;
64         ///
65         int docBook(std::ostream &) const;
66
67         ///
68         Inset * clone(Buffer const &, bool same_id = false) const;
69         ///
70         Inset::Code lyxCode() const;
71         ///
72         RESULT localDispatch(BufferView *, kb_action, string const &);
73         ///
74         MathInsetTypes getType() const;
75         ///
76         MathInset const * par() const;
77         ///
78         void metrics() const;
79 private:
80         ///
81         MathMacroTemplate const & tmacro() const;
82         /// prefix in inset
83         string prefix() const;
84         ///
85         MathMacroTemplate const * tmacro_;
86 };
87
88 #endif