]> git.lyx.org Git - lyx.git/blob - src/mathed/formulamacro.h
use the new sstream return non-pods as const, use string instead of char * in a lot...
[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         explicit
36         InsetFormulaMacro(string name, int na = 0, bool env = false);
37         ///
38         ~InsetFormulaMacro();
39         ///
40         int ascent(BufferView *, LyXFont const &) const;
41         ///
42         int descent(BufferView *, LyXFont const &) const;
43         ///
44         int width(BufferView *, LyXFont const &) const;
45         ///
46         void draw(BufferView *,LyXFont const &, int, float &, bool) const;
47         ///
48         void Read(Buffer const *, LyXLex & lex);
49         ///
50         void Write(Buffer const *, std::ostream & os) const;
51         ///
52         int Latex(Buffer const *, std::ostream & os, bool fragile,
53                   bool free_spc) const;
54         ///
55         int Linuxdoc(Buffer const *, std::ostream & os) const;
56         ///
57         int DocBook(Buffer const *, std::ostream &) const;
58         ///
59         Inset * Clone() const;
60
61         /// what appears in the minibuffer when opening
62         string const EditMessage() const;
63         ///
64         void Edit(BufferView *, int x, int y, unsigned int button);
65         ///
66         void InsetUnlock(BufferView *);
67         ///
68         RESULT LocalDispatch(BufferView *, int, string const &);
69
70 private:
71         ///
72         bool opened;
73         ///
74         string name;
75         ///
76         MathMacroTemplate * tmacro;
77 };
78
79 #endif