]> git.lyx.org Git - lyx.git/blob - src/insets/InsetArgument.h
274623ab3edb2460ff310f099e6c2bcd4c2a5945
[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 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         std::string contextMenuName() const;
65         //@}
66         /// \name Public functions inherited from InsetCollapsable class
67         //@{
68         ///
69         void setButtonLabel();
70         //@}
71
72 private:
73         ///
74         docstring toolTip(BufferView const & bv, int, int) const;
75         ///
76         std::string name_;
77         ///
78         docstring labelstring_;
79         ///
80         docstring tooltip_;
81
82 protected:
83         /// \name Protected functions inherited from Inset class
84         //@{
85         ///
86         bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
87         ///
88         void doDispatch(Cursor & cur, FuncRequest & cmd);
89         ///
90         Inset * clone() const { return new InsetArgument(*this); }
91         //@}
92 };
93
94
95 } // namespace lyx
96
97 #endif // INSETARGUMENT_H