]> git.lyx.org Git - lyx.git/blob - src/mathed/formulamacro.h
mathed64.diff
[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 "formula.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 InsetFormula {
34 public:
35         ///
36         InsetFormulaMacro();
37         ///
38         explicit
39         InsetFormulaMacro(string name, int na);
40         ///
41         int ascent(BufferView *, LyXFont const &) const;
42         ///
43         int descent(BufferView *, LyXFont const &) const;
44         ///
45         int width(BufferView *, LyXFont const &) const;
46         ///
47         void draw(BufferView *,LyXFont const &, int, float &, bool) const;
48         ///
49         void Read(Buffer const *, LyXLex & lex);
50         ///
51         void Write(Buffer const *, std::ostream & os) const;
52         ///
53         int Latex(Buffer const *, std::ostream & os, bool fragile,
54                   bool free_spc) const;
55         ///
56         int Linuxdoc(Buffer const *, std::ostream & os) const;
57         ///
58         int DocBook(Buffer const *, std::ostream &) const;
59         ///
60         Inset * Clone(Buffer const &) const;
61         ///
62         Inset::Code LyxCode() const;
63         /// what appears in the minibuffer when opening
64         string const EditMessage() const;
65         ///
66         RESULT LocalDispatch(BufferView *, kb_action, string const &);
67 private:
68         /// prefix in inset
69         string prefix() const;
70         ///
71         MathMacroTemplate * tmacro() const;
72 };
73
74 inline Inset::Code InsetFormulaMacro::LyxCode() const
75 {
76         return Inset::MATHMACRO_CODE;
77 }
78 #endif