]> git.lyx.org Git - lyx.git/blob - src/insets/insetoptarg.h
Copyright notices
[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 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "insettext.h"
20 #include "insetcollapsable.h"
21
22
23 /**
24  * InsetOptArg. Used to insert a short version of sectioning header etc.
25  * automatically, or other optional LaTeX arguments
26  */
27 class InsetOptArg : public InsetCollapsable {
28 public:
29         InsetOptArg(BufferParams const &);
30
31         InsetOptArg(InsetOptArg const &, bool same_id = false);
32
33         /// make a duplicate of this inset
34         Inset * clone(Buffer const &, bool same_id = false) const;
35
36         /// this inset is editable
37         EDITABLE editable() const { return IS_EDITABLE; }
38         /// code of the inset
39         Inset::Code lyxCode() const { return Inset::OPTARG_CODE; }
40         /// return an message upon editing
41         string const editMessage() const;
42
43         /// Standard LaTeX output -- short-circuited
44         int latex(Buffer const *, std::ostream &,
45                                         bool fragile, bool fp) const;
46         /// Outputting the optional parameter of a LaTeX command
47         int latexOptional(Buffer const *, std::ostream &,
48                                         bool fragile, bool fp) const;
49         /// Write out tothe .lyx file
50         void write(Buffer const * buf, std::ostream & os) const;
51 };
52
53 #endif // INSETOPTARG_H