[EMAIL PROTECTED] wrote:
Author: rgheck
Date: Thu Oct 25 06:13:56 2007
New Revision: 21194

URL: http://www.lyx.org/trac/changeset/21194
Log:
Move the findInfo() and defaultCommand() routines out of InsetCommand and into its 
subclasses, so that the subclasses know what parameters they want, etc. Also, introduce 
an "isCompatibleCommand()" routine, so the subclasses can tell us which 
commands they are prepared to accept.



Modified: lyx-devel/trunk/src/insets/InsetCommand.h
URL: 
http://www.lyx.org/trac/file/lyx-devel/trunk/src/insets/InsetCommand.h?rev=21194
==============================================================================
--- lyx-devel/trunk/src/insets/InsetCommand.h (original)
+++ lyx-devel/trunk/src/insets/InsetCommand.h Thu Oct 25 06:13:56 2007
@@ -58,8 +58,7 @@
        InsetCommandParams const & params() const { return p_; }
        /// FIXME Remove
        docstring const getFirstNonOptParam() const { return 
p_.getFirstNonOptParam(); }
-public:
-       /// tell that the button label should be recomputed.
+       /// Whether the button label should be recomputed.
        void refresh() { updateButtonLabel_ = true; }
        ///
        void setParam(std::string const & name, docstring const & value)
@@ -78,6 +77,15 @@
        RenderButton & button() const { return button_; }
        ///
        bool setMouseHover(bool mouse_hover);
+       /// Return parameter information for command cmdName.
+       /// Not implemented here. Must be implemented in derived class.

So make it pure virtual:

vitual CommandInfo const * findInfo(std::string const & cmdName) = 0;

+       static CommandInfo const * findInfo(std::string const & cmdName);
+       /// Return default command for this inset.
+       /// Not implemented here. Must be implemented in derived class.
+       static std::string defaultCommand();
+       /// Whether this is a command this inset can represent.
+       /// Not implemented here. Must be implemented in derived class.
+       static bool isCompatibleCommand(std::string const & cmd);

ditto.

Abdel.

Reply via email to