2001-02-13 17:08:51 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
#ifndef MATHMACROTEMPLATE
|
|
|
|
#define MATHMACROTEMPLATE
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2001-03-01 14:07:43 +00:00
|
|
|
#include <boost/utility.hpp>
|
2001-03-05 10:18:36 +00:00
|
|
|
//#include <boost/smart_ptr.hpp>
|
2001-03-01 14:07:43 +00:00
|
|
|
|
2001-02-13 17:08:51 +00:00
|
|
|
#include "math_parinset.h"
|
|
|
|
#include "math_macroarg.h"
|
|
|
|
|
2001-02-26 12:53:35 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2001-02-13 17:08:51 +00:00
|
|
|
class MathMacro;
|
|
|
|
|
2001-02-16 09:25:43 +00:00
|
|
|
/** This class contains the macro definition
|
|
|
|
\author Alejandro Aguilar Sierra
|
|
|
|
*/
|
2001-03-15 16:04:46 +00:00
|
|
|
class MathMacroTemplate : public MathParInset, public boost::noncopyable {
|
2001-02-15 12:22:01 +00:00
|
|
|
public:
|
2001-03-05 10:18:36 +00:00
|
|
|
friend class MathMacro;
|
|
|
|
|
2001-02-15 12:22:01 +00:00
|
|
|
/// A template constructor needs all the data
|
|
|
|
explicit
|
2001-03-01 14:07:43 +00:00
|
|
|
MathMacroTemplate(string const &, int na);
|
2001-02-15 12:22:01 +00:00
|
|
|
///
|
|
|
|
void draw(Painter &, int, int);
|
|
|
|
///
|
|
|
|
void Metrics();
|
|
|
|
///
|
|
|
|
void WriteDef(std::ostream &, bool fragile);
|
|
|
|
/// useful for special insets
|
2001-03-01 14:07:43 +00:00
|
|
|
void setTCode(MathedTextCodes t);
|
2001-02-15 12:22:01 +00:00
|
|
|
///
|
|
|
|
MathedTextCodes getTCode() const;
|
|
|
|
/// Number of arguments
|
|
|
|
int getNoArgs() const;
|
|
|
|
///
|
|
|
|
void GetMacroXY(int, int &, int &) const;
|
|
|
|
///
|
|
|
|
MathParInset * getMacroPar(int) const;
|
|
|
|
///
|
2001-03-05 10:52:39 +00:00
|
|
|
void setMacroPar(int, MathedArray const &);
|
|
|
|
///
|
2001-02-15 12:22:01 +00:00
|
|
|
void SetMacroFocus(int &, int, int);
|
|
|
|
///
|
|
|
|
void setEditMode(bool);
|
2001-02-13 17:08:51 +00:00
|
|
|
private:
|
2001-03-01 14:07:43 +00:00
|
|
|
/// Are we in edit mode or not?
|
|
|
|
bool edit_;
|
2001-02-15 12:22:01 +00:00
|
|
|
///
|
|
|
|
MathedTextCodes tcode_;
|
|
|
|
///
|
2001-03-05 10:18:36 +00:00
|
|
|
//std::vector<boost::shared_ptr<MathMacroArgument> > args_;
|
2001-02-15 12:22:01 +00:00
|
|
|
std::vector<MathMacroArgument> args_;
|
|
|
|
///
|
|
|
|
int nargs_;
|
2001-02-13 17:08:51 +00:00
|
|
|
};
|
|
|
|
#endif
|