]> git.lyx.org Git - lyx.git/blob - src/mathed/formulamacro.h
cleanup indent
[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 <boost/smart_ptr.hpp>
21
22 #include "formula.h"
23
24 #ifdef __GNUG__
25 #pragma interface
26 #endif
27
28 class MathMacroTemplate;
29
30
31 ///
32 class InsetFormulaMacro: public InsetFormula {
33 public:
34         ///
35         InsetFormulaMacro();
36         ///
37         explicit
38         InsetFormulaMacro(string name, int na);
39         ///
40         ~InsetFormulaMacro();
41         ///
42         int ascent(BufferView *, LyXFont const &) const;
43         ///
44         int descent(BufferView *, LyXFont const &) const;
45         ///
46         int width(BufferView *, LyXFont const &) const;
47         ///
48         void draw(BufferView *,LyXFont const &, int, float &, bool) const;
49         ///
50         void Read(Buffer const *, LyXLex & lex);
51         ///
52         void Write(Buffer const *, std::ostream & os) const;
53         ///
54         int Latex(Buffer const *, std::ostream & os, bool fragile,
55                   bool free_spc) const;
56         ///
57         int Linuxdoc(Buffer const *, std::ostream & os) const;
58         ///
59         int DocBook(Buffer const *, std::ostream &) const;
60         ///
61         Inset * Clone(Buffer const &) const;
62         ///
63         Inset::Code LyxCode() const;
64         /// what appears in the minibuffer when opening
65         string const EditMessage() const;
66         ///
67         void Edit(BufferView *, int x, int y, unsigned int button);
68         ///
69         void InsetUnlock(BufferView *);
70         ///
71         RESULT LocalDispatch(BufferView *, kb_action, string const &);
72
73 private:
74         ///
75         bool opened_;
76         ///
77         string name_;
78         ///
79         boost::shared_ptr<MathMacroTemplate> tmacro_;
80 };
81
82
83 inline
84 Inset::Code InsetFormulaMacro::LyxCode() const
85 {
86         return Inset::MATHMACRO_CODE;
87 }
88 #endif