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 "InsetCollapsable.h"
23 * InsetArgument. Used to insert a short version of sectioning header etc.
24 * automatically, or other optional LaTeX arguments
26 class InsetArgument : public InsetCollapsable
30 InsetArgument(Buffer *, std::string const &);
32 /// Outputting the parameter of a LaTeX command
33 void latexArgument(otexstream & os, OutputParams const & runparams_in,
34 docstring const & ldelim, docstring const & rdelim,
35 docstring const & presetarg) const;
37 std::string name() const { return name_; }
39 /// \name Public functions inherited from Inset class
42 bool hasSettings() const { return false; }
44 InsetCode lyxCode() const { return ARG_CODE; }
46 docstring layoutName() const { return from_ascii("Argument"); }
47 /// Update the label string of this inset
48 void updateBuffer(ParIterator const &, UpdateType);
50 void latex(otexstream &, OutputParams const &) const { }
52 int plaintext(odocstringstream &, OutputParams const &, size_t) const { return 0; }
54 int docbook(odocstream &, OutputParams const &) const { return 0; }
56 docstring xhtml(XHTMLStream &, OutputParams const &) const
57 { return docstring(); }
59 void write(std::ostream & os) const;
61 void read(Lexer & lex);
63 bool neverIndent() const { return true; }
65 std::string contextMenuName() const;
67 bool isPassThru() const { return pass_thru_; }
69 bool resetFontEdit() const { return false; }
71 /// \name Public functions inherited from InsetCollapsable class
74 InsetLayout::InsetDecoration decoration() const;
76 FontInfo getFont() const;
78 FontInfo getLabelfont() const;
80 ColorCode labelColor() const;
82 void setButtonLabel();
85 void addToToc(DocIterator const & dit, bool output_active,
86 UpdateType utype, TocBackend & backend) const; //override
90 docstring toolTip(BufferView const & bv, int, int) const;
94 docstring labelstring_;
102 std::string decoration_;
103 /// Are we in a pass-thru context?
104 bool pass_thru_context_;
105 /// Is the argument itself have an explicitly pass-thru?
106 bool pass_thru_local_;
107 /// Effective pass-thru setting (inherited or local)
110 docstring pass_thru_chars_;
111 /// The type of Toc this is the caption of, empty otherwise.
112 std::string caption_of_toc_;
115 /// \name Protected functions inherited from Inset class
118 bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
120 void doDispatch(Cursor & cur, FuncRequest & cmd);
122 Inset * clone() const { return new InsetArgument(*this); }
123 /// Is the content of this inset part of the immediate (visible) text sequence?
124 bool isPartOfTextSequence() const { return false; }
131 #endif // INSETARGUMENT_H