*
* LyX, The Document Processor
*
- * Copyright (C) 1995 Matthias Ettrich
- * Copyright (C) 1996-1999 The LyX Team.
+ * Copyright 1995 Matthias Ettrich
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
#pragma interface
#endif
-#include "lyxinset.h"
-#include "LString.h"
+#include "insetbutton.h"
// Created by Alejandro 970222
/** Used to insert a LaTeX command automatically
* Similar to InsetLaTeX but having control of the basic structure of a
* LaTeX command: \name[options]{contents}.
*/
-class InsetCommand: public Inset {
+class InsetCommand: public InsetButton {
public:
///
InsetCommand();
///
+ explicit
InsetCommand(string const & name, string const & arg = string(),
string const & opt = string());
///
- int Ascent(LyXFont const & font) const;
- ///
- int Descent(LyXFont const & font) const;
- ///
- int Width(LyXFont const & font) const;
- ///
- void Draw(LyXFont, LyXScreen & scr, int baseline, float & x);
- ///
- void Write(ostream &);
+ void Write(Buffer const *, std::ostream &) const;
+
/// Parse the command.
void scanCommand(string const & cmd);
/// Will not be used when lyxf3
- void Read(LyXLex & lex);
+ void Read(Buffer const *, LyXLex & lex);
///
- virtual int Latex(ostream &, signed char fragile);
+ virtual int Latex(Buffer const *, std::ostream &,
+ bool fragile, bool free_spc) const;
///
- virtual int Latex(string & file, signed char fragile);
+ int Ascii(Buffer const *, std::ostream &) const;
///
- virtual int Linuxdoc(string & file);
+ virtual int Linuxdoc(Buffer const *, std::ostream &) const;
///
- virtual int DocBook(string & file);
+ virtual int DocBook(Buffer const *, std::ostream &) const;
///
Inset * Clone() const;
///
{
return getCommand();
}
-
+
/// Build the complete LaTeX command
string getCommand() const;
///
string const & getCmdName() const {
- return command;
+ return cmdname;
}
///
string const & getOptions() const {
}
///
void setCmdName(string const & n) {
- command = n;
+ cmdname = n;
}
///
void setOptions(string const & o) {
virtual void setContents(string const & c) {
contents = c;
}
-protected:
+ ///
+ void addContents(string const & c) {
+ contents += c;
+ }
+private:
///
- string command;
+ string cmdname;
///
string options;
///