X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyXAction.cpp;h=278cbc6d10bd9dab56109783085072105fd0e2fd;hb=74037183fef9e524c26fd6785bd2a391c4dcc271;hp=ed9c551591e074e6f6e57a70d3f6db1c50bbcceb;hpb=eba82d32d74f12dc60b9536be8bc93cf62f17c36;p=lyx.git diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index ed9c551591..278cbc6d10 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -3,10 +3,11 @@ * 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 André Pönitz + * \author André Pönitz + * \author Pavel Sanda * * Full author contact details are available in file CREDITS. */ @@ -22,6 +23,8 @@ #include "support/lassert.h" +#include + using namespace std; using namespace lyx::support; @@ -44,15 +47,16 @@ namespace lyx { (May 19 1996, 12:04, RvdK) */ -/* LFUN documentation (a start at least, Chr 2007-08-12) +/* LFUN documentation * - * The documentation below is primarily notes about restrictions and - * oddities relating to the different LFUNs. + * The documentation below is primarily description of purpose and syntax + * relating to the different LFUNs. * - * Try to find an appropriate (thematical) place when adding the new LFUN. + * Try to find an appropriate (thematical) place when adding the new LFUN + * and don't forget to add doxygen commentary. * * Doxygen template below. Some notes: Parameters should be set in uppercase - * and put in , as so. + * and put in , [] means optional one. */ /*! @@ -196,7 +200,7 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_ACCENT_TIE * \li Action: Adds a tie \htmlonly (a͡)\endhtmlonly over the next two character typed. - * \li Notion: the following char will finish the tie. + * \li Notion: The following char will finish the tie. * \li Syntax: accent-tie * \endvar */ @@ -313,7 +317,7 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_OPTIONAL_INSERT * \li Action: Inserts an optional-argument (short title) inset. * \li Syntax: optional-insert - * \li Origin: Martin, 12 Aug 2002 + * \li Origin: vermeer, 12 Aug 2002 * \endvar */ { LFUN_OPTIONAL_INSERT, "optional-insert", Noop, Edit }, @@ -321,14 +325,14 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_LINE_INSERT * \li Action: Inserts a horizontal line. * \li Syntax: line-insert - * \li Origin: poenitz, Oct 27 2003 + * \li Origin: Andre, Oct 27 2003 * \endvar */ { LFUN_LINE_INSERT, "line-insert", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_NEWPAGE_INSERT * \li Action: Inserts a new page. - * \li Syntax: newpage-insert + * \li Syntax: newpage-insert * \li Params: : default: newpage * \li Origin: uwestoehr, 24 Nov 2007 * \endvar @@ -347,7 +351,8 @@ void LyXAction::init() * \li Action: Inserts a single unicode character. * \li Syntax: unicode-insert * \li Params: : The character to insert, given as its code - point, in hexadecimal, e.g.: unicode-insert 0x0100. + point, in hexadecimal. + * \li Sample: unicode-insert 0x0100 * \li Origin: Lgb, 22 Oct 2006 * \endvar */ @@ -360,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 }, @@ -377,7 +403,7 @@ void LyXAction::init() * \li Notion: Apart from lfun arguments you can use the following method: \n 1. input the type and argument of this inset, e.g. "menu paste", in the work area.\n - 2. select the text and run info-insert lfun.\n + 2. select the text and run info-insert lfun. * \li Syntax: info-insert * \li Params: : shortcut|lyxrc|package|textclass|menu|buffer \n : argument for a given type. Look into InsetInfo.h for detailed @@ -409,15 +435,19 @@ void LyXAction::init() * \li Action: Inserts CharStyle, Custom inset or XML short element. * \li Notion: Look into the Customization manual for more information about these elements.\n + To make this command enabled the layout file for the document + class you're using has to load the character styles. There are + a few contained in the Logical Markup module. You can also of + course create some yourself. \n For dissolving the element see #LFUN_INSET_DISSOLVE. * \li Syntax: flex-insert - * \li Params: TYPE: CharStyle|Custom|Element|Standard + * \li Params: TYPE: CharStyle|Custom|Element|Standard \n Identifies whether this is a Character Style, a Custom Inset or an XML Element, and which dynamical sub-menu this flex inset is in on the LyX menu tree. If Standard (currently unused): none of these. Name: This name must be defined either in your layout file - or imported by some module. The definition is\n + or imported by some module. The definition is \n InsetLayout * \li Sample: flex-insert CharStyle:Code * \endvar @@ -485,7 +515,7 @@ void LyXAction::init() * \li Action: Inserts Index entry. * \li Notion: It automatically takes the word on the cursor position. * \li Syntax: index-insert - * \li Origin: Angus, 3 Aug 2000 + * \li Origin: leeming, 3 Aug 2000 * \endvar */ { LFUN_INDEX_INSERT, "index-insert", Noop, Edit }, @@ -538,7 +568,7 @@ void LyXAction::init() to a different type (target) fot the current document. * \li Syntax: notes-mutate * \li Params: : Note|Comment|Greyedout - * \li Origin: ps, 18 Jun 2008 + * \li Origin: sanda, 18 Jun 2008 * \endvar */ { LFUN_NOTES_MUTATE, "notes-mutate", Argument, Edit }, @@ -627,7 +657,7 @@ void LyXAction::init() * \li Syntax: scroll * \li Params: : line|page\n : up|down| - * \li Origin: Abdelrazak Younes, Dec 27 2007 + * \li Origin: Abdel, Dec 27 2007 * \endvar */ { LFUN_SCROLL, "scroll", ReadOnly, Edit }, @@ -799,24 +829,34 @@ void LyXAction::init() * \li Params: : data encoded from Find dialog (see #lyx::find2string()). If no parameter is given, search with last find-dialog data is used for search (i.e. find-next). - * \li Origin: poenitz, Jan 7 2004 + * \li Origin: Andre, Jan 7 2004 * \endvar */ { 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 " \n \n " - * \li Origin: poenitz, Jan 7 2004 + * \li Origin: Andre, Jan 7 2004 * \endvar */ { 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. @@ -890,7 +930,7 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_WORD_SELECT * \li Action: Puts the word where the cursor stands into the selection. * \li Syntax: word-select - * \li Author: Andre, 11 Sep 2002 + * \li Origin: Andre, 11 Sep 2002 * \endvar */ { LFUN_WORD_SELECT, "word-select", ReadOnly, Edit }, @@ -921,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 */ @@ -1011,16 +1053,27 @@ void LyXAction::init() { LFUN_CUT, "cut", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_PASTE - * \li Action: Pastes from the active clipboard. - * \li Syntax: paste + * \li Action: Pastes material from the active clipboard. + * \li Syntax: paste [] + * \li Params: : pdf|png|jpeg|linkback * \endvar */ { LFUN_PASTE, "paste", Noop, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_CLIPBOARD_PASTE + * \li Action: Pastes text from the active clipboard. + * \li Syntax: clipboard-paste [] + * \li Params: : "paragraph" will cause pasting as one paragraph, i.e. "Join lines". + * \li Origin: baum, 10 Jul 2006 + * \endvar + */ { LFUN_CLIPBOARD_PASTE, "clipboard-paste", Noop, Edit }, /*! * \var lyx::FuncCode lyx::LFUN_PRIMARY_SELECTION_PASTE - * \li Action: Pastes the material currently selected. - * \li Syntax: primary-selection-paste + * \li Action: Pastes the currently text selected text. + * \li Notion: Primary selection mechanism is linux-only thing. + * \li Syntax: primary-selection-paste [] + * \li Params: : "paragraph" will cause pasting as one paragraph, i.e. "Join lines". * \endvar */ { LFUN_PRIMARY_SELECTION_PASTE, "primary-selection-paste", Noop, Edit }, @@ -1042,7 +1095,7 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_REPEAT * \li Action: Repeat the given command. * \li Syntax: repeat - * \li Author: poenitz, 27 Oct 2003 + * \li Origin: Andre, , 27 Oct 2003 * \endvar */ { LFUN_REPEAT, "repeat", NoBuffer, Edit }, @@ -1050,7 +1103,7 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_CHARS_TRANSPOSE * \li Action: Transposes the character at the cursor with the one before it. * \li Syntax: chars-transpose - * \li Author: Lgb, 25 Apr 2001 + * \li Origin: Lgb, 25 Apr 2001 * \endvar */ { LFUN_CHARS_TRANSPOSE, "chars-transpose", Noop, Edit }, @@ -1071,15 +1124,22 @@ void LyXAction::init() * \endvar */ { LFUN_DEPTH_INCREMENT, "depth-increment", Noop, Edit }, - { LFUN_ENVIRONMENT_INSERT, "environment-insert", Noop, Edit }, /*! * \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). @@ -1149,7 +1209,7 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_FONT_SIZE * \li Action: Sets font size according to lyx format string. * \li Syntax: font-size - * \li Params: : tiny|scriptsize|footnotesize|small|normal|large|larger| + * \li Params: : tiny|scriptsize|footnotesize|small|normal|large|larger|\n largest|huge|giant|increase|decrease|default * \endvar */ @@ -1194,9 +1254,35 @@ void LyXAction::init() */ { LFUN_FONT_STATE, "font-state", ReadOnly, Layout }, - { LFUN_BIBITEM_INSERT, "bibitem-insert", Noop, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_CITATION_INSERT + * \li Action: Inserts citation from loaded citation database. + * \li Syntax: citation-insert [[|]] + * \li Params: : Citation (shortcut listed in available citations). \n + : text which should appear before citation. + * \li Origin: AAS, 97-02-23 + * \endvar + */ { LFUN_CITATION_INSERT, "citation-insert", Noop, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_BIBTEX_DATABASE_ADD + * \li Action: Adds database, which will be used for bibtex citations. + * \li Notion: Databases are added to the first BibTeX inset + (Inset->List/TOC->BibTeX bibliography) found from the cursor postion. + * \li Syntax: bibtex-database-add + * \li Origin: Ale, 30 May 1997 + * \endvar + */ { LFUN_BIBTEX_DATABASE_ADD, "bibtex-database-add", Noop, Edit }, +/*! + * \var lyx::FuncCode lyx::LFUN_BIBTEX_DATABASE_DEL + * \li Action: Adds database, which will be used for bibtex citations. + * \li Notion: Databases are deleted from the first BibTeX inset + (Inset->List/TOC->BibTeX bibliography) found from the cursor postion. + * \li Syntax: bibtex-database-del + * \li Origin: Ale, 30 May 1997 + * \endvar + */ { LFUN_BIBTEX_DATABASE_DEL, "bibtex-database-del", Noop, Edit }, /*! @@ -1300,7 +1386,7 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_MARK_TOGGLE * \li Action: Toggle between #LFUN_MARK_ON and #LFUN_MARK_OFF . * \li Syntax: mark-toggle - * \li Origin: poenitz, May 5 2006 + * \li Origin: Andre, May 5 2006 * \endvar */ { LFUN_MARK_TOGGLE, "mark-toggle", ReadOnly, Edit }, @@ -1391,7 +1477,7 @@ void LyXAction::init() * \li Syntax: math-mutate * \li Params: : none|simple|equation|eqnarray|align|alignat|xalignat|xxalignat| multline|gather|flalign - * \li Origin: Andre', 23 May 2001 + * \li Origin: Andre, 23 May 2001 * \endvar */ { LFUN_MATH_MUTATE, "math-mutate", Noop, Math }, @@ -1403,7 +1489,7 @@ void LyXAction::init() * \li Params: : negative spaces: !|negmedspace|negthickspace \n positive spaces: ,|:|;|quad|qquad \n "," used by default. - * \li Origin: Andre', 25 Jul 2001; ps, 16 Jun 2008 + * \li Origin: Andre, 25 Jul 2001; sanda, 16 Jun 2008 * \endvar */ { LFUN_MATH_SPACE, "math-space", Noop, Math }, @@ -1457,7 +1543,7 @@ void LyXAction::init() * \li Params: : octave|maxima|maple|mathematica|script \n where "script" stands fot the external script (normalized expression will be passed) - * \li Origin: Andre', 24 Apr 2001 + * \li Origin: Andre, 24 Apr 2001 * \li Sample: math-extern maple simplify * \endvar */ @@ -1467,7 +1553,7 @@ void LyXAction::init() * \li Action: Changes arbitrarily the size used by math fonts inside a context. * \li Notion: Provides an interface to the LaTeX math mode font size commands. * \li Syntax: math-size