]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCaption.h
Rename XHTMLStream to XMLStream, move it to another file, and prepare for DocBook...
[lyx.git] / src / insets / InsetCaption.h
index 631181b9224e55bfda69eb391b6bffddd4c16ce2..be0d163041ef43504aab31f3135d90d7d6664476 100644 (file)
@@ -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.
  */
@@ -21,92 +21,89 @@ namespace lyx {
 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;
+       /// 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;
+       /// return the caption text as HTML
+       docstring getCaptionAsHTML(XMLStream & os, OutputParams const &) const;
        ///
-       void read(Lexer & lex);
+       std::string contextMenuName() const;
+private:
+       ///
+       void write(std::ostream & os) const;
        ///
-       virtual DisplayType display() const;
+       DisplayType display() const { return AlignCenter; }
        ///
-       virtual bool neverIndent() const { return true; }
+       bool neverIndent() const { return true; }
        ///
-       virtual InsetCode lyxCode() const;
+       bool forceLocalFontSwitch() const { return true; }
        ///
-       docstring editMessage() const;
+       InsetCode lyxCode() const { return CAPTION_CODE; }
        ///
-       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; }
+       bool descendable(BufferView const &) 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 drawBackground(PainterInfo & pi, int x, int y) const;
        ///
-       virtual void edit(Cursor & cur, bool front, EntryDirection entry_from);
+       void draw(PainterInfo & pi, int x, int y) const;
+       /// Strike out the inset when deleted.
+       bool canPaintChange(BufferView const &) const { return true; }
        ///
-       virtual Inset * editXY(Cursor & cur, int x, int y);
+       void edit(Cursor & cur, bool front, EntryDirection entry_from);
+       ///
+       Inset * editXY(Cursor & cur, int x, int y);
        ///
        bool insetAllowed(InsetCode code) const;
        ///
-       virtual bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
+       void doDispatch(Cursor & cur, FuncRequest & cmd);
+       ///
+       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 updateBuffer(ParIterator const &, UpdateType, bool const deleted);
        ///
-       int latex(odocstream & os, OutputParams const &) const;
+       void latex(otexstream & os, OutputParams const &) const;
        ///
-       int plaintext(odocstream & os, OutputParams const & runparams) const;
+       int plaintext(odocstringstream & ods, OutputParams const & op,
+                     size_t max_length = INT_MAX) 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_; }
+       docstring xhtml(XMLStream & os, OutputParams const & runparams) const;
        ///
-       void setCustomLabel(docstring const & label);
+       void addToToc(DocIterator const & di, bool output_active, UpdateType utype,
+                     TocBackend & backend) const;
        ///
-       void addToToc(ParConstIterator const &) 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_;
        ///
        mutable int labelwidth_;
        ///
-       std::string type_;
+       std::string floattype_;
        ///
-       bool in_subfloat_;
+       bool is_subfloat_;
        ///
-       docstring custom_label_;
+       bool is_deleted_;
+       ///
+       std::string type_;
 };
 
 
-inline
-Inset::DisplayType InsetCaption::display() const
-{
-       return AlignCenter;
-}
-
-
-inline
-InsetCode InsetCaption::lyxCode() const
-{
-       return CAPTION_CODE;
-}
-
-
 } // namespace lyx
 
 #endif