]> git.lyx.org Git - lyx.git/blob - src/insets/insetcommand.h
Make it compile when USE_BOOST_FORMAT is unset
[lyx.git] / src / insets / insetcommand.h
1 // -*- C++ -*-
2 /**
3  * \file insetcommand.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  * \author Lars Gullik Bjønnes
9  *
10  * Full author contact details are available in file CREDITS
11  */
12
13 #ifndef INSET_LATEXCOMMAND_H
14 #define INSET_LATEXCOMMAND_H
15
16 #ifdef __GNUG__
17 #pragma interface
18 #endif
19
20 #include "insetbutton.h"
21 #include "insetcommandparams.h"
22 #include <boost/signals/signal0.hpp>
23 #include <boost/utility.hpp>
24
25 // Created by Alejandro 970222
26 /** Used to insert a LaTeX command automatically
27  *
28  * Similar to InsetLaTeX but having control of the basic structure of a
29  *   LaTeX command: \name[options]{contents}.
30  */
31
32 ///
33 class InsetCommand : public InsetButton, boost::noncopyable {
34 public:
35         ///
36         explicit
37         InsetCommand(InsetCommandParams const &, bool same_id = false);
38         ///
39         virtual ~InsetCommand() { hideDialog(); }
40         ///
41         void write(Buffer const *, std::ostream & os) const
42                 { p_.write(os); }
43         ///
44         virtual void read(Buffer const *, LyXLex & lex)
45                 { p_.read(lex); }
46         /// Can remove one InsetBibKey is modified
47         void scanCommand(string const & c) { p_.scanCommand(c); };
48         ///
49         virtual int latex(Buffer const *, std::ostream &,
50                           bool fragile, bool free_spc) const;
51         ///
52         int ascii(Buffer const *, std::ostream &, int linelen) const;
53         ///
54         virtual int linuxdoc(Buffer const *, std::ostream &) const;
55         ///
56         virtual int docbook(Buffer const *, std::ostream &, bool) const;
57         ///
58         Inset::Code lyxCode() const { return Inset::NO_CODE; }
59
60         ///
61         string const getCommand() const { return p_.getCommand(); }
62         ///
63         string const & getCmdName() const { return p_.getCmdName(); }
64         ///
65         string const & getOptions() const { return p_.getOptions(); }
66         ///
67         string const & getContents() const { return p_.getContents(); }
68         ///
69         void setCmdName(string const & n) { p_.setCmdName(n); }
70         ///
71         void setOptions(string const & o) { p_.setOptions(o); }
72         ///
73         void setContents(string const & c) { p_.setContents(c); }
74         ///
75         InsetCommandParams const & params() const { return p_; }
76         ///
77         void setParams(InsetCommandParams const &);
78         ///
79         boost::signal0<void> hideDialog;
80
81 private:
82         ///
83         InsetCommandParams p_;
84 };
85
86 #endif