]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCommand.h
* src/paragraph_funcs.cpp (breakParagraph): change parameter 'flag' to
[lyx.git] / src / insets / InsetCommand.h
index aedc1fb3af8c13b60303e256bdd82b5b01be3ed2..bb4fcafeb02acd86bc9e2394a29019a160edf941 100644 (file)
@@ -31,14 +31,16 @@ namespace lyx {
  */
 
 ///
-class InsetCommand : public InsetOld {
+class InsetCommand : public Inset {
 public:
        ///
        InsetCommand(InsetCommandParams const &, std::string const & mailer_name);
        ///
        ~InsetCommand();
        ///
-       bool metrics(MetricsInfo &, Dimension &) const;
+       void metrics(MetricsInfo &, Dimension &) const;
+       ///
+       Dimension const dimension(BufferView const &) const { return button_.dimension(); }
        ///
        void draw(PainterInfo & pi, int x, int y) const;
        ///
@@ -54,7 +56,7 @@ public:
        ///
        int docbook(Buffer const &, odocstream &, OutputParams const & runparams) const;
        ///
-       InsetBase::Code lyxCode() const { return InsetBase::NO_CODE; }
+       Inset::Code lyxCode() const { return Inset::NO_CODE; }
 
        ///
        InsetCommandParams const & params() const { return p_; }
@@ -68,6 +70,8 @@ protected:
                p_.setContents(c);
        }
 public:
+       /// tell that the button label should be recomputed.
+       void refresh() { updateButtonLabel_ = true; }
        ///
        void setParam(std::string const & name, docstring const & value)
        {
@@ -79,6 +83,8 @@ public:
        {
                return p_[name];
        }
+       ///
+       void edit(Cursor & cur, bool left);
        /// FIXME remove
        virtual void replaceContents(std::string const & from, std::string const & to);
        ///
@@ -109,10 +115,13 @@ protected:
 private:
        ///
        InsetCommandParams p_;
+       ///
        std::string mailer_name_;
        /// changes color when mouse enters/leaves this inset
        bool mouse_hover_;
+       ///
        mutable bool updateButtonLabel_;
+       ///
        mutable RenderButton button_;
 };
 
@@ -122,7 +131,7 @@ public:
        ///
        InsetCommandMailer(std::string const & name, InsetCommand & inset);
        ///
-       virtual InsetBase & inset() const { return inset_; }
+       virtual Inset & inset() const { return inset_; }
        ///
        virtual std::string const & name() const { return name_; }
        ///