lyx_mirror/src/insets/InsetFloatList.h
Jean-Marc Lasgouttes ba738d0167 Use new rowFlags() values to remove some inset hardcoding.
The enum DisplayType is replaced with the flags RowFlags that can be
combined. Here is the correspondence between the old DisplayType and
the new Inset::RowFlags:

DisplayType   RowFLags             Meaning
 Inline        Inline               plain inline inset
  --           BreakBefore          row ends before this inset
  --           BreakAfter           the row ends after this inset
 AlignCenter   Display	            the inset is centered on its own row
 AlignLeft     Display | AlignLeft  the inset is left-aligned on its row
 AlignRight    Display | AlignRight the inset is right-aligned on its row
  --           RowAfter             an extra row is needed after this inset

Display is just a shortcut for BreakBefore | BreakAfter.

The flags for the newline inset will be BreakAfter | RowAfter,
while the separator inset will just use BreakAfter.

This groundwork does not introduce any new feature at this point. It
aims to remve the numerous isNewLine and isSeparator all over the
code, and to eventually optional break after some insets like spaces
(see #11621).

Most display() methods are renamed to rowFlags(). Some are removed
because they returned Inline.

Now display() is only a helper function for hull insets.
2020-06-22 23:11:40 +02:00

87 lines
1.9 KiB
C++

// -*- C++ -*-
/**
* \file InsetFloatList.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Lars Gullik Bjønnes
*
* Full author contact details are available in file CREDITS.
*/
#ifndef INSET_FLOATLIST_H
#define INSET_FLOATLIST_H
#include "InsetCommand.h"
namespace lyx {
/** Used to insert table of contents
*/
class InsetFloatList : public InsetCommand {
public:
///
explicit InsetFloatList(Buffer *);
///
InsetFloatList(Buffer *, std::string const & type);
/// \name Public functions inherited from Inset class
//@{
///
InsetCode lyxCode() const { return FLOAT_LIST_CODE; }
///
RowFlags rowFlags() const { return Display; }
///
void write(std::ostream &) const;
///
void read(Lexer &);
///
void latex(otexstream &, OutputParams const &) const;
///
int docbook(odocstream &, OutputParams const &) const { return 0; }
///
int plaintext(odocstringstream & ods, OutputParams const & op,
size_t max_length = INT_MAX) const;
///
docstring xhtml(XMLStream &, OutputParams const &) const;
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
///
bool clickable(BufferView const &, int, int) const { return true; }
///
void validate(LaTeXFeatures & features) const;
//@}
/// \name Static public methods obligated for InsetCommand derived classes
//@{
///
static ParamInfo const & findInfo(std::string const &);
///
static std::string defaultCommand() { return "listoftables"; }
///
static bool isCompatibleCommand(std::string const & s);
//@}
private:
/// \name Private functions inherited from Inset class
//@{
///
Inset * clone() const { return new InsetFloatList(*this); }
///
docstring layoutName() const;
//@}
/// \name Private functions inherited from InsetCommand class
//@{
///
docstring screenLabel() const;
//@}
};
} // namespace lyx
#endif