]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCaption.h
Get rid of Qt resources
[lyx.git] / src / insets / InsetCaption.h
index 8ea685edbe39f2c7735257cf5816de666f8c9304..a651a71a5641be5e9dfcd3e0df51be982dba31b7 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 "LyXTextClass.h"
-
 
 namespace lyx {
 
@@ -23,98 +21,89 @@ namespace lyx {
 class InsetCaption : public InsetText {
 public:
        ///
-       InsetCaption(BufferParams const &);
-       ///
-       virtual ~InsetCaption() {}
+       InsetCaption(Buffer *, std::string const &);
        ///
-       void write(Buffer const & buf, std::ostream & os) const;
+       std::string const & floattype() const { return floattype_; }
        ///
-       void read(Buffer const & buf, Lexer & lex);
+       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;
        ///
-       virtual bool display() const;
+       std::string contextMenuName() const;
+private:
        ///
-       virtual bool neverIndent(Buffer const &) const { return true; }
+       void write(std::ostream & os) const;
        ///
-       virtual Inset::Code lyxCode() const;
+       DisplayType display() const { return AlignCenter; }
        ///
-       virtual docstring const editMessage() const;
+       bool neverIndent() const { return true; }
        ///
-       virtual void cursorPos(BufferView const & bv,
-               CursorSlice const & sl, bool boundary, int & x, int & y) const;
+       bool forceLocalFontSwitch() const { return true; }
        ///
-       bool descendable() const { return true; }
+       InsetCode lyxCode() const { return CAPTION_CODE; }
        ///
-       virtual bool metrics(MetricsInfo & mi, Dimension & dim) const;
+       void cursorPos(BufferView const & bv,
+               CursorSlice const & sl, bool boundary, int & x, int & y) const;
        ///
-       virtual void draw(PainterInfo & pi, int x, int y) const;
+       bool descendable(BufferView const &) const { return true; }
        ///
-       void drawSelection(PainterInfo & pi, int x, int y) const;
+       void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
-       virtual void edit(Cursor & cur, bool left);
+       void drawBackground(PainterInfo & pi, int x, int y) const;
        ///
-       virtual Inset * editXY(Cursor & cur, int x, int y);
+       void draw(PainterInfo & pi, int x, int y) const;
+       /// Strike out the inset when deleted.
+       bool canPaintChange(BufferView const &) const { return true; }
        ///
-       bool insetAllowed(Inset::Code code) const;
+       void edit(Cursor & cur, bool front, EntryDirection entry_from);
        ///
-       virtual bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
+       Inset * editXY(Cursor & cur, int x, int y);
        ///
-       virtual bool wide() const { return false; }
+       bool insetAllowed(InsetCode code) const;
        ///
-       int latex(Buffer const & buf, odocstream & os,
-                 OutputParams const &) const;
+       void doDispatch(Cursor & cur, FuncRequest & cmd);
        ///
-       int plaintext(Buffer const & buf, odocstream & os,
-                     OutputParams const & runparams) const;
+       bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
+       // Update the counters of this inset and of its contents
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted);
        ///
-       int docbook(Buffer const & buf, odocstream & os,
-                   OutputParams const & runparams) const;
+       void latex(otexstream & os, OutputParams const &) const;
        ///
-       void setCount(int c) { counter_ = c; }
+       int plaintext(odocstringstream & ods, OutputParams const & op,
+                     size_t max_length = INT_MAX) const;
        ///
-       std::string const & type() const { return type_; }
+       int docbook(odocstream & os, OutputParams const & runparams) const;
        ///
-       void setType(std::string const & type) { type_ = type; }
+       docstring xhtml(XHTMLStream & 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(TocList &, Buffer const &) 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:
-       ///
-       void computeFullLabel() const;
+       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 type_;
+       std::string floattype_;
        ///
-       docstring custom_label_;
+       bool is_subfloat_;
        ///
-       int counter_;
+       bool is_deleted_;
        ///
-       LyXTextClass const & textclass_;
+       std::string type_;
 };
 
 
-inline
-bool InsetCaption::display() const
-{
-       return true;
-}
-
-
-inline
-Inset::Code InsetCaption::lyxCode() const
-{
-       return CAPTION_CODE;
-}
-
-
 } // namespace lyx
 
 #endif