]> git.lyx.org Git - lyx.git/blob - src/insets/insetoptarg.h
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / insetoptarg.h
1 // -*- C++ -*-
2 /**
3  * \file insetoptarg.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  * InsetOptArg. Used to insert a short version of sectioning header etc.
24  * automatically, or other optional LaTeX arguments
25  */
26 class InsetOptArg : public InsetCollapsable {
27 public:
28         InsetOptArg(BufferParams const &);
29
30         /// code of the inset
31         InsetBase::Code lyxCode() const { return InsetBase::OPTARG_CODE; }
32         /// return an message upon editing
33         virtual docstring const editMessage() const;
34
35         /// Standard LaTeX output -- short-circuited
36         int latex(Buffer const &, odocstream &,
37                   OutputParams const &) const;
38         /// Standard DocBook output -- short-circuited
39         int docbook(Buffer const &, odocstream &,
40                   OutputParams const &) const;
41
42         /// Standard plain text output -- short-circuited
43         int plaintext(Buffer const &, odocstream &,
44                   OutputParams const &) const;
45
46         /// Outputting the optional parameter of a LaTeX command
47         int latexOptional(Buffer const &, odocstream &,
48                           OutputParams const &) const;
49         /// Write out to the .lyx file
50         void write(Buffer const & buf, std::ostream & os) const;
51
52         /// should paragraph indendation be ommitted in any case?
53         virtual bool neverIndent(Buffer const &) const { return true; }
54 protected:
55         InsetOptArg(InsetOptArg const &);
56 private:
57         virtual std::auto_ptr<InsetBase> doClone() const;
58 };
59
60
61 } // namespace lyx
62
63 #endif // INSETOPTARG_H