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
19 #include "insetbutton.h"
21 // Created by Alejandro 970222
22 /** Used to insert a LaTeX command automatically
24 * Similar to InsetLaTeX but having control of the basic structure of a
25 * LaTeX command: \name[options]{contents}.
27 class InsetCommand: public InsetButton {
33 InsetCommand(string const & name, string const & arg = string(),
34 string const & opt = string());
36 void Write(Buffer const *, std::ostream &) const;
38 /// Parse the command.
39 void scanCommand(string const & cmd);
40 /// Will not be used when lyxf3
41 void Read(Buffer const *, LyXLex & lex);
43 virtual int Latex(Buffer const *, std::ostream &,
44 bool fragile, bool free_spc) const;
46 int Ascii(Buffer const *, std::ostream &) const;
48 virtual int Linuxdoc(Buffer const *, std::ostream &) const;
50 virtual int DocBook(Buffer const *, std::ostream &) const;
52 Inset * Clone() const;
54 Inset::Code LyxCode() const
56 return Inset::NO_CODE;
59 /** Get the label that appears at screen.
61 I thought it was enough to eliminate the argument to avoid
62 confusion with lyxinset::getLabel(int), but I've seen that
63 it wasn't. I hope you never confuse again both methods. (ale)
65 virtual string getScreenLabel() const
70 /// Build the complete LaTeX command
71 string getCommand() const;
73 string const & getCmdName() const {
77 string const & getOptions() const {
81 string const & getContents() const {
85 void setCmdName(string const & n) {
89 void setOptions(string const & o) {
93 virtual void setContents(string const & c) {
97 void addContents(string const & c) {