]> git.lyx.org Git - lyx.git/blob - src/insets/InsetArgument.h
Introduce a wrapper class for odocstream to help ensuring that no
[lyx.git] / src / insets / InsetArgument.h
1 // -*- C++ -*-
2 /**
3  * \file InsetArgument.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Martin Vermeer
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef INSETOPTARG_H
13 #define INSETOPTARG_H
14
15
16 #include "InsetCollapsable.h"
17
18
19 namespace lyx {
20
21
22 /**
23  * InsetArgument. Used to insert a short version of sectioning header etc.
24  * automatically, or other optional LaTeX arguments
25  */
26 class InsetArgument : public InsetCollapsable
27 {
28 public:
29         ///
30         InsetArgument(Buffer *);
31
32         /// Outputting the parameter of a LaTeX command
33         int latexArgument(otexstream &, OutputParams const &,
34                         bool optional) const;
35         ///
36         bool hasSettings() const { return false; }
37
38 private:
39         /// code of the inset
40         InsetCode lyxCode() const { return ARG_CODE; }
41         ///
42         docstring name() const { return from_ascii("Argument"); }
43         /// Standard LaTeX output -- short-circuited
44         int latex(otexstream &, OutputParams const &) const;
45         /// Standard plain text output -- short-circuited
46         int plaintext(odocstream &, OutputParams const &) const;
47         /// Standard DocBook output -- short-circuited
48         int docbook(odocstream &, OutputParams const &) const;
49         /// Standard XHTML output -- short-circuited
50         docstring xhtml(XHTMLStream &, OutputParams const &) const;
51         /// Write out to the .lyx file
52         void write(std::ostream & os) const;
53         /// should paragraph indendation be ommitted in any case?
54         bool neverIndent() const { return true; }
55         ///
56         Inset * clone() const { return new InsetArgument(*this); }
57 };
58
59
60 } // namespace lyx
61
62 #endif // INSETOPTARG_H