]> git.lyx.org Git - features.git/blobdiff - src/mathed/math_macro.h
make doc++ able to generate the source documentation for lyx
[features.git] / src / mathed / math_macro.h
index 587fe4778f2a87b3444ce337c83030ed570146a8..bd87b701af471c7b5a4284f474fa6e57dd39fc9c 100644 (file)
@@ -8,7 +8,7 @@
  *
  *  Dependencies: Mathed
  *
- *  Copyright: (c) 1996, 1997 Alejandro Aguilar Sierra
+ *  Copyright: 1996, 1997 Alejandro Aguilar Sierra
  *
  *   Version: 0.2, Mathed & Lyx project.
  *
@@ -37,69 +37,67 @@ class MathMacro : public MathParInset
 {
 public:
     /// A macro can only be builded from an existing template
+    explicit
     MathMacro(MathMacroTemplate *);
     /// or from another macro.
+    explicit
     MathMacro(MathMacro *);
-       ///
+    ///
     ~MathMacro();
     ///
     void draw(Painter &, int, int);
     ///
     void Metrics();
-       ///
+    ///
     MathedInset * Clone();
-       ///
-    void Write(ostream &);
-#ifndef USE_OSTREAM_ONLY
-       ///
-    void Write(string &);
-#endif
-       ///
+    ///
+    void Write(std::ostream &, bool fragile);
+    ///
     bool setArgumentIdx(int);
-       ///
+    ///
     int  getArgumentIdx();
-       ///
+    ///
     int  getMaxArgumentIdx();
-       ///
+    ///
     int GetColumns();
-       ///
+    ///
     void GetXY(int &, int &) const;
-       ///
+    ///
     void SetFocus(int, int);
-       ///
+    ///
     LyxArrayBase * GetData();
-       ///
+    ///
     MathedRowSt * getRowSt() const { return args[idx].row; }
-       ///
+    ///
     void SetData(LyxArrayBase *);
-       ///
+    ///
     MathedTextCodes getTCode() { return tcode; }
-       ///
+    ///
     bool Permit(short);
     
 private:
+    ///
+    MathMacroTemplate * tmplate;
+    ///
+    struct MacroArgumentBase {
+       /// Position of the macro
+       int x, y;
        ///
-       MathMacroTemplate * tmplate;
-       ///
-       struct MacroArgumentBase {
-               /// Position of the macro
-               int x, y;
-               ///
-               MathedRowSt * row;
-               ///
-               LyxArrayBase * array;
-               ///
-               MacroArgumentBase() { x = y = 0;  array = 0; row = 0; }
-       };
-       MacroArgumentBase * args;
-       ///
-       int idx;
-       ///
-       int nargs;
+       MathedRowSt * row;
        ///
-       MathedTextCodes tcode;
+       LyxArrayBase * array;
        ///
-       friend class MathMacroTemplate;
+       MacroArgumentBase() { x = y = 0;  array = 0; row = 0; }
+    };
+    MacroArgumentBase * args;
+    ///
+    int idx;
+    ///
+    int nargs;
+    ///
+    MathedTextCodes tcode;
+    ///
+    friend class MathMacroTemplate;
 };
 
 
@@ -107,34 +105,34 @@ private:
 class MathMacroArgument: public MathParInset {
 public:
     ///
-    MathMacroArgument() { expnd_mode = false; number = 1;  SetType(LM_OT_MACRO_ARG); }
+    MathMacroArgument() {
+           expnd_mode = false;
+           number = 1;
+           SetType(LM_OT_MACRO_ARG);
+    }
     ///
+    explicit
     MathMacroArgument(int);
     ///
-       ~MathMacroArgument() { lyxerr << "help, destroyme!" << endl; }
+    ~MathMacroArgument() { lyxerr << "help, destroyme!" << std::endl; }
     ///
     MathedInset * Clone() { return this; }
-       ///
+    ///
     void Metrics();
-       ///
+    ///
     void draw(Painter &, int x, int baseline);
-       ///
-    void Write(ostream &);
-#ifndef USE_OSTREAM_ONLY
-       ///
-    void Write(string &);
-#endif
+    ///
+    void Write(std::ostream &, bool fragile);
     ///
     void setNumber(int n) { number = n; }
     /// Is expanded or not
     void setExpand(bool e) { expnd_mode = e; }
     /// Is expanded or not
     bool getExpand() { return expnd_mode; }
-    
 private:
-       ///
+    ///
     bool expnd_mode;
-       ///
+    ///
     int number;
 };
 
@@ -143,19 +141,16 @@ private:
 class MathMacroTemplate: public MathParInset {
 public:
     /// A template constructor needs all the data
+    explicit
     MathMacroTemplate(char const *, int na = 0, int f = 0);
-       ///
+    ///
     ~MathMacroTemplate();
-       ///
+    ///
     void draw(Painter &, int, int);
-       ///
+    ///
     void Metrics();
-       ///
-    void WriteDef(ostream &);
-#ifndef USE_OSTREAM_ONLY
-       ///
-    void WriteDef(string &);
-#endif
+    ///
+    void WriteDef(std::ostream &, bool fragile);
     /// useful for special insets
     void  setTCode(MathedTextCodes t) { tcode = t; }
     ///
@@ -170,7 +165,7 @@ public:
     MathParInset * getMacroPar(int) const;
     ///
     void SetMacroFocus(int &, int, int);
-       ///
+    ///
     void setEditMode(bool);
 
     /// Replace the appropriate arguments with a specific macro's data
@@ -198,29 +193,30 @@ typedef MathMacroTemplate * MathMacroTemplateP;
 ///
 class MathMacroTable {
 public:
-       ///
+    ///
+    explicit
     MathMacroTable(int);
-       ///
+    ///
     ~MathMacroTable();
-       ///
+    ///
     void addTemplate(MathMacroTemplate *);
-       ///
+    ///
     MathMacro * getMacro(char const *) const;
-       ///
+    ///
     MathMacroTemplate * getTemplate(char const *) const;
-       ///
+    ///
     void builtinMacros();
-       ///
+    ///
     static MathMacroTable mathMTable;
-       ///
+    ///
     static bool built;
     
 private:
-       ///
+    ///
     const int max_macros;
-       ///
+    ///
     int num_macros;
-       ///
+    ///
     MathMacroTemplateP * macro_table;
 };