#include "InsetLayout.h"
#include "LayoutEnums.h"
#include "OutputEnums.h"
+#include "OutputParams.h"
#include "support/strfwd.h"
#include "support/types.h"
class CursorSlice;
class Dimension;
class DocIterator;
+class Encoding;
class FuncRequest;
class FuncStatus;
class InsetArgument;
class InsetCollapsible;
class InsetCommand;
+class InsetGraphics;
class InsetIterator;
class InsetLayout;
class InsetList;
virtual InsetCommand const * asInsetCommand() const { return 0; }
/// is this inset based on the InsetArgument class?
virtual InsetArgument const * asInsetArgument() const { return nullptr; }
+ /// is this inset based on the InsetGraphics class?
+ virtual InsetGraphics * asInsetGraphics() { return 0; }
+ /// is this inset based on the InsetGraphics class?
+ virtual InsetGraphics const * asInsetGraphics() const { return 0; }
/// the real dispatcher
void dispatch(Cursor & cur, FuncRequest & cmd);
/// https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg199001.html
virtual Inset * editXY(Cursor & cur, int x, int y);
+ /// The default margin inside text insets
+ static int textOffset(BufferView const *) { return 4; }
+ ///
+ virtual int topOffset(BufferView const *bv) const { return textOffset(bv); }
+ ///
+ virtual int bottomOffset(BufferView const *bv) const { return textOffset(bv); }
+ ///
+ virtual int leftOffset(BufferView const *bv) const { return textOffset(bv); }
+ ///
+ virtual int rightOffset(BufferView const *bv) const { return textOffset(bv); }
+
/// compute the size of the object returned in dim
virtual void metrics(MetricsInfo & mi, Dimension & dim) const = 0;
/// draw inset and update (xo, yo)-cache
virtual bool showInsetDialog(BufferView *) const;
/// draw two angular markers
- void drawMarkers(PainterInfo & pi, int x, int y) const;
- /// draw four angular markers
- void drawMarkers2(PainterInfo & pi, int x, int y) const;
+ virtual void drawMarkers(PainterInfo & pi, int x, int y) const;
/// add space for markers
void metricsMarkers(Dimension & dim, int framesize = 1) const;
/// add space for markers
/// Don't eliminate empty paragraphs
virtual bool allowEmpty() const;
/// Force inset into LTR environment if surroundings are RTL
- virtual bool forceLTR() const;
+ virtual bool forceLTR(OutputParams const &) const;
/// whether to include this inset in the strings generated for the TOC
virtual bool isInToc() const;
/// if this inset has paragraphs should they be forced to use a
/// local font language switch?
virtual bool forceLocalFontSwitch() const { return false; }
+ /// if this inset has paragraphs should they be forced to use a
+ /// font language switch that switches paragraph directions
+ /// (relevant with polyglossia only)?
+ virtual bool forceParDirectionSwitch() const { return false; }
+ /// Does the inset force a specific encoding?
+ virtual Encoding const * forcedEncoding(Encoding const *, Encoding const *) const
+ { return 0; }
+
/// Is the content of this inset part of the output document?
virtual bool producesOutput() const { return true; }
/// does this inset try to use all available space (like \\hfill does)?
virtual bool isHfill() const { return false; }
+ virtual OutputParams::CtObject CtObject(OutputParams const &) const { return OutputParams::CT_NORMAL; }
+
enum DisplayType {
Inline = 0,
AlignLeft,
*/
virtual bool resetFontEdit() const;
+ /// does the inset contain changes ?
+ virtual bool isChanged() const { return false; }
/// set the change for the entire inset
virtual void setChange(Change const &) {}
/// accept the changes within the inset
/// reject the changes within the inset
virtual void rejectChanges() {}
+ ///
+ virtual bool needsCProtection(bool const, bool const) const { return false; }
+
///
virtual ColorCode backgroundColor(PainterInfo const &) const;
///
virtual ColorCode labelColor() const;
- //
- enum { TEXT_TO_INSET_OFFSET = 4 };
/// Determine the action of backspace and delete: do we select instead of
/// deleting if not already selected?