]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCaption.h
Merge branch 'master' into biblatex2
[lyx.git] / src / insets / InsetCaption.h
index 837aaa442ba2606bf2f56c4b6ef353bf6d50287a..461d9ce4f4e0da43ff59c713808f749f352fddd8 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,90 +21,90 @@ namespace lyx {
 class InsetCaption : public InsetText {
 public:
        ///
-       InsetCaption(InsetCaption const &);
-       InsetCaption(BufferParams 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(XHTMLStream & 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;
+       ///     
+       void drawBackground(PainterInfo & pi, int x, int y) const;
        ///
-       virtual void draw(PainterInfo & pi, int x, int y) const;
+       void draw(PainterInfo & pi, int x, int y) const;
+       /// Strike out the inset when deleted.
+       bool canPaintChange(BufferView const &) const { return true; }
        ///
-       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;
+       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);
        ///
-       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(XHTMLStream & os, OutputParams const & runparams) const;
        ///
        void setCustomLabel(docstring const & label);
        ///
-       void addToToc(ParConstIterator const &) const;
+       void addToToc(DocIterator const & di, bool output_active, UpdateType utype) 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 floattype_;
+       ///
+       bool is_subfloat_;
+       ///
        std::string type_;
        ///
        docstring custom_label_;
 };
 
 
-inline
-Inset::DisplayType InsetCaption::display() const
-{
-       return AlignCenter;
-}
-
-
-inline
-InsetCode InsetCaption::lyxCode() const
-{
-       return CAPTION_CODE;
-}
-
-
 } // namespace lyx
 
 #endif