]> git.lyx.org Git - lyx.git/blob - src/insets/insetoptarg.h
The speed patch: redraw only rows that have changed
[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 /**
20  * InsetOptArg. Used to insert a short version of sectioning header etc.
21  * automatically, or other optional LaTeX arguments
22  */
23 class InsetOptArg : public InsetCollapsable {
24 public:
25         InsetOptArg(BufferParams const &);
26
27         /// code of the inset
28         InsetBase::Code lyxCode() const { return InsetBase::OPTARG_CODE; }
29         /// return an message upon editing
30         std::string const editMessage() const;
31
32         /// Standard LaTeX output -- short-circuited
33         int latex(Buffer const &, std::ostream &,
34                   OutputParams const &) const;
35         /// Standard DocBook output -- short-circuited
36         int docbook(Buffer const &, std::ostream &,
37                   OutputParams const &) const;
38         /// Standard LinuxDoc output -- short-circuited
39         int linuxdoc(Buffer const &, std::ostream &,
40                   OutputParams const &) const;
41
42         /// Standard plain text output -- short-circuited
43         int plaintext(Buffer const &, std::ostream &,
44                   OutputParams const &) const;
45
46         /// Outputting the optional parameter of a LaTeX command
47         int latexOptional(Buffer const &, std::ostream &,
48                           OutputParams const &) const;
49         /// Write out tothe .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() const { return true; }
54 protected:
55         InsetOptArg(InsetOptArg const &);
56 private:
57         virtual std::auto_ptr<InsetBase> doClone() const;
58 };
59
60 #endif // INSETOPTARG_H