]> git.lyx.org Git - lyx.git/blob - src/insets/InsetArgument.h
186c6119e3d884c64790a53616ddfcf43f795cd0
[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 &,
35                            docstring const &) const;
36
37         std::string name() const { return name_; }
38
39         /// \name Public functions inherited from Inset class
40         //@{
41         ///
42         bool hasSettings() const { return false; }
43         ///
44         InsetCode lyxCode() const { return ARG_CODE; }
45         ///
46         docstring layoutName() const { return from_ascii("Argument"); }
47         /// Update the label string of this inset
48         void updateBuffer(ParIterator const &, UpdateType);
49         ///
50         void latex(otexstream &, OutputParams const &) const { }
51         ///
52         int plaintext(odocstringstream &, OutputParams const &, size_t) const { return 0; }
53         ///
54         int docbook(odocstream &, OutputParams const &) const { return 0; }
55         ///
56         docstring xhtml(XHTMLStream &, OutputParams const &) const 
57                 { return docstring(); }
58         ///
59         void write(std::ostream & os) const;
60         ///
61         void read(Lexer & lex);
62         ///
63         bool neverIndent() const { return true; }
64         ///
65         std::string contextMenuName() const;
66         ///
67         bool isPassThru() const { return pass_thru_; }
68         ///
69         bool resetFontEdit() const { return false; }
70         //@}
71         /// \name Public functions inherited from InsetCollapsable class
72         //@{
73         ///
74         InsetLayout::InsetDecoration decoration() const;
75         ///
76         FontInfo getFont() const;
77         ///
78         FontInfo getLabelfont() const;
79         ///
80         void setButtonLabel();
81         //@}
82
83 private:
84         ///
85         docstring toolTip(BufferView const & bv, int, int) const;
86         ///
87         std::string name_;
88         ///
89         docstring labelstring_;
90         ///
91         docstring tooltip_;
92         ///
93         FontInfo font_;
94         ///
95         FontInfo labelfont_;
96         ///
97         std::string decoration_;
98         ///
99         bool pass_thru_;
100
101 protected:
102         /// \name Protected functions inherited from Inset class
103         //@{
104         ///
105         bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
106         ///
107         void doDispatch(Cursor & cur, FuncRequest & cmd);
108         ///
109         Inset * clone() const { return new InsetArgument(*this); }
110         //@}
111 };
112
113
114 } // namespace lyx
115
116 #endif // INSETARGUMENT_H