]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetcommand.h
Final touch 'inset display()'; fix 'is a bit silly' bug
[lyx.git] / src / insets / insetcommand.h
index 8eb2bc268b6a6e65f61e34164ac76311fe2c8837..969f987da073b53f902ec245907b8b9b6acc5625 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "inset.h"
 #include "insetcommandparams.h"
-#include "renderers.h"
+#include "render_button.h"
 #include "mailinset.h"
 
 // Created by Alejandro 970222
@@ -43,7 +43,7 @@ public:
        virtual void read(Buffer const &, LyXLex & lex)
                { p_.read(lex); }
        /// Can remove one InsetBibKey is modified
-       void scanCommand(string const & c) { p_.scanCommand(c); };
+       void scanCommand(std::string const & c) { p_.scanCommand(c); };
        ///
        virtual int latex(Buffer const &, std::ostream &,
                          LatexRunParams const &) const;
@@ -55,62 +55,64 @@ public:
        virtual int docbook(Buffer const &, std::ostream &, bool) const;
        ///
        InsetOld::Code lyxCode() const { return InsetOld::NO_CODE; }
-
        ///
-       InsetCommandParams const & params() const { return p_; }
+       virtual bool display() const { return true; }
+       
        ///
-       virtual dispatch_result localDispatch(FuncRequest const & cmd);
+       InsetCommandParams const & params() const { return p_; }
        ///
-       string const & getContents() const { return p_.getContents(); }
+       std::string const & getContents() const { return p_.getContents(); }
        ///
-       void setContents(string const & c) { p_.setContents(c); }
+       void setContents(std::string const & c) { p_.setContents(c); }
        ///
-       string const & getOptions() const { return p_.getOptions(); }
+       std::string const & getOptions() const { return p_.getOptions(); }
        ///
-       ButtonRenderer & button() const { return button_; }
-       
+       RenderButton & button() const { return button_; }
+
 protected:
        ///
-       string const getCommand() const { return p_.getCommand(); }
+       virtual
+       dispatch_result
+       priv_dispatch(FuncRequest const & cmd, idx_type &, pos_type &);
        ///
-       string const & getCmdName() const { return p_.getCmdName(); }
+       std::string const getCommand() const { return p_.getCommand(); }
        ///
-       void setCmdName(string const & n) { p_.setCmdName(n); }
+       std::string const & getCmdName() const { return p_.getCmdName(); }
        ///
-       void setOptions(string const & o) { p_.setOptions(o); }
+       void setCmdName(std::string const & n) { p_.setCmdName(n); }
        ///
-       void setParams(InsetCommandParams const &);
+       void setOptions(std::string const & o) { p_.setOptions(o); }
        ///
-       virtual BufferView * view() const;
+       void setParams(InsetCommandParams const &);
        /// This should provide the text for the button
-       virtual string const getScreenLabel(Buffer const &) const = 0;
+       virtual std::string const getScreenLabel(Buffer const &) const = 0;
 
 private:
        ///
        InsetCommandParams p_;
        mutable bool set_label_;
-       mutable ButtonRenderer button_;
+       mutable RenderButton button_;
 };
 
 
 class InsetCommandMailer : public MailInset {
 public:
        ///
-       InsetCommandMailer(string const & name, InsetCommand & inset);
+       InsetCommandMailer(std::string const & name, InsetCommand & inset);
        ///
        virtual InsetBase & inset() const { return inset_; }
        ///
-       virtual string const & name() const { return name_; }
+       virtual std::string const & name() const { return name_; }
        ///
-       virtual string const inset2string(Buffer const &) const;
+       virtual std::string const inset2string(Buffer const &) const;
        ///
-       static void string2params(string const &, InsetCommandParams &);
+       static void string2params(std::string const &, InsetCommandParams &);
        ///
-       static string const params2string(string const & name,
+       static std::string const params2string(std::string const & name,
                                          InsetCommandParams const &);
 private:
        ///
-       string const name_;
+       std::string const name_;
        ///
        InsetCommand & inset_;
 };