2002-08-23 09:05:32 +00:00
|
|
|
// -*- C++ -*-
|
2002-08-24 20:25:17 +00:00
|
|
|
/**
|
2010-06-04 22:44:58 +00:00
|
|
|
* \file InsetArgument.h
|
2002-09-25 14:26:13 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-08-23 09:05:32 +00:00
|
|
|
*
|
2002-12-01 22:59:25 +00:00
|
|
|
* \author Martin Vermeer
|
2002-09-25 14:26:13 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-08-24 20:25:17 +00:00
|
|
|
*/
|
2002-08-23 09:05:32 +00:00
|
|
|
|
2012-11-19 13:21:02 +00:00
|
|
|
#ifndef INSETARGUMENT_H
|
|
|
|
#define INSETARGUMENT_H
|
2002-08-23 09:05:32 +00:00
|
|
|
|
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
#include "InsetCollapsable.h"
|
2002-08-23 09:05:32 +00:00
|
|
|
|
2002-08-26 11:27:37 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
|
|
|
|
2002-08-24 20:25:17 +00:00
|
|
|
/**
|
2010-06-04 22:44:58 +00:00
|
|
|
* InsetArgument. Used to insert a short version of sectioning header etc.
|
2002-08-24 20:25:17 +00:00
|
|
|
* automatically, or other optional LaTeX arguments
|
|
|
|
*/
|
2010-06-04 22:44:58 +00:00
|
|
|
class InsetArgument : public InsetCollapsable
|
2008-03-05 00:21:05 +00:00
|
|
|
{
|
2002-08-23 09:05:32 +00:00
|
|
|
public:
|
2008-03-05 00:21:05 +00:00
|
|
|
///
|
2012-11-19 13:21:02 +00:00
|
|
|
InsetArgument(Buffer *, std::string const &);
|
2002-08-24 20:25:17 +00:00
|
|
|
|
2010-06-04 21:50:08 +00:00
|
|
|
/// Outputting the parameter of a LaTeX command
|
2016-09-23 23:12:38 +00:00
|
|
|
void latexArgument(otexstream & os, OutputParams const & runparams_in,
|
|
|
|
docstring const & ldelim, docstring const & rdelim,
|
|
|
|
docstring const & presetarg) const;
|
2012-11-19 13:21:02 +00:00
|
|
|
|
|
|
|
std::string name() const { return name_; }
|
2011-10-29 15:34:06 +00:00
|
|
|
|
|
|
|
/// \name Public functions inherited from Inset class
|
|
|
|
//@{
|
2009-04-22 20:55:13 +00:00
|
|
|
///
|
|
|
|
bool hasSettings() const { return false; }
|
2011-10-29 15:34:06 +00:00
|
|
|
///
|
2010-06-04 22:44:58 +00:00
|
|
|
InsetCode lyxCode() const { return ARG_CODE; }
|
2007-11-15 15:40:01 +00:00
|
|
|
///
|
2011-03-28 22:33:04 +00:00
|
|
|
docstring layoutName() const { return from_ascii("Argument"); }
|
2012-11-19 13:21:02 +00:00
|
|
|
/// Update the label string of this inset
|
|
|
|
void updateBuffer(ParIterator const &, UpdateType);
|
2011-10-29 15:34:06 +00:00
|
|
|
///
|
|
|
|
void latex(otexstream &, OutputParams const &) const { }
|
|
|
|
///
|
2013-04-08 09:09:45 +00:00
|
|
|
int plaintext(odocstringstream &, OutputParams const &, size_t) const { return 0; }
|
2011-10-29 15:34:06 +00:00
|
|
|
///
|
|
|
|
int docbook(odocstream &, OutputParams const &) const { return 0; }
|
|
|
|
///
|
|
|
|
docstring xhtml(XHTMLStream &, OutputParams const &) const
|
2012-11-19 13:21:02 +00:00
|
|
|
{ return docstring(); }
|
2011-10-29 15:34:06 +00:00
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
void write(std::ostream & os) const;
|
2011-10-29 15:34:06 +00:00
|
|
|
///
|
2012-11-19 13:21:02 +00:00
|
|
|
void read(Lexer & lex);
|
|
|
|
///
|
2008-02-27 20:43:16 +00:00
|
|
|
bool neverIndent() const { return true; }
|
2012-11-23 13:44:45 +00:00
|
|
|
///
|
|
|
|
std::string contextMenuName() const;
|
2012-11-28 18:02:07 +00:00
|
|
|
///
|
|
|
|
bool isPassThru() const { return pass_thru_; }
|
2013-05-27 09:29:15 +00:00
|
|
|
///
|
|
|
|
bool resetFontEdit() const { return false; }
|
2011-10-29 15:34:06 +00:00
|
|
|
//@}
|
2012-11-19 13:21:02 +00:00
|
|
|
/// \name Public functions inherited from InsetCollapsable class
|
|
|
|
//@{
|
|
|
|
///
|
2012-11-26 08:10:14 +00:00
|
|
|
InsetLayout::InsetDecoration decoration() const;
|
|
|
|
///
|
|
|
|
FontInfo getFont() const;
|
|
|
|
///
|
|
|
|
FontInfo getLabelfont() const;
|
|
|
|
///
|
2016-07-30 03:36:48 +00:00
|
|
|
ColorCode labelColor() const;
|
|
|
|
///
|
2012-11-19 13:21:02 +00:00
|
|
|
void setButtonLabel();
|
|
|
|
//@}
|
|
|
|
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
docstring toolTip(BufferView const & bv, int, int) const;
|
|
|
|
///
|
|
|
|
std::string name_;
|
|
|
|
///
|
|
|
|
docstring labelstring_;
|
|
|
|
///
|
|
|
|
docstring tooltip_;
|
2012-11-26 08:10:14 +00:00
|
|
|
///
|
|
|
|
FontInfo font_;
|
|
|
|
///
|
|
|
|
FontInfo labelfont_;
|
|
|
|
///
|
|
|
|
std::string decoration_;
|
2012-11-28 18:02:07 +00:00
|
|
|
///
|
|
|
|
bool pass_thru_;
|
2015-05-08 07:32:31 +00:00
|
|
|
///
|
|
|
|
docstring pass_thru_chars_;
|
2011-10-29 15:34:06 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
/// \name Protected functions inherited from Inset class
|
|
|
|
//@{
|
2008-03-05 00:21:05 +00:00
|
|
|
///
|
2012-11-23 13:44:45 +00:00
|
|
|
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
|
|
|
|
///
|
|
|
|
void doDispatch(Cursor & cur, FuncRequest & cmd);
|
|
|
|
///
|
2010-06-04 22:44:58 +00:00
|
|
|
Inset * clone() const { return new InsetArgument(*this); }
|
2011-10-29 15:34:06 +00:00
|
|
|
//@}
|
2002-08-23 09:05:32 +00:00
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2012-11-19 13:21:02 +00:00
|
|
|
#endif // INSETARGUMENT_H
|