]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCaption.h
Make logic clearer, with help from Lars.
[lyx.git] / src / insets / InsetCaption.h
index a7d957c50808d9a6c02ec89f52ef8dd208a36cf2..9d1973fba67a65de18707ff25922fb1aba4af724 100644 (file)
@@ -13,7 +13,7 @@
 #define INSETCAPTION_H
 
 #include "InsetText.h"
-#include "LyXTextClass.h"
+#include "TextClass.h"
 
 
 namespace lyx {
@@ -23,6 +23,7 @@ namespace lyx {
 class InsetCaption : public InsetText {
 public:
        ///
+       InsetCaption(InsetCaption const &);
        InsetCaption(BufferParams const &);
        ///
        virtual ~InsetCaption() {}
@@ -31,11 +32,11 @@ public:
        ///
        void read(Buffer const & buf, Lexer & lex);
        ///
-       virtual bool display() const;
+       virtual DisplayType display() const;
        ///
        virtual bool neverIndent(Buffer const &) const { return true; }
        ///
-       virtual InsetBase::Code lyxCode() const;
+       virtual Inset::Code lyxCode() const;
        ///
        virtual docstring const editMessage() const;
        ///
@@ -52,9 +53,9 @@ public:
        ///
        virtual void edit(Cursor & cur, bool left);
        ///
-       virtual InsetBase * editXY(Cursor & cur, int x, int y);
+       virtual Inset * editXY(Cursor & cur, int x, int y);
        ///
-       bool insetAllowed(InsetBase::Code code) const;
+       bool insetAllowed(Inset::Code code) const;
        ///
        virtual bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
        ///
@@ -68,6 +69,12 @@ public:
        ///
        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;
        ///
        void setCount(int c) { counter_ = c; }
        ///
@@ -83,9 +90,9 @@ public:
 
 private:
        ///
-       void computeFullLabel() const;
+       void computeFullLabel(Buffer const & buf) const;
        ///
-       virtual std::auto_ptr<InsetBase> doClone() const;
+       virtual std::auto_ptr<Inset> doClone() const;
        ///
        mutable docstring full_label_;
        ///
@@ -97,19 +104,19 @@ private:
        ///
        int counter_;
        ///
-       LyXTextClass const & textclass_;
+       TextClass const & textclass_;
 };
 
 
 inline
-bool InsetCaption::display() const
+Inset::DisplayType InsetCaption::display() const
 {
-       return true;
+       return AlignCenter;
 }
 
 
 inline
-InsetBase::Code InsetCaption::lyxCode() const
+Inset::Code InsetCaption::lyxCode() const
 {
        return CAPTION_CODE;
 }