]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCaption.h
Revert 3ceb5034
[lyx.git] / src / insets / InsetCaption.h
index 9a95c9f378473d501af9a74b7c423150cf582df0..a2aca81c4bbfcde30269cb8583521bffe335b519 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.
  */
@@ -13,8 +13,6 @@
 #define INSETCAPTION_H
 
 #include "InsetText.h"
-#include "TextClass.h"
-
 
 namespace lyx {
 
@@ -23,99 +21,91 @@ 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(Buffer const & buf, 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(Buffer const & buf, Lexer & lex);
+       std::string contextMenuName() const;
+private:
        ///
-       virtual DisplayType display() const;
+       void write(std::ostream & os) const;
        ///
-       virtual bool neverIndent(Buffer const &) const { return true; }
+       DisplayType display() const { return AlignCenter; }
        ///
-       virtual Inset::Code lyxCode() const;
+       bool neverIndent() const { return true; }
        ///
-       virtual docstring const editMessage() const;
+       bool forceLocalFontSwitch() const { return true; }
        ///
-       virtual void cursorPos(BufferView const & bv,
+       InsetCode lyxCode() const { return CAPTION_CODE; }
+       ///
+       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 bool 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; }
        ///
-       void drawSelection(PainterInfo & pi, int x, int y) const;
+       void edit(Cursor & cur, bool front, EntryDirection entry_from);
        ///
-       virtual void edit(Cursor & cur, bool left);
+       Inset * editXY(Cursor & cur, int x, int y);
        ///
-       virtual Inset * editXY(Cursor & cur, int x, int y);
+       bool insetAllowed(InsetCode code) const;
        ///
-       bool insetAllowed(Inset::Code code) const;
+       void doDispatch(Cursor & cur, FuncRequest & cmd);
        ///
-       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(Buffer const &, ParIterator const &);
+       void updateBuffer(ParIterator const &, UpdateType);
        ///
-       int latex(Buffer const & buf, odocstream & os,
-                 OutputParams const &) const;
+       void latex(otexstream & os, OutputParams const &) const;
        ///
-       int plaintext(Buffer const & buf, odocstream & os,
-                     OutputParams const & runparams) const;
+       int plaintext(odocstringstream & ods, OutputParams const & op,
+                     size_t max_length = INT_MAX) const;
        ///
-       int docbook(Buffer const & buf, odocstream & os,
-                   OutputParams const & runparams) const;
-       /// return the mandatory argument (LaTeX format) only
-       int getArgument(Buffer const & buf, odocstream & os,
-                 OutputParams const &) const;
-       /// return the optional argument(s) only
-       int getOptArg(Buffer const & buf, odocstream & os,
-                 OutputParams const &) const;
-       ///
-       std::string const & type() const { return type_; }
-       ///
-       void setType(std::string const & type) { type_ = type; }
+       int docbook(odocstream & os, OutputParams const & runparams) const;
+       /// 
+       docstring xhtml(XHTMLStream & os, OutputParams const & runparams) const;
        ///
        void setCustomLabel(docstring const & label);
        ///
-       void addToToc(TocList &, Buffer const &, ParConstIterator const &) const;
+       void addToToc(DocIterator const & di, bool output_active, UpdateType utype,
+                     TocBackend & backend) const;
+       /// 
+       virtual bool forcePlainLayout(idx_type = 0) const { return true; }
        /// Captions don't accept alignment, spacing, etc.
-       bool forceDefaultParagraphs(idx_type) const { return true; }
-
-private:
+       virtual bool allowParagraphCustomization(idx_type = 0) const { return false; }
        ///
-       virtual std::auto_ptr<Inset> doClone() 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_;
-       ///
-       TextClass const & textclass_;
 };
 
 
-inline
-Inset::DisplayType InsetCaption::display() const
-{
-       return AlignCenter;
-}
-
-
-inline
-Inset::Code InsetCaption::lyxCode() const
-{
-       return CAPTION_CODE;
-}
-
-
 } // namespace lyx
 
 #endif