]> git.lyx.org Git - features.git/blob - src/insets/InsetArgument.h
Merge remote-tracking branch 'origin/master' into features/latexargs
[features.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 INSETARGUMENT_H
13 #define INSETARGUMENT_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 *, std::string const &);
31
32         /// Outputting the parameter of a LaTeX command
33         void latexArgument(otexstream &, OutputParams const &,
34                         docstring const&, docstring const &) const;
35
36         std::string name() const { return name_; }
37
38         /// \name Public functions inherited from Inset class
39         //@{
40         ///
41         bool hasSettings() const { return false; }
42         ///
43         InsetCode lyxCode() const { return ARG_CODE; }
44         ///
45         docstring layoutName() const { return from_ascii("Argument"); }
46         /// Update the label string of this inset
47         void updateBuffer(ParIterator const &, UpdateType);
48         ///
49         void latex(otexstream &, OutputParams const &) const { }
50         ///
51         int plaintext(odocstream &, OutputParams const &) const { return 0; }
52         ///
53         int docbook(odocstream &, OutputParams const &) const { return 0; }
54         ///
55         docstring xhtml(XHTMLStream &, OutputParams const &) const 
56                 { return docstring(); }
57         ///
58         void write(std::ostream & os) const;
59         ///
60         void read(Lexer & lex);
61         ///
62         bool neverIndent() const { return true; }
63         //@}
64         /// \name Public functions inherited from InsetCollapsable class
65         //@{
66         ///
67         void setButtonLabel();
68         //@}
69
70 private:
71         ///
72         docstring toolTip(BufferView const & bv, int, int) const;
73         ///
74         std::string name_;
75         ///
76         docstring labelstring_;
77         ///
78         docstring tooltip_;
79
80 protected:
81         /// \name Protected functions inherited from Inset class
82         //@{
83         ///
84         Inset * clone() const { return new InsetArgument(*this); }
85         //@}
86 };
87
88
89 } // namespace lyx
90
91 #endif // INSETARGUMENT_H