X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetCaption.h;h=e8582b61fb1e6121b3dbe728bd9c8156be1194ab;hb=67e70c6c022fa445cd654937faeb87955e3bca7a;hp=b3dce709daca9edecb1d2b821c63daf2b9e9ef86;hpb=db8c16d554ebb1dcb319e44d318572de6eff024b;p=lyx.git diff --git a/src/insets/InsetCaption.h b/src/insets/InsetCaption.h index b3dce709da..e8582b61fb 100644 --- a/src/insets/InsetCaption.h +++ b/src/insets/InsetCaption.h @@ -4,7 +4,7 @@ * 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. */ @@ -16,72 +16,69 @@ namespace lyx { -class TextClass; - /** A caption inset */ class InsetCaption : public InsetText { public: /// - InsetCaption(InsetCaption const &); - InsetCaption(BufferParams const &); + InsetCaption(Buffer const &); /// - virtual ~InsetCaption() {} + std::string const & type() const { return type_; } + /// 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; + /// return the caption text + int getCaptionText(odocstream & os, OutputParams const &) const; +private: /// void write(std::ostream & os) const; /// void read(Lexer & lex); /// - virtual DisplayType display() const; + DisplayType display() const { return AlignCenter; } /// - virtual bool neverIndent() const { return true; } + bool neverIndent() const { return true; } /// - virtual InsetCode lyxCode() const; + InsetCode lyxCode() const { return CAPTION_CODE; } /// docstring editMessage() const; /// - virtual void cursorPos(BufferView const & bv, + void cursorPos(BufferView const & bv, CursorSlice const & sl, bool boundary, int & x, int & y) const; /// bool descendable() const { return true; } /// - virtual void metrics(MetricsInfo & mi, Dimension & dim) const; + void metrics(MetricsInfo & mi, Dimension & dim) const; /// - virtual void draw(PainterInfo & pi, int x, int y) const; + void draw(PainterInfo & pi, int x, int y) const; /// - virtual void edit(Cursor & cur, bool front, EntryDirection entry_from); + void edit(Cursor & cur, bool front, EntryDirection entry_from); /// - virtual Inset * editXY(Cursor & cur, int x, int y); + Inset * editXY(Cursor & cur, int x, int y); /// bool insetAllowed(InsetCode code) const; /// - virtual bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const; + bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const; // Update the counters of this inset and of its contents - virtual void updateLabels(ParIterator const &); + void updateLabels(ParIterator const &); /// int latex(odocstream & os, OutputParams const &) const; /// int plaintext(odocstream & os, OutputParams const & runparams) const; /// 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; - /// - std::string const & type() const { return type_; } /// void setCustomLabel(docstring const & label); /// - void addToToc(ParConstIterator const &) const; + void addToToc(DocIterator const &); /// - virtual bool forceEmptyLayout() const { return true; } + virtual bool forcePlainLayout(idx_type = 0) const { return true; } /// Captions don't accept alignment, spacing, etc. - virtual bool allowParagraphCustomization(idx_type) const { return false; } - -private: + virtual bool allowParagraphCustomization(idx_type = 0) const { return false; } /// - virtual Inset * clone() const; + Inset * clone() const { return new InsetCaption(*this); } + /// mutable docstring full_label_; /// @@ -90,25 +87,9 @@ private: std::string type_; /// docstring custom_label_; - /// - TextClass const & textclass_; }; -inline -Inset::DisplayType InsetCaption::display() const -{ - return AlignCenter; -} - - -inline -InsetCode InsetCaption::lyxCode() const -{ - return CAPTION_CODE; -} - - } // namespace lyx #endif