]> git.lyx.org Git - lyx.git/blob - src/mathed/MathMacroArgument.h
Revert "Give a 2 pixels space for markers around math objects"
[lyx.git] / src / mathed / MathMacroArgument.h
1 // -*- C++ -*-
2 /**
3  * \file MathMacroArgument.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Alejandro Aguilar Sierra
8  * \author André Pönitz
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef MATHMACROARGUMENT_H
14 #define MATHMACROARGUMENT_H
15
16 #include "InsetMath.h"
17
18 #include "support/docstring.h"
19
20
21 namespace lyx {
22
23
24 // A # that failed to parse
25 class InsetMathHash : public InsetMath {
26 public:
27         InsetMathHash(docstring const & str = docstring()) : str_('#' + str) {};
28         ///
29         void metrics(MetricsInfo & mi, Dimension & dim) const;
30         ///
31         void draw(PainterInfo &, int x, int y) const;
32         ///
33         void normalize(NormalStream &) const;
34         ///
35         void write(WriteStream & os) const;
36
37 private:
38         Inset * clone() const;
39
40 protected:
41         ///
42         docstring str_;
43 };
44
45
46 /// A macro argument.
47 class MathMacroArgument : public InsetMathHash {
48 public:
49         /// Assumes 0 < number <= 9
50         explicit MathMacroArgument(int number);
51         ///
52         int number() const { return number_; }
53         /// Assumes 0 < n <= 9
54         void setNumber(int n);
55         ///
56         InsetCode lyxCode() const { return MATH_MACROARG_CODE; }
57
58         ///
59         void normalize(NormalStream &) const;
60
61 private:
62         Inset * clone() const;
63         /// A number between 1 and 9
64         int number_;
65 };
66
67
68 } // namespace lyx
69
70 #endif