4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
8 * \author Lars Gullik Bjønnes
10 * Full author contact details are available in file CREDITS
13 #ifndef INSET_LATEXCOMMAND_H
14 #define INSET_LATEXCOMMAND_H
20 #include "insetbutton.h"
21 #include "insetcommandparams.h"
22 #include <boost/signals/signal0.hpp>
23 #include <boost/utility.hpp>
25 // Created by Alejandro 970222
26 /** Used to insert a LaTeX command automatically
28 * Similar to InsetLaTeX but having control of the basic structure of a
29 * LaTeX command: \name[options]{contents}.
33 class InsetCommand : public InsetButton, boost::noncopyable {
37 InsetCommand(InsetCommandParams const &, bool same_id = false);
39 virtual ~InsetCommand() { hideDialog(); }
41 void write(Buffer const *, std::ostream & os) const
44 virtual void read(Buffer const *, LyXLex & lex)
46 /// Can remove one InsetBibKey is modified
47 void scanCommand(string const & c) { p_.scanCommand(c); };
49 virtual int latex(Buffer const *, std::ostream &,
50 bool fragile, bool free_spc) const;
52 int ascii(Buffer const *, std::ostream &, int linelen) const;
54 virtual int linuxdoc(Buffer const *, std::ostream &) const;
56 virtual int docbook(Buffer const *, std::ostream &, bool) const;
58 Inset::Code lyxCode() const { return Inset::NO_CODE; }
61 string const getCommand() const { return p_.getCommand(); }
63 string const & getCmdName() const { return p_.getCmdName(); }
65 string const & getOptions() const { return p_.getOptions(); }
67 string const & getContents() const { return p_.getContents(); }
69 void setCmdName(string const & n) { p_.setCmdName(n); }
71 void setOptions(string const & o) { p_.setOptions(o); }
73 void setContents(string const & c) { p_.setContents(c); }
75 InsetCommandParams const & params() const { return p_; }
77 void setParams(InsetCommandParams const &);
79 boost::signal0<void> hideDialog;
83 InsetCommandParams p_;