]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCommandParams.h
pimpl not needed here
[lyx.git] / src / insets / InsetCommandParams.h
index 3f010e3b3d0fe4ff77477e5a1913d940ef55c542..5e043a4e57395ec69a77a75b4755309b32446cb7 100644 (file)
@@ -6,6 +6,7 @@
  *
  * \author Angus Leeming
  * \author Georg Baum
+ * \author Richard Heck
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -17,6 +18,7 @@
 #include "support/docstring.h"
 
 #include <iosfwd>
+#include <string>
 #include <vector>
 
 
@@ -24,6 +26,18 @@ namespace lyx {
 
 class Lexer;
 
+// No parameter may be named "preview", because that is a required
+// flag for all commands.
+struct CommandInfo {
+       /// Number of parameters
+       size_t n;
+       /// Parameter names. paramnames[n] must be "".
+       char const * const * paramnames;
+       /// Tells whether a parameter is optional
+       bool const * optional;
+};
+
+
 class InsetCommandParams {
 public:
        /// Construct parameters for inset of type \p code.
@@ -65,14 +79,6 @@ public:
 
 private:
        ///
-       struct CommandInfo {
-               /// Number of parameters
-               size_t n;
-               /// Parameter names. paramnames[n] must be "".
-               char const * const * paramnames;
-               /// Tells whether a parameter is optional
-               bool const * optional;
-       };
        /// Get information for inset type \p code.
        /// Returns 0 if the inset is not known.
        static CommandInfo const * findInfo(InsetCode code);
@@ -83,6 +89,8 @@ private:
        static CommandInfo const * findInfo(InsetCode code,
                                            std::string const & cmdName);
        ///
+       static bool isCompatibleCommand(InsetCode code, std::string const & s);
+       ///
        std::string getDefaultCmd(InsetCode);
        /// Description of all command properties
        CommandInfo const * info_;