]> git.lyx.org Git - lyx.git/blob - src/insets/InsetArgument.h
Allow for some argument visual customization
[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         InsetLayout::InsetDecoration decoration() const;
70         ///
71         FontInfo getFont() const;
72         ///
73         FontInfo getLabelfont() const;
74         ///
75         void setButtonLabel();
76         //@}
77
78 private:
79         ///
80         docstring toolTip(BufferView const & bv, int, int) const;
81         ///
82         std::string name_;
83         ///
84         docstring labelstring_;
85         ///
86         docstring tooltip_;
87         ///
88         FontInfo font_;
89         ///
90         FontInfo labelfont_;
91         ///
92         std::string decoration_;
93
94 protected:
95         /// \name Protected functions inherited from Inset class
96         //@{
97         ///
98         bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
99         ///
100         void doDispatch(Cursor & cur, FuncRequest & cmd);
101         ///
102         Inset * clone() const { return new InsetArgument(*this); }
103         //@}
104 };
105
106
107 } // namespace lyx
108
109 #endif // INSETARGUMENT_H