+2002-08-24 John Levon <levon@movementarian.org>
+
+ * insetoptarg.h:
+ * insetoptarg.C: ws, pedantry ...
+
2002-08-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
* insettext.C (collapseParagraphs): pasteParagraph now in global
-/* This file is part of
- * ======================================================
+/**
+ * \file insetoptarg.C
+ * Copyright 2002 the LyX Team
+ * Read the file COPYING
*
- * LyX, The Document Processor
- *
- * Copyright 1995 Matthias Ettrich
- * Copyright 1995-2001 The LyX Team.
- *
- * ====================================================== */
+ * \author Martin Vermeer <martin.vermeer@hut.fi>
+ */
#include <config.h>
#include "insetoptarg.h"
#include "support/LOstream.h"
#include "frontends/Alert.h"
-#include "support/lstrings.h" //frontStrip, strip
+#include "support/lstrings.h" // frontStrip, strip
#include "lyxtext.h"
#include "buffer.h"
#include "gettext.h"
using std::vector;
using std::pair;
-/* OptArg. Used to insert a short version of sectioning header etc.
- * automatically, or other optional LaTeX arguments */
-
-
InsetOptArg::InsetOptArg(BufferParams const & ins)
: InsetCollapsable(ins, true)
{
- LyXFont font(LyXFont::ALL_SANE);
+ LyXFont font(LyXFont::ALL_SANE);
font.setColor(LColor::collapsable);
setLabelFont(font);
setLabel(_("opt"));
}
+
InsetOptArg::InsetOptArg(InsetOptArg const & in, bool same_id)
- : InsetCollapsable(in, same_id)
+ : InsetCollapsable(in, same_id)
{
- LyXFont font(LyXFont::ALL_SANE);
+ LyXFont font(LyXFont::ALL_SANE);
font.setColor(LColor::collapsable);
setLabelFont(font);
setLabel(_("opt"));
}
+
Inset * InsetOptArg::clone(Buffer const &, bool same_id) const
{
- return new InsetOptArg(*this, same_id);
+ return new InsetOptArg(*this, same_id);
}
+
string const InsetOptArg::editMessage() const
{
return _("Opened Optional Argument Inset");
}
+
void InsetOptArg::write(Buffer const * buf, ostream & os) const
{
os << "OptArg" << "\n";
InsetCollapsable::write(buf, os);
}
+
int InsetOptArg::latex(Buffer const *, ostream &, bool, bool) const
{
return 0;
}
+
int InsetOptArg::latexOptional(Buffer const * buf, ostream & os,
bool, bool fp) const
{
os << ']';
return i + 2;
}
-
// -*- C++ -*-
-/* This file is part of*
- * ======================================================
+/**
+ * \file insetoptarg.h
+ * Copyright 2002 the LyX Team
+ * Read the file COPYING
*
- * LyX, The Document Processor
- *
- * Copyright 1995 Matthias Ettrich
- * Copyright 1995-2001 The LyX Team
- *
- * ====================================================== */
+ * \author Martin Vermeer <martin.vermeer@hut.fi>
+ */
#ifndef INSETOPTARG_H
#define INSETOPTARG_H
#include "insettext.h"
#include "insetcollapsable.h"
+/**
+ * InsetOptArg. Used to insert a short version of sectioning header etc.
+ * automatically, or other optional LaTeX arguments
+ */
class InsetOptArg : public InsetCollapsable {
public:
InsetOptArg(BufferParams const &);
- ///
+
InsetOptArg(InsetOptArg const &, bool same_id = false);
+ /// make a duplicate of this inset
Inset * clone(Buffer const &, bool same_id = false) const;
- ///
+
+ /// this inset is editable
EDITABLE editable() const { return IS_EDITABLE; }
- ///
+ /// code of the inset
Inset::Code lyxCode() const { return Inset::OPTARG_CODE; }
- ///
+ /// return an message upon editing
string const editMessage() const;
+
/// Standard LaTeX output -- short-circuited
- int latex(Buffer const *, std::ostream &,
+ int latex(Buffer const *, std::ostream &,
bool fragile, bool fp) const;
/// Outputting the optional parameter of a LaTeX command
- int latexOptional(Buffer const *, std::ostream &,
+ int latexOptional(Buffer const *, std::ostream &,
bool fragile, bool fp) const;
- ///
+ /// Write out tothe .lyx file
void write(Buffer const * buf, ostream & os) const;
};
-#endif
+#endif // INSETOPTARG_H