9 #include "commandtags.h"
13 /// Command name - action
14 struct kb_func_table {
22 /** This class encapsulates LyX action and user command operations.
31 /** Returns an action tag from a string. Returns kb_action.
32 Include arguments in func_name ONLY if you
33 want to create new pseudo actions. */
34 int LookupFunc(char const *func_name);
36 /** Returns an action tag which name is the most similar to a string.
37 Don't include arguments, they would be ignored. */
38 int getApproxFunc(char const *func);
40 /** Returns an action name the most similar to a string.
41 Don't include arguments, they would be ignored. */
42 const char *getApproxFuncName(char const *func);
44 /// Returns a pseudo-action given an action and its argument.
45 int getPseudoAction(kb_action action, char const *arg);
47 /// Retrieves the real action and its argument.
48 int retrieveActionArg(int i, char const **arg);
50 /// Search for an existent pseudoaction, return -1 if it doesn't exist.
51 int searchActionArg(kb_action action, char const *arg);
53 /// Check if a value is a pseudo-action.
54 bool isPseudoAction(int);
56 /// Not sure if this function should be here
57 int bindKey(char const* seq, int action);
59 /// Return the name associated with command
60 char const *getActionName(int action) const;
62 /// Return one line help text associated with command
63 char const *helpText(kb_action action) const;
65 /// True if the command is Read Only (not allowed for RO buffers)
66 bool isFuncRO(kb_action action) const;
71 static kb_func_table const * lyx_func_table;
72 /// Number of commands
75 static kb_func_table *lyx_func_args;
76 /// Pseudoaction index
78 /// Last action index found
83 /* -------------------- Inlines ------------------ */
87 bool LyXAction::isPseudoAction(int a)
89 return (a >= (int)LFUN_LASTACTION);