2 /* This file is part of*
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2000 The LyX Team.
10 * ====================================================== */
12 #ifndef INSET_LATEXCOMMAND_H
13 #define INSET_LATEXCOMMAND_H
22 // Created by Alejandro 970222
23 /** Used to insert a LaTeX command automatically
25 * Similar to InsetLaTeX but having control of the basic structure of a
26 * LaTeX command: \name[options]{contents}.
28 class InsetCommand: public Inset {
34 InsetCommand(string const & name, string const & arg = string(),
35 string const & opt = string());
37 int ascent(Painter &, LyXFont const &) const;
39 int descent(Painter &, LyXFont const &) const;
41 int width(Painter &, LyXFont const &) const;
43 void draw(Painter &, LyXFont const &, int baseline, float & x) const;
45 void Write(std::ostream &) const;
46 /// Parse the command.
47 void scanCommand(string const & cmd);
48 /// Will not be used when lyxf3
49 void Read(LyXLex & lex);
51 virtual int Latex(std::ostream &,
52 bool fragile, bool free_spc) const;
54 int Ascii(std::ostream &) const;
56 virtual int Linuxdoc(std::ostream &) const;
58 virtual int DocBook(std::ostream &) const;
60 Inset * Clone() const;
62 Inset::Code LyxCode() const
64 return Inset::NO_CODE;
67 /** Get the label that appears at screen.
69 I thought it was enough to eliminate the argument to avoid
70 confusion with lyxinset::getLabel(int), but I've seen that
71 it wasn't. I hope you never confuse again both methods. (ale)
73 virtual string getScreenLabel() const
78 /// Build the complete LaTeX command
79 string getCommand() const;
81 string const & getCmdName() const {
85 string const & getOptions() const {
89 string const & getContents() const {
93 void setCmdName(string const & n) {
97 void setOptions(string const & o) {
101 virtual void setContents(string const & c) {