X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetArgument.h;h=2bd0578f28cee35284fa14e77bb6b7c54669f856;hb=71b8019d56142397994e0ef2d4244ada51f199d5;hp=f45c0ea0ad06200b8450a9be0a955ec744fa6e83;hpb=d866717ef7503a1373dd1cb3925e1ac97b079192;p=lyx.git diff --git a/src/insets/InsetArgument.h b/src/insets/InsetArgument.h index f45c0ea0ad..2bd0578f28 100644 --- a/src/insets/InsetArgument.h +++ b/src/insets/InsetArgument.h @@ -9,11 +9,11 @@ * Full author contact details are available in file CREDITS. */ -#ifndef INSETOPTARG_H -#define INSETOPTARG_H +#ifndef INSETARGUMENT_H +#define INSETARGUMENT_H -#include "InsetCollapsable.h" +#include "InsetCollapsible.h" namespace lyx { @@ -23,40 +23,118 @@ namespace lyx { * InsetArgument. Used to insert a short version of sectioning header etc. * automatically, or other optional LaTeX arguments */ -class InsetArgument : public InsetCollapsable +class InsetArgument : public InsetCollapsible { public: /// - InsetArgument(Buffer *); + InsetArgument(Buffer *, std::string const &); + + /// + InsetArgument const * asInsetArgument() const { return this; } /// Outputting the parameter of a LaTeX command - void latexArgument(otexstream &, OutputParams const &, - bool optional) const; + void latexArgument(otexstream & os, OutputParams const & runparams_in, + docstring const & ldelim, docstring const & rdelim, + docstring const & presetarg) const; + + std::string name() const { return name_; } + + /// \name Public functions inherited from Inset class + //@{ /// bool hasSettings() const { return false; } - -private: - /// code of the inset + /// InsetCode lyxCode() const { return ARG_CODE; } /// - docstring name() const { return from_ascii("Argument"); } - /// Standard LaTeX output -- short-circuited - void latex(otexstream &, OutputParams const &) const; - /// Standard plain text output -- short-circuited - int plaintext(odocstream &, OutputParams const &) const; - /// Standard DocBook output -- short-circuited - int docbook(odocstream &, OutputParams const &) const; - /// Standard XHTML output -- short-circuited - docstring xhtml(XHTMLStream &, OutputParams const &) const; - /// Write out to the .lyx file + docstring layoutName() const { return from_ascii("Argument"); } + /// Update the label string of this inset + void updateBuffer(ParIterator const &, UpdateType); + /// + void latex(otexstream &, OutputParams const &) const { } + /// + int plaintext(odocstringstream &, OutputParams const &, size_t) const { return 0; } + /// + int docbook(odocstream &, OutputParams const &) const { return 0; } + /// + docstring xhtml(XHTMLStream &, OutputParams const &) const + { return docstring(); } + /// void write(std::ostream & os) const; - /// should paragraph indendation be ommitted in any case? + /// + void read(Lexer & lex); + /// bool neverIndent() const { return true; } /// + std::string contextMenuName() const; + /// + bool isPassThru() const { return pass_thru_; } + /// + bool isTocCaption() const { return is_toc_caption_; } + /// + bool resetFontEdit() const { return false; } + //@} + /// \name Public functions inherited from InsetCollapsible class + //@{ + /// + InsetLayout::InsetDecoration decoration() const; + /// + FontInfo getFont() const; + /// + FontInfo getLabelfont() const; + /// + ColorCode labelColor() const; + /// + void setButtonLabel(); + //@} + /// + void addToToc(DocIterator const & dit, bool output_active, + UpdateType utype, TocBackend & backend) const; //override + +private: + /// + docstring toolTip(BufferView const & bv, int, int) const; + /// + void fixParagraphLanguage(Language const *); + /// + std::string name_; + /// + docstring labelstring_; + /// + docstring tooltip_; + /// + FontInfo font_; + /// + FontInfo labelfont_; + /// + std::string decoration_; + /// Are we in a pass-thru context? + bool pass_thru_context_; + /// Is the argument itself have an explicitly pass-thru? + bool pass_thru_local_; + /// Effective pass-thru setting (inherited or local) + bool pass_thru_; + /// + docstring pass_thru_chars_; + /// Does this argument provide content for the TOC? + bool is_toc_caption_; + /// The type of Toc this is the caption of, empty otherwise. + std::string caption_of_toc_; + +protected: + /// \name Protected functions inherited from Inset class + //@{ + /// + bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; + /// + void doDispatch(Cursor & cur, FuncRequest & cmd); + /// Inset * clone() const { return new InsetArgument(*this); } + /// Is the content of this inset part of the immediate (visible) text sequence? + bool isPartOfTextSequence() const { return false; } + //@} }; } // namespace lyx -#endif // INSETOPTARG_H +#endif // INSETARGUMENT_H