2002-08-23 09:05:32 +00:00
|
|
|
// -*- C++ -*-
|
2002-08-24 20:25:17 +00:00
|
|
|
/**
|
|
|
|
* \file insetoptarg.h
|
|
|
|
* Copyright 2002 the LyX Team
|
|
|
|
* Read the file COPYING
|
2002-08-23 09:05:32 +00:00
|
|
|
*
|
2002-08-24 20:25:17 +00:00
|
|
|
* \author Martin Vermeer <martin.vermeer@hut.fi>
|
|
|
|
*/
|
2002-08-23 09:05:32 +00:00
|
|
|
|
|
|
|
#ifndef INSETOPTARG_H
|
|
|
|
#define INSETOPTARG_H
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "insettext.h"
|
|
|
|
#include "insetcollapsable.h"
|
|
|
|
|
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
|
|
|
|
*/
|
2002-08-23 09:05:32 +00:00
|
|
|
class InsetOptArg : public InsetCollapsable {
|
|
|
|
public:
|
|
|
|
InsetOptArg(BufferParams const &);
|
2002-08-24 20:25:17 +00:00
|
|
|
|
2002-08-23 09:05:32 +00:00
|
|
|
InsetOptArg(InsetOptArg const &, bool same_id = false);
|
|
|
|
|
2002-08-24 20:25:17 +00:00
|
|
|
/// make a duplicate of this inset
|
2002-08-23 09:05:32 +00:00
|
|
|
Inset * clone(Buffer const &, bool same_id = false) const;
|
2002-08-24 20:25:17 +00:00
|
|
|
|
|
|
|
/// this inset is editable
|
2002-08-23 09:05:32 +00:00
|
|
|
EDITABLE editable() const { return IS_EDITABLE; }
|
2002-08-24 20:25:17 +00:00
|
|
|
/// code of the inset
|
2002-08-23 09:05:32 +00:00
|
|
|
Inset::Code lyxCode() const { return Inset::OPTARG_CODE; }
|
2002-08-24 20:25:17 +00:00
|
|
|
/// return an message upon editing
|
2002-08-23 09:05:32 +00:00
|
|
|
string const editMessage() const;
|
2002-08-24 20:25:17 +00:00
|
|
|
|
2002-08-23 09:05:32 +00:00
|
|
|
/// Standard LaTeX output -- short-circuited
|
2002-08-24 20:25:17 +00:00
|
|
|
int latex(Buffer const *, std::ostream &,
|
2002-08-23 09:05:32 +00:00
|
|
|
bool fragile, bool fp) const;
|
|
|
|
/// Outputting the optional parameter of a LaTeX command
|
2002-08-24 20:25:17 +00:00
|
|
|
int latexOptional(Buffer const *, std::ostream &,
|
2002-08-23 09:05:32 +00:00
|
|
|
bool fragile, bool fp) const;
|
2002-08-24 20:25:17 +00:00
|
|
|
/// Write out tothe .lyx file
|
2002-08-23 09:05:32 +00:00
|
|
|
void write(Buffer const * buf, ostream & os) const;
|
|
|
|
};
|
|
|
|
|
2002-08-24 20:25:17 +00:00
|
|
|
#endif // INSETOPTARG_H
|