]> git.lyx.org Git - lyx.git/blob - src/insets/insetcommand.h
dont use pragma impementation and interface anymore
[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
17 #include "insetbutton.h"
18 #include "insetcommandparams.h"
19 #include <boost/signals/signal0.hpp>
20 #include <boost/utility.hpp>
21
22 // Created by Alejandro 970222
23 /** Used to insert a LaTeX command automatically
24  *
25  * Similar to InsetLaTeX but having control of the basic structure of a
26  *   LaTeX command: \name[options]{contents}.
27  */
28
29 ///
30 class InsetCommand : public InsetButton, boost::noncopyable {
31 public:
32         ///
33         explicit
34         InsetCommand(InsetCommandParams const &, bool same_id = false);
35         ///
36         virtual ~InsetCommand() { hideDialog(); }
37         ///
38         void write(Buffer const *, std::ostream & os) const
39                 { p_.write(os); }
40         ///
41         virtual void read(Buffer const *, LyXLex & lex)
42                 { p_.read(lex); }
43         /// Can remove one InsetBibKey is modified
44         void scanCommand(string const & c) { p_.scanCommand(c); };
45         ///
46         virtual int latex(Buffer const *, std::ostream &,
47                           bool fragile, bool free_spc) const;
48         ///
49         int ascii(Buffer const *, std::ostream &, int linelen) const;
50         ///
51         virtual int linuxdoc(Buffer const *, std::ostream &) const;
52         ///
53         virtual int docbook(Buffer const *, std::ostream &, bool) const;
54         ///
55         Inset::Code lyxCode() const { return Inset::NO_CODE; }
56
57         ///
58         string const getCommand() const { return p_.getCommand(); }
59         ///
60         string const & getCmdName() const { return p_.getCmdName(); }
61         ///
62         string const & getOptions() const { return p_.getOptions(); }
63         ///
64         string const & getContents() const { return p_.getContents(); }
65         ///
66         void setCmdName(string const & n) { p_.setCmdName(n); }
67         ///
68         void setOptions(string const & o) { p_.setOptions(o); }
69         ///
70         void setContents(string const & c) { p_.setContents(c); }
71         ///
72         InsetCommandParams const & params() const { return p_; }
73         ///
74         void setParams(InsetCommandParams const &);
75         ///
76         boost::signal0<void> hideDialog;
77
78 private:
79         ///
80         InsetCommandParams p_;
81 };
82
83 #endif