* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
*
* Full author contact details are available in file CREDITS.
*/
class InsetCaption : public InsetText {
public:
///
- InsetCaption(InsetCaption const &);
- InsetCaption(Buffer const &);
+ InsetCaption(Buffer *, std::string const &);
///
- virtual ~InsetCaption() {}
+ std::string const & floattype() const { return floattype_; }
///
- void write(std::ostream & os) const;
+ docstring layoutName() const override;
+ /// return the mandatory argument (LaTeX format) only
+ void getArgument(otexstream & os, OutputParams const &) const;
+ /// return the caption text
+ int getCaptionAsPlaintext(odocstream & os, OutputParams const &) const;
+ /// write the caption text as DocBook in os
+ void getCaptionAsDocBook(XMLStream & os, OutputParams const &) const;
+ /// return the caption text as HTML
+ docstring getCaptionAsHTML(XMLStream & os, OutputParams const &) const;
+ ///
+ std::string contextMenuName() const override;
+private:
+ ///
+ void write(std::ostream & os) const override;
///
- void read(Lexer & lex);
+ int rowFlags() const override { return Display; }
///
- virtual DisplayType display() const;
+ bool neverIndent() const override { return true; }
///
- virtual bool neverIndent() const { return true; }
+ bool forceLocalFontSwitch() const override { return true; }
///
- virtual InsetCode lyxCode() const;
+ InsetCode lyxCode() const override { return CAPTION_CODE; }
///
- docstring editMessage() const;
+ void cursorPos(BufferView const & bv,
+ CursorSlice const & sl, bool boundary, int & x, int & y) const override;
///
- virtual void cursorPos(BufferView const & bv,
- CursorSlice const & sl, bool boundary, int & x, int & y) const;
+ bool descendable(BufferView const &) const override { return true; }
///
- bool descendable() const { return true; }
+ void metrics(MetricsInfo & mi, Dimension & dim) const override;
///
- virtual void metrics(MetricsInfo & mi, Dimension & dim) const;
+ void drawBackground(PainterInfo & pi, int x, int y) const override;
///
- virtual void draw(PainterInfo & pi, int x, int y) const;
+ void draw(PainterInfo & pi, int x, int y) const override;
+ /// Strike out the inset when deleted.
+ bool canPaintChange(BufferView const &) const override { return true; }
///
- virtual void edit(Cursor & cur, bool front, EntryDirection entry_from);
+ void edit(Cursor & cur, bool front, EntryDirection entry_from) override;
///
- virtual Inset * editXY(Cursor & cur, int x, int y);
+ Inset * editXY(Cursor & cur, int x, int y) override;
///
- bool insetAllowed(InsetCode code) const;
+ bool insetAllowed(InsetCode code) const override;
///
- virtual bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
+ void doDispatch(Cursor & cur, FuncRequest & cmd) override;
+ ///
+ bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const override;
// Update the counters of this inset and of its contents
- virtual void updateLabels(ParIterator const &);
+ void updateBuffer(ParIterator const &, UpdateType, bool const deleted) override;
///
- int latex(odocstream & os, OutputParams const &) const;
+ void latex(otexstream & os, OutputParams const &) const override;
///
- int plaintext(odocstream & os, OutputParams const & runparams) const;
+ int plaintext(odocstringstream & ods, OutputParams const & op,
+ size_t max_length = INT_MAX) const override;
///
- int docbook(odocstream & os, OutputParams const & runparams) const;
- /// return the mandatory argument (LaTeX format) only
- int getArgument(odocstream & os, OutputParams const &) const;
- /// return the optional argument(s) only
- int getOptArg(odocstream & os, OutputParams const &) const;
+ void docbook(XMLStream &, OutputParams const &) const override;
///
- std::string const & type() const { return type_; }
+ docstring xhtml(XMLStream & os, OutputParams const & runparams) const override;
///
- void setCustomLabel(docstring const & label);
+ void addToToc(DocIterator const & di, bool output_active, UpdateType utype,
+ TocBackend & backend) const override;
///
- void addToToc(ParConstIterator const &) const;
- ///
- virtual bool forceEmptyLayout() const { return true; }
+ docstring toolTip(BufferView const & bv, int x, int y) const override;
+ ///
+ bool forcePlainLayout(idx_type = 0) const override { return true; }
/// Captions don't accept alignment, spacing, etc.
- virtual bool allowParagraphCustomization(idx_type) const { return false; }
-
-private:
+ bool allowParagraphCustomization(idx_type = 0) const override { return false; }
///
- virtual Inset * clone() const;
+ Inset * clone() const override { return new InsetCaption(*this); }
+
///
mutable docstring full_label_;
///
- mutable int labelwidth_;
+ mutable int labelwidth_ = 0;
///
- std::string type_;
+ mutable bool rtl_ = false;
+ ///
+ std::string floattype_;
+ ///
+ bool is_subfloat_ = false;
///
- bool in_subfloat_;
+ bool is_deleted_ = false;
///
- docstring custom_label_;
+ bool non_float_ = false;
+ ///
+ std::string type_;
};
-inline
-Inset::DisplayType InsetCaption::display() const
-{
- return AlignCenter;
-}
-
-
-inline
-InsetCode InsetCaption::lyxCode() const
-{
- return CAPTION_CODE;
-}
-
-
} // namespace lyx
#endif