X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyXAction.cpp;h=278cbc6d10bd9dab56109783085072105fd0e2fd;hb=74037183fef9e524c26fd6785bd2a391c4dcc271;hp=0ec7f824030f90908204e163fba14c9b17fed60d;hpb=5a4f93f4138be98f17f3b3c4e000842e04cce4dc;p=lyx.git diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index 0ec7f82403..278cbc6d10 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -3,10 +3,10 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author Lars Gullik Bjønnes + * \author Lars Gullik Bjønnes * \author Jean-Marc Lasgouttes * \author John Levon - * \author Andre Pönitz + * \author André Pönitz * \author Pavel Sanda * * Full author contact details are available in file CREDITS. @@ -23,6 +23,8 @@ #include "support/lassert.h" +#include + using namespace std; using namespace lyx::support; @@ -363,13 +365,34 @@ void LyXAction::init() * \endvar */ { LFUN_LISTING_INSERT, "listing-insert", Noop, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_TAB_INSERT + * \li Action: Insert a tab into a listings inset. + * \li Notion: It also works on a selection. + * \li Syntax: tab-insert + * \li Origin: vfvanravesteijn, Sep 30 2008 + * \endvar + */ + { LFUN_TAB_INSERT, "tab-insert", SingleParUpdate, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_TAB_DELETE + * \li Action: Delete a tab or up to an equivalent amount of spaces from + a listings inset. + * \li Notion: It also works on a selection - it removes a tab or spaces from the + beginning of each line spanned by the selection. This is useful if + you want to indent/unindent multiple lines in one action. + * \li Syntax: tab-delete + * \li Origin: vfvanravesteijn, Sep 30 2008 + * \endvar + */ + { LFUN_TAB_DELETE, "tab-delete", SingleParUpdate, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_QUOTE_INSERT * \li Action: Inserts quotes according to the type and quote-language preference. * \li Action: Currently English, Swedish, German, Polish, French, Danish quotes are distinguished. * \li Syntax: quote-insert [] - * \li Params: TYPE: 'single' for single quotes, otherwise double quotes will be used. + * \li Params: : 'single' for single quotes, otherwise double quotes will be used. * \endvar */ { LFUN_QUOTE_INSERT, "quote-insert", Noop, Edit }, @@ -811,7 +834,7 @@ void LyXAction::init() */ { LFUN_WORD_FIND, "word-find", ReadOnly, Edit }, /*! - * \var lyx::FuncCode lyx::LFUN_WORD_FIND + * \var lyx::FuncCode lyx::LFUN_WORD_REPLACE * \li Action: Replace a string in the document. * \li Syntax: word-replace [] * \li Params: : data is of the form @@ -823,7 +846,17 @@ void LyXAction::init() */ { LFUN_WORD_REPLACE, "word-replace", Noop, Edit }, /*! - * \var lyx::FuncCode lyx::LFUN_WORD_FORWARD + * \var lyx::FuncCode lyx::LFUN_WORD_FINDADV + * \li Action: Search for next occurence of a pattern. + * \li Syntax: word-findadv [] + * \li Params: : data encoded from FindAdv dialog (see #lyx::findadv2string()). + If no parameter is given, search with last find-dialog + data is used for search (i.e. find-next). + * \li Origin: Tommaso, Nov 15 2007 + * \endvar + */ + { LFUN_WORD_FINDADV, "word-findadv", ReadOnly, Edit }, +/*! \var lyx::FuncCode lyx::LFUN_WORD_FORWARD * \li Action: Moves the cursor to the logically next beginning of a word. * \li Notion: This is not the action which should be bound to the arrow keys, because forward may be left or right, depending on the language. @@ -928,7 +961,9 @@ void LyXAction::init() /*! * \var lyx::FuncCode lyx::LFUN_THESAURUS_ENTRY * \li Action: Look up thesaurus entries with respect to the word under the cursor. - * \li Syntax: thesaurus-entry + * \li Syntax: thesaurus-entry [] [lang=] + * \li Params: : word to look up + : language (see file languages) * \li Origin: Levon, 20 Jul 2001 * \endvar */ @@ -1092,11 +1127,19 @@ void LyXAction::init() /*! * \var lyx::FuncCode lyx::LFUN_FONT_BOLD - * \li Action: Toggles the bold font (selection-wise). + * \li Action: Toggles the bold font (selection-wise) using mathbf in math. * \li Syntax: font-bold * \endvar */ { LFUN_FONT_BOLD, "font-bold", Noop, Layout }, + +/*! + * \var lyx::FuncCode lyx::LFUN_FONT_BOLDSYMBOL + * \li Action: Toggles the bold font (selection-wise) using boldsymbol in math. + * \li Syntax: font-boldsymbol + * \endvar + */ + { LFUN_FONT_BOLDSYMBOL, "font-boldsymbol", Noop, Layout }, /*! * \var lyx::FuncCode lyx::LFUN_FONT_TYPEWRITER * \li Action: Toggles the typewriter family font (selection-wise). @@ -1819,7 +1862,7 @@ void LyXAction::init() * \li Origin: JSpitzm, 27 Apr 2006 * \endvar */ - { LFUN_INSET_EDIT, "inset-edit", Noop, Edit }, + { LFUN_INSET_EDIT, "inset-edit", ReadOnly, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_TABULAR_INSERT @@ -1882,7 +1925,8 @@ void LyXAction::init() * \li Action: Register the document as an file inside version control system (RCS, CVS). * \li Notion: File is registered inside cvs, svn or rcs repository acording to the existence of cvs/svn/rcs entries in the document's directory. \n - See LyX Extended Manual (Version Control Chapter) for additional information. + See LyX Additional Features Manual (Version Control Chapter) for additional + information. * \li Syntax: vc-register * \li Origin: Lgb, 1 Jul 1997 * \endvar @@ -2116,22 +2160,11 @@ void LyXAction::init() * \endvar */ { LFUN_ALL_INSETS_TOGGLE, "all-insets-toggle", ReadOnly, Edit }, -/*! - * \var lyx::FuncCode lyx::LFUN_GRAPHICS_GROUPS_UNIFY - * \li Action: Unify all graphics insets with the one given as an parameter. - * \li Notion: This is internally used for synchronize certain group of graphics insets. - * \li Syntax: graphics-groups-unigfy - * \li Params: : Parameters for graphics inset - (syntax can be seen in .lyx files). - * \li Origin: sanda, 6 May 2008 - * \endvar - */ - { LFUN_GRAPHICS_GROUPS_UNIFY, "graphics-groups-unify", Argument, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_SET_GRAPHICS_GROUP * \li Action: Set the group for the graphics inset on the cursor position. * \li Syntax: set-graphics-group [] - * \li Params: : Id for an existing group. In case tthe Id is an empty string, + * \li Params: : Id for an existing group. In case the Id is an empty string, the graphics inset is removed from the current group. * \li Origin: sanda, 6 May 2008 * \endvar @@ -2269,7 +2302,7 @@ void LyXAction::init() * \li Notion: Skiping "auto" when allowauto is false. * \li Syntax: toolbar-toggle [allowauto] * \li Params: : standard|extra|table|math|mathmacrotemplate| - minibuffer|review|view/update|math_panels + minibuffer|review|view/update|math_panels|vcs * \li Origin: Edwin, 21 May 2007 * \endvar */ @@ -2513,6 +2546,7 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_SERVER_NOTIFY * \li Action: Sends notify message about the last key-sequence to client. * \li Notion: This can be used to grab last key-sequence used inside the LyX window. + See also Debug extensions section in Additional features manual. * \li Syntax: server-notify * \endvar */ @@ -2898,7 +2932,7 @@ void LyXAction::init() /*! * \var lyx::FuncCode lyx::LFUN_COMMAND_PREFIX * \li Action: Return the current key sequence and available options as a string. - * \li Notion: No options are added if no curmap kb map exists. \n + * \li Notion: No options are added if no current map exists. \n This is probably usable only with connection to lyxserver. * \li Syntax: command-prefix * \endvar @@ -2914,6 +2948,18 @@ void LyXAction::init() * \endvar */ { LFUN_COMMAND_SEQUENCE, "command-sequence", NoBuffer, System }, +/*! + * \var lyx::FuncCode lyx::LFUN_COMMAND_ALTERNATIVES + * \li Action: Runs the first listed command that is enabled. + * \li Notion: This can be used to bind multiple functions to a single key, + and then which one is used will depend upon the context. + * \li Syntax: command-alternatives + * \li Params: : Sequence of commands separated by semicolons. + * \li Sample: command-alternatives completion-accept;cell-forward + * \li Origin: rgh, 24 September 2008 + * \endvar + */ + { LFUN_COMMAND_ALTERNATIVES, "command-alternatives", NoBuffer, System }, /*! * \var lyx::FuncCode lyx::LFUN_MESSAGE * \li Action: Shows message in statusbar (for script purposes). @@ -2997,11 +3043,30 @@ void LyXAction::init() /*! * \var lyx::FuncCode lyx::LFUN_COMPLETION_COMPLETE * \li Action: Try to complete the word or command at the cursor position. - * \li Syntax: completion-complete + * \li Syntax: complete * \li Origin: sts, Feb 19 2008 * \endvar */ { LFUN_COMPLETION_COMPLETE, "complete", SingleParUpdate, Edit }, + +/*! + * \var lyx::FuncCode lyx::LFUN_COMPLETION_CANCEL + * \li Action: Try to cancel completion, either the popup or the inline completion + * \li Syntax: completion-cancel + * \li Origin: sts, Sep 07 2008 + * \endvar + */ + { LFUN_COMPLETION_CANCEL, "completion-cancel", SingleParUpdate, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_COMPLETION_ACCEPT + * \li Action: Accept suggested completion. + * \li Syntax: completion-accept + * \li Origin: sanda, Sep 08 2008 + * \endvar + */ + { LFUN_COMPLETION_ACCEPT, "completion-accept", SingleParUpdate, Edit }, + + /*! * \var lyx::FuncCode lyx::LFUN_BRANCH_ACTIVATE * \li Action: Activate the branch @@ -3024,6 +3089,15 @@ void LyXAction::init() */ { LFUN_BRANCH_DEACTIVATE, "branch-deactivate", Argument, Buffer }, +/*! + * \var lyx::FuncCode lyx::LFUN_COPY_LABEL_AS_REF + * \li Action: Copies the label at the cursor as a cross-reference to be pasted elsewhere. + * \li Syntax: copy-label-as-reference + * \li Origin: sts, 16 Nov 2008 + * \endvar + */ + { LFUN_COPY_LABEL_AS_REF, "copy-label-as-reference", ReadOnly | NoUpdate, Edit }, + { LFUN_NOACTION, "", Noop, Hidden } #ifndef DOXYGEN_SHOULD_SKIP_THIS }; @@ -3067,7 +3141,7 @@ string const LyXAction::getActionName(FuncCode action) const } -LyXAction::func_type const LyXAction::getActionType(FuncCode action) const +LyXAction::func_type LyXAction::getActionType(FuncCode action) const { info_map::const_iterator const it = lyx_info_map.find(action); return it != lyx_info_map.end() ? it->second.type : Hidden; @@ -3100,4 +3174,11 @@ LyXAction::const_func_iterator LyXAction::func_end() const } +LyXErr & operator<<(LyXErr & l, FuncCode code) +{ + if (l.enabled()) + l.stream() << lyxaction.getActionName(code); + return l; +} + } // namespace lyx