X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyXAction.h;h=734969d5aab828f224f45f2ce42c42c914e812fb;hb=98c966c64594611e469313314abd1e59524adb4a;hp=c48d599e226be5da25cf891ee0a0b315746c7b16;hpb=39eec46bd31753afaec103fcc45f9d6ba75bdb3e;p=lyx.git diff --git a/src/LyXAction.h b/src/LyXAction.h index c48d599e22..734969d5aa 100644 --- a/src/LyXAction.h +++ b/src/LyXAction.h @@ -51,43 +51,40 @@ public: Noop = 0, /// can be used in RO mode (perhaps this should change) ReadOnly = 1, // , - /// Can be used when there is no document open - NoBuffer = 2, + /// Can be used when there is no document open + NoBuffer = 2, //Interactive = 2, // Is interactive (requires a GUI) /// Argument = 4 // Requires argument //MathOnly = 8, // Only math mode //EtcEtc = ... // Or other attributes... }; - + /// LyXAction(); - - /** Returns an action tag from a string. Returns kb_action. - Include arguments in func_name ONLY if you - want to create new pseudo actions. */ - int LookupFunc(string const & func_name) const; - /** Returns an action tag which name is the most similar to a string. + /** Returns an pseudoaction from a string + If you include arguments in func_name, a new psedoaction will be + created if needed. */ + int LookupFunc(string const & func_name) const; + + /** Returns an action tag which name is the most similar to a string. Don't include arguments, they would be ignored. */ - int getApproxFunc(string const & func) const; + int getApproxFunc(string const & func) const; - /** Returns an action name the most similar to a string. + /** Returns an action name the most similar to a string. Don't include arguments, they would be ignored. */ - string const getApproxFuncName(string const & func) const; + string const getApproxFuncName(string const & func) const; /// Returns a pseudo-action given an action and its argument. int getPseudoAction(kb_action action, string const & arg) const; /// Retrieves the real action and its argument. kb_action retrieveActionArg(int i, string & arg) const; - + /// Search for an existent pseudoaction, return -1 if it doesn't exist. - kb_action searchActionArg(kb_action action, string const & arg) const; + int searchActionArg(kb_action action, string const & arg) const; - /// Check if a value is a pseudo-action. - bool isPseudoAction(int) const; - /// Return the name associated with command string const getActionName(int action) const; @@ -106,34 +103,24 @@ private: /// void newFunc(kb_action, string const & name, string const & helpText, unsigned int attrib); - + /** This is a list of all the LyXFunc names with the coresponding action number. It is usually only used by the minibuffer or when assigning commands to keys during init. */ func_map lyx_func_map; - + /** This is a mapping from action number to an object holding info about this action. f.ex. helptext, command name (string), command attributes (ro) */ info_map lyx_info_map; - + /** A mapping from the automatically created pseudo action number to the real action and its argument. */ mutable pseudo_map lyx_pseudo_map; - + /** A (multi) mapping from the lyx action to all the generated pseudofuncs and the arguments the action should use. */ mutable arg_map lyx_arg_map; }; - - -/* -------------------- Inlines ------------------ */ - - -inline -bool LyXAction::isPseudoAction(int a) const -{ - return a > int(LFUN_LASTACTION); -} - + #endif