]> git.lyx.org Git - lyx.git/blob - src/mathed/formulamacro.h
new painter,workarea and lcolor. Read the diff/sources and ChangeLog...
[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 #ifdef USE_PAINTER
39         ///
40         int ascent(Painter &, LyXFont const &) const;
41         ///
42         int descent(Painter &, LyXFont const &) const;
43         ///
44         int width(Painter &, LyXFont const &) const;
45         ///
46         void draw(Painter &, LyXFont const &, int baseline, float & x) const;
47 #else
48         ///
49         int Ascent(LyXFont const & font) const;
50         ///
51         int Descent(LyXFont const & font) const;
52         ///
53         int Width(LyXFont const & font) const;
54         ///
55         void Draw(LyXFont font, LyXScreen & scr, int baseline, float & x);
56 #endif
57         ///
58         void Read(LyXLex & lex);
59         ///
60         void Write(ostream & os);
61         ///
62         int Latex(ostream & os, signed char fragile);
63         ///
64         int Latex(string & file, signed char fragile);
65         ///
66         int Linuxdoc(string & file);
67         ///
68         int DocBook(string & file);
69         ///
70         Inset * Clone() const;
71
72         /// what appears in the minibuffer when opening
73         char const * EditMessage() const {return _("Math macro editor mode");}
74         ///
75         void Edit(int x, int y);
76         ///
77         void InsetUnlock();
78         ///
79         bool LocalDispatch(int, char const *);
80 protected:
81         ///
82         void UpdateLocal();
83 private:
84         ///
85         bool opened;
86         ///
87         string name;
88         ///
89         MathMacroTemplate * tmacro;
90 };
91
92 #endif