]> git.lyx.org Git - lyx.git/blob - src/mathed/formulamacro.h
the freespacing patch from Kayvan, draw the math empty delim with onoffdash, asure...
[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 #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(Painter &, LyXFont const &) const;
40         ///
41         int descent(Painter &, LyXFont const &) const;
42         ///
43         int width(Painter &, LyXFont const &) const;
44         ///
45         void draw(Painter &, LyXFont const &, int baseline, float & x) const;
46         ///
47         void Read(LyXLex & lex);
48         ///
49         void Write(ostream & os) const;
50         ///
51         int Latex(ostream & os, signed char fragile) const;
52 #ifndef USE_OSTREAM_ONLY
53         ///
54         int Latex(string & file, signed char fragile) const;
55         ///
56         int Linuxdoc(string & file) const;
57         ///
58         int DocBook(string & file) const;
59 #else
60         ///
61         int Linuxdoc(ostream &) const;
62         ///
63         int DocBook(ostream &) const;
64 #endif
65         ///
66         Inset * Clone() const;
67
68         /// what appears in the minibuffer when opening
69         const char * EditMessage() const {return _("Math macro editor mode");}
70         ///
71         void Edit(BufferView *, int x, int y, unsigned int button);
72         ///
73         void InsetUnlock(BufferView *);
74         ///
75         RESULT LocalDispatch(BufferView *, int, string const &);
76
77 protected:
78         ///
79         //void UpdateLocal();
80
81 private:
82         ///
83         bool opened;
84         ///
85         string name;
86         ///
87         MathMacroTemplate * tmacro;
88 };
89
90 #endif