insets/InsetNewpage.h \
insets/InsetNomencl.h \
insets/InsetNote.h \
+ insets/InsetParams.h \
insets/InsetPhantom.h \
insets/InsetQuotes.h \
insets/InsetRef.h \
#include "ColorCode.h"
#include "InsetCode.h"
+#include "InsetParams.h"
#include "LayoutEnums.h"
#include "OutputEnums.h"
#include "OutputParams.h"
namespace lyx {
-class InsetBoxParams
+class InsetBoxParams : public InsetParams
{
public:
///
explicit InsetBoxParams(std::string const &);
///
- void write(std::ostream & os) const;
+ void write(std::ostream & os) const override;
///
- void read(Lexer & lex);
+ void read(Lexer & lex) override;
///
std::string type;
namespace lyx {
-class InsetBranchParams {
+class InsetBranchParams : public InsetParams {
public:
///
explicit InsetBranchParams(docstring const & b = docstring())
InsetBranchParams(docstring const & b, bool i)
: branch(b), inverted(i) {}
///
- void write(std::ostream & os) const;
+ void write(std::ostream & os) const override;
///
- void read(Lexer & lex);
+ void read(Lexer & lex) override;
///
docstring branch;
///
#define INSETCOMMANDPARAMS_H
#include "InsetCode.h"
+#include "InsetParams.h"
#include "support/docstring.h"
};
-class InsetCommandParams {
+class InsetCommandParams : public InsetParams {
public:
/// Construct parameters for inset of type \p code.
explicit InsetCommandParams(InsetCode code);
///
InsetCode code() const { return insetCode_; }
/// Parse the command
- void read(Lexer &);
+ void read(Lexer &) override;
///
void Read(Lexer &, Buffer const *);
///
- void write(std::ostream &) const;
+ void write(std::ostream &) const override;
///
void Write(std::ostream & os, Buffer const * buf) const;
/// Build the complete LaTeX command
struct TexString;
-class InsetFloatParams
+class InsetFloatParams : public InsetParams
{
public:
///
InsetFloatParams() : type("senseless"), placement("document"), alignment("document"),
wide(false), sideways(false), subfloat(false) {}
///
- void write(std::ostream & os) const;
+ void write(std::ostream & os) const override;
///
- void read(Lexer & lex);
+ void read(Lexer & lex) override;
///
std::string type;
///
class LaTeXFeatures;
-class InsetIPADecoParams
+class InsetIPADecoParams : public InsetParams
{
public:
enum Type {
///
InsetIPADecoParams();
///
- void write(std::ostream & os) const;
+ void write(std::ostream & os) const override;
///
- void read(Lexer & lex);
+ void read(Lexer & lex) override;
///
Type type;
};
namespace lyx {
-class InsetIndexParams {
+class InsetIndexParams : public InsetParams {
public:
///
explicit InsetIndexParams(docstring const & b = docstring())
: index(b) {}
///
- void write(std::ostream & os) const;
+ void write(std::ostream & os) const override;
///
- void read(Lexer & lex);
+ void read(Lexer & lex) override;
///
docstring index;
};
#ifndef INSET_LISTINGS_H
#define INSET_LISTINGS_H
+#include "InsetCaptionable.h"
#include "InsetListingsParams.h"
-
namespace lyx {
class LaTeXFeatures;
*/
#include <config.h>
-#include <algorithm>
#include "InsetListingsParams.h"
-#include "support/Length.h"
#include "Lexer.h"
#include "support/convert.h"
#include "support/gettext.h"
+#include "support/Length.h"
#include "support/lstrings.h"
#include "support/textutils.h"
+#include <algorithm>
#include <sstream>
using namespace std;
#ifndef INSETLISTINGSPARAMS_H
#define INSETLISTINGSPARAMS_H
-#include "InsetCaptionable.h"
+#include "InsetCollapsible.h"
#include <map>
namespace lyx {
-class InsetListingsParams {
+class InsetListingsParams : public InsetParams {
public:
///
InsetListingsParams();
InsetCollapsible::CollapseStatus s = InsetCollapsible::Open);
/// write parameters to an ostream
- void write(std::ostream &) const;
+ void write(std::ostream &) const override;
/// read parameters from an ostream
- void read(Lexer &);
+ void read(Lexer &) override;
/// valid parameter string
std::string params(std::string const & sep=",") const;
namespace lyx {
-class InsetNewlineParams
+class InsetNewlineParams : public InsetParams
{
public:
/// The different kinds of spaces we support
///
InsetNewlineParams() : kind(NEWLINE) {}
///
- void write(std::ostream & os) const;
+ void write(std::ostream & os) const override;
///
- void read(Lexer & lex);
+ void read(Lexer & lex) override;
///
Kind kind;
};
namespace lyx {
-class InsetNewpageParams
+class InsetNewpageParams : public InsetParams
{
public:
/// The different kinds of spaces we support
///
InsetNewpageParams() : kind(NEWPAGE) {}
///
- void write(std::ostream & os) const;
+ void write(std::ostream & os) const override;
///
- void read(Lexer & lex);
+ void read(Lexer & lex) override;
///
Kind kind;
};
namespace lyx {
-class InsetNoteParams
+class InsetNoteParams : public InsetParams
{
public:
enum Type {
/// \c type defaults to Note
InsetNoteParams();
///
- void write(std::ostream & os) const;
+ void write(std::ostream & os) const override;
///
- void read(Lexer & lex);
+ void read(Lexer & lex) override;
///
Type type;
};
--- /dev/null
+// -*- C++ -*-
+/**
+ * \file InsetParams.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Yuriy Skalko
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef INSETPARAMS_H
+#define INSETPARAMS_H
+
+#include <ostream>
+
+namespace lyx {
+
+class Lexer;
+
+
+class InsetParams
+{
+public:
+ ///
+ virtual ~InsetParams() = default;
+ ///
+ virtual void write(std::ostream & os) const = 0;
+ ///
+ virtual void read(Lexer & lex) = 0;
+};
+
+
+} // namespace lyx
+
+#endif // INSETPARAMS_H
namespace lyx {
-class InsetPhantomParams
+class InsetPhantomParams : public InsetParams
{
public:
enum Type {
/// \c type defaults to Phantom
InsetPhantomParams();
///
- void write(std::ostream & os) const;
+ void write(std::ostream & os) const override;
///
- void read(Lexer & lex);
+ void read(Lexer & lex) override;
///
Type type;
};
namespace lyx {
-class InsetScriptParams
+class InsetScriptParams : public InsetParams
{
public:
enum Type {
/// \c type defaults to Subscript
InsetScriptParams();
///
- void write(std::ostream & os) const;
+ void write(std::ostream & os) const override;
///
- void read(Lexer & lex);
+ void read(Lexer & lex) override;
///
int shift(FontInfo const & font) const;
///
namespace lyx {
-class InsetSeparatorParams
+class InsetSeparatorParams : public InsetParams
{
public:
/// The different kinds of separators we support
///
InsetSeparatorParams() : kind(PLAIN) {}
///
- void write(std::ostream & os) const;
+ void write(std::ostream & os) const override;
///
- void read(Lexer & lex);
+ void read(Lexer & lex) override;
///
Kind kind;
};
class LaTeXFeatures;
-struct InsetSpaceParams {
+struct InsetSpaceParams : public InsetParams {
/// The different kinds of spaces we support
enum Kind {
/// Normal space ('\ ')
///
explicit InsetSpaceParams(bool m = false) : kind(NORMAL), math(m) {}
///
- void write(std::ostream & os) const;
+ void write(std::ostream & os) const override;
///
- void read(Lexer & lex);
+ void read(Lexer & lex) override;
///
Kind kind;
///
namespace lyx {
-class InsetWrapParams {
+class InsetWrapParams : public InsetParams {
public:
///
- void write(std::ostream &) const;
+ void write(std::ostream &) const override;
///
- void read(Lexer &);
+ void read(Lexer &) override;
///
std::string type;