]> git.lyx.org Git - lyx.git/blob - src/mathed/math_macro.h
remove public method;
[lyx.git] / src / mathed / math_macro.h
1 // -*- C++ -*-
2 /*
3  *  File:        math_macro.h
4  *  Purpose:     Declaration of macro class for mathed 
5  *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx> 
6  *  Created:     November 1996
7  *  Description: WYSIWYG math macros
8  *
9  *  Dependencies: Math
10  *
11  *  Copyright: 1996, 1997 Alejandro Aguilar Sierra
12  *
13  *   Version: 0.2, Math & Lyx project.
14  *
15  *   This code is under the GNU General Public Licence version 2 or later.
16  */
17 #ifndef MATH_MACRO_H
18 #define MATH_MACRO_H
19
20 #ifdef __GNUG__
21 #pragma interface
22 #endif
23
24 #include <vector>
25 #include <iosfwd>
26
27 #include "math_nestinset.h"
28 #include "math_macroarg.h"
29
30 class MathMacroTemplate;
31
32
33 /** This class contains the data for a macro
34     \author Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
35     \version November 1996
36  */
37 class MathMacro : public MathNestInset {
38 public:
39         /// A macro can be built from an existing template
40         explicit MathMacro(MathMacroTemplate const &);
41         ///
42         MathMacro(MathMacro const &);
43         ///
44         void draw(Painter &, int x, int y) const;
45         ///
46         void metrics(MathStyles st) const;
47         ///
48         MathInset * clone() const;
49         ///
50         void write(std::ostream &, bool fragile) const;
51         ///
52         void writeNormal(std::ostream &) const;
53         ///
54         void dump() const;
55
56         ///
57         bool idxUp(idx_type &, pos_type &) const;
58         ///
59         bool idxDown(idx_type &, pos_type &) const;
60         ///
61         bool idxLeft(idx_type &, pos_type &) const;
62         ///
63         bool idxRight(idx_type &, pos_type &) const;
64
65         ///
66         void validate(LaTeXFeatures &) const;
67         ///
68         bool isMacro() const { return true; }
69
70 private:
71         ///
72         void operator=(MathMacro const &);
73         ///
74         char const * name() const;
75
76         ///
77         MathMacroTemplate const * const tmplate_;
78         ///
79         mutable MathXArray expanded_;
80 };
81
82
83 #endif