]> git.lyx.org Git - lyx.git/blob - src/mathed/formulamacro.h
ed32c0c39a3b31f2601da70fa4689fff0423e1c4
[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: (c) 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 #ifdef __GNUG__
21 #pragma interface
22 #endif
23
24 #include "formula.h"
25
26 class MathMacroTemplate;
27
28
29 ///
30 class InsetFormulaMacro: public InsetFormula {
31 public:
32         ///
33         InsetFormulaMacro();
34         ///
35         InsetFormulaMacro(string name, int na = 0, bool env = false);
36         ///
37         ~InsetFormulaMacro();
38         ///
39         int Ascent(LyXFont const & font) const;
40         ///
41         int Descent(LyXFont const & font) const;
42         ///
43         int Width(LyXFont const & font) const;
44         ///
45         void Draw(LyXFont font, LyXScreen & scr, int baseline, float & x);
46         ///
47         void Read(LyXLex & lex);
48         ///
49         void Write(FILE * file);
50         ///
51         int Latex(FILE * file, signed char fragile);
52         ///
53         int Latex(string & file, signed char fragile);
54         ///
55         int Linuxdoc(string & file);
56         ///
57         int DocBook(string & file);
58         ///
59         Inset * Clone() const;
60
61         /// what appears in the minibuffer when opening
62         char const * EditMessage() const {return _("Math macro editor mode");}
63         ///
64         void Edit(int x, int y);
65         ///
66         void InsetUnlock();
67    
68         bool LocalDispatch(int, char const *);
69    
70 protected:
71         void UpdateLocal();
72 private:
73         bool opened;
74         string name; 
75         class MathMacroTemplate * tmacro;
76
77 };
78
79
80 #endif
81