2002-08-23 09:05:32 +00:00
|
|
|
// -*- C++ -*-
|
2002-08-24 20:25:17 +00:00
|
|
|
/**
|
2007-04-25 01:24:38 +00:00
|
|
|
* \file InsetOptArg.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
|
|
|
|
|
|
|
#ifndef INSETOPTARG_H
|
|
|
|
#define INSETOPTARG_H
|
|
|
|
|
|
|
|
|
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
|
|
|
/**
|
|
|
|
* InsetOptArg. Used to insert a short version of sectioning header etc.
|
|
|
|
* automatically, or other optional LaTeX arguments
|
|
|
|
*/
|
2008-03-05 00:21:05 +00:00
|
|
|
class InsetOptArg : public InsetCollapsable
|
|
|
|
{
|
2002-08-23 09:05:32 +00:00
|
|
|
public:
|
2008-03-05 00:21:05 +00:00
|
|
|
///
|
2008-03-04 22:28:18 +00:00
|
|
|
InsetOptArg(Buffer const &);
|
2002-08-24 20:25:17 +00:00
|
|
|
|
2008-03-05 00:21:05 +00:00
|
|
|
/// Outputting the optional parameter of a LaTeX command
|
|
|
|
int latexOptional(odocstream &, OutputParams const &) const;
|
2009-04-22 20:55:13 +00:00
|
|
|
///
|
|
|
|
bool hasSettings() const { return false; }
|
2008-03-05 00:21:05 +00:00
|
|
|
|
|
|
|
private:
|
2002-08-24 20:25:17 +00:00
|
|
|
/// code of the inset
|
2007-10-13 09:04:52 +00:00
|
|
|
InsetCode lyxCode() const { return OPTARG_CODE; }
|
2007-11-15 15:40:01 +00:00
|
|
|
///
|
|
|
|
docstring name() const { return from_ascii("OptArg"); }
|
2002-08-24 20:25:17 +00:00
|
|
|
/// return an message upon editing
|
2008-02-27 20:43:16 +00:00
|
|
|
docstring editMessage() const;
|
2002-08-23 09:05:32 +00:00
|
|
|
/// Standard LaTeX output -- short-circuited
|
2008-02-27 20:43:16 +00:00
|
|
|
int latex(odocstream &, OutputParams const &) const;
|
2005-05-11 09:47:54 +00:00
|
|
|
/// Standard plain text output -- short-circuited
|
2008-02-27 20:43:16 +00:00
|
|
|
int plaintext(odocstream &, OutputParams const &) const;
|
2007-02-15 23:44:33 +00:00
|
|
|
/// Standard DocBook output -- short-circuited
|
2008-02-27 20:43:16 +00:00
|
|
|
int docbook(odocstream &, OutputParams const &) const;
|
2009-06-06 04:20:57 +00:00
|
|
|
/// Standard XHTML output -- short-circuited
|
2009-06-12 16:11:33 +00:00
|
|
|
void xhtml(odocstream &, OutputParams const &) const { return; }
|
2006-12-28 12:05:40 +00:00
|
|
|
/// Write out to the .lyx file
|
2008-02-27 20:43:16 +00:00
|
|
|
void write(std::ostream & os) const;
|
2005-09-10 06:51:58 +00:00
|
|
|
/// should paragraph indendation be ommitted in any case?
|
2008-02-27 20:43:16 +00:00
|
|
|
bool neverIndent() const { return true; }
|
2008-03-05 00:21:05 +00:00
|
|
|
///
|
|
|
|
Inset * clone() const { return new InsetOptArg(*this); }
|
2002-08-23 09:05:32 +00:00
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
2002-08-24 20:25:17 +00:00
|
|
|
#endif // INSETOPTARG_H
|