]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCaption.h
Cleanup mouse/selection/context-menu interactions.
[lyx.git] / src / insets / InsetCaption.h
index b2fbac5395f48b8060fbc564466331783eac4b79..f158e4a3577cdd435d416c0d0ce4e22e0fd16e31 100644 (file)
 
 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;
+private:
        ///
-       void write(Buffer const & buf, std::ostream & os) const;
+       void write(std::ostream & os) const;
        ///
-       void read(Buffer const & buf, Lexer & lex);
+       void read(Lexer & lex);
        ///
-       virtual DisplayType display() const;
+       DisplayType display() const { return AlignCenter; }
        ///
-       virtual bool neverIndent(Buffer const &) const { return true; }
+       bool neverIndent() const { return true; }
        ///
-       virtual InsetCode lyxCode() const;
+       InsetCode lyxCode() const { return CAPTION_CODE; }
        ///
-       virtual docstring const editMessage() const;
+       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(Buffer const &, ParIterator const &);
+       void updateLabels(ParIterator const &);
        ///
-       int latex(Buffer const & buf, odocstream & os,
-                 OutputParams const &) const;
+       int latex(odocstream & os, OutputParams const &) const;
        ///
-       int plaintext(Buffer const & buf, odocstream & os,
-                     OutputParams const & runparams) 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_; }
+       int plaintext(odocstream & os, OutputParams const & runparams) const;
        ///
-       void setType(std::string const & type) { type_ = type; }
+       int docbook(odocstream & os, OutputParams const & runparams) const;
        ///
        void setCustomLabel(docstring const & label);
        ///
-       void addToToc(TocList &, Buffer const &, ParConstIterator const &) const;
+       void addToToc(ParConstIterator const &) const;
+       /// 
+       virtual bool forceEmptyLayout(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 Inset * clone() const;
+       Inset * clone() const { return new InsetCaption(*this); }
+
        ///
        mutable docstring full_label_;
        ///
@@ -94,26 +84,12 @@ private:
        ///
        std::string type_;
        ///
-       docstring custom_label_;
+       bool in_subfloat_;
        ///
-       TextClass const & textclass_;
+       docstring custom_label_;
 };
 
 
-inline
-Inset::DisplayType InsetCaption::display() const
-{
-       return AlignCenter;
-}
-
-
-inline
-InsetCode InsetCaption::lyxCode() const
-{
-       return CAPTION_CODE;
-}
-
-
 } // namespace lyx
 
 #endif