3 * \file InsetArgument.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Martin Vermeer
9 * Full author contact details are available in file CREDITS.
12 #ifndef INSETARGUMENT_H
13 #define INSETARGUMENT_H
16 #include "InsetCollapsible.h"
23 * InsetArgument. Used to insert a short version of sectioning header etc.
24 * automatically, or other optional LaTeX arguments
26 class InsetArgument : public InsetCollapsible
30 InsetArgument(Buffer *, std::string const &);
33 InsetArgument const * asInsetArgument() const { return this; }
35 /// Outputting the parameter of a LaTeX command
36 void latexArgument(otexstream & os, OutputParams const & runparams_in,
37 docstring const & ldelim, docstring const & rdelim,
38 docstring const & presetarg) const;
40 std::string name() const { return name_; }
42 /// \name Public functions inherited from Inset class
45 bool hasSettings() const { return false; }
47 InsetCode lyxCode() const { return ARG_CODE; }
49 docstring layoutName() const { return from_ascii("Argument"); }
50 /// Update the label string of this inset
51 void updateBuffer(ParIterator const &, UpdateType);
53 void latex(otexstream &, OutputParams const &) const { }
55 int plaintext(odocstringstream &, OutputParams const &, size_t) const { return 0; }
57 int docbook(odocstream &, OutputParams const &) const { return 0; }
59 docstring xhtml(XHTMLStream &, OutputParams const &) const
60 { return docstring(); }
62 void write(std::ostream & os) const;
64 void read(Lexer & lex);
66 bool neverIndent() const { return true; }
68 std::string contextMenuName() const;
70 bool isPassThru() const { return pass_thru_; }
72 bool isTocCaption() const { return is_toc_caption_; }
74 bool resetFontEdit() const { return false; }
76 /// \name Public functions inherited from InsetCollapsible class
79 InsetLayout::InsetDecoration decoration() const;
81 FontInfo getFont() const;
83 FontInfo getLabelfont() const;
85 ColorCode labelColor() const;
87 void setButtonLabel();
90 void addToToc(DocIterator const & dit, bool output_active,
91 UpdateType utype, TocBackend & backend) const; //override
95 docstring toolTip(BufferView const & bv, int, int) const;
97 void fixParagraphLanguage(Language const *);
101 docstring labelstring_;
109 std::string decoration_;
110 /// Are we in a pass-thru context?
111 bool pass_thru_context_;
112 /// Is the argument itself have an explicitly pass-thru?
113 bool pass_thru_local_;
114 /// Effective pass-thru setting (inherited or local)
117 docstring pass_thru_chars_;
118 /// Does this argument provide content for the TOC?
119 bool is_toc_caption_;
120 /// The type of Toc this is the caption of, empty otherwise.
121 std::string caption_of_toc_;
124 /// \name Protected functions inherited from Inset class
127 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
129 void doDispatch(Cursor & cur, FuncRequest & cmd);
131 Inset * clone() const { return new InsetArgument(*this); }
132 /// Is the content of this inset part of the immediate (visible) text sequence?
133 bool isPartOfTextSequence() const { return false; }
140 #endif // INSETARGUMENT_H