]> git.lyx.org Git - lyx.git/blobdiff - src/LyXAction.cpp
Merge branch 'features/indexmacros'
[lyx.git] / src / LyXAction.cpp
index a9789ad29037467c94d4ea959fe06c618a77134b..742c6132063cf9b670248048726416136d0efcd0 100644 (file)
@@ -332,20 +332,6 @@ void LyXAction::init()
                { LFUN_BIBTEX_DATABASE_DEL, "bibtex-database-del", Noop, Edit },
 
 
-/*!
- * \var lyx::FuncCode lyx::LFUN_BIDI
- * \li Action: Helper function for bidirectional toolbar icons
- * \li Notion: In a text, the function is marked as `unknown' when the
-               current direction does not correspond to DIRECTION (ltr
-               or rtl). Otherwise the function behaves exactly as
-               ACTION. The result is that ACTION will be associated to
-               a different icon depending on text direction.
- * \li Syntax: bidi <DIRECTION> <ACTION>
- * \li Origin: JMarc, 21 July 2019
- * \endvar
- */
-               { LFUN_BIDI, "bidi", Noop, System },
-
 /*!
  * \var lyx::FuncCode lyx::LFUN_BOOKMARK_CLEAR
  * \li Action: Clears the list of saved bookmarks.
@@ -466,6 +452,15 @@ void LyXAction::init()
  */
                { LFUN_BRANCH_INSERT, "branch-insert", Noop, Edit },
 
+/*!
+ * \var lyx::FuncCode lyx::LFUN_BRANCH_SYNC_ALL
+ * \li Action: Open/close all insets of selected branch (depending on its activation status).
+ * \li Syntax: branch-sync-all
+ * \li Origin: sanda, 15 April 2022
+ * \endvar
+ */
+               { LFUN_BRANCH_SYNC_ALL, "branch-sync-all", AtPoint, Buffer },
+
 /*!
  * \var lyx::FuncCode lyx::LFUN_BRANCH_INVERT
  * \li Action: Toggles inversion status of branch inset.
@@ -656,7 +651,7 @@ void LyXAction::init()
                visible in any window.
  * \li Syntax: buffer-forall <LFUN-COMMAND>
  * \li Params: <LFUN-COMMAND>: The command to be applied to the buffers.
- * \li Sample: Close all Notes in buffers: \n
+ * \li Sample: Close all Notes in all buffers: \n
                buffer-forall inset-forall Note inset-toggle close \n
                Toggle change tracking on buffers: \n
                buffer-forall changes-track \n
@@ -848,8 +843,8 @@ void LyXAction::init()
                is able to detect such changes (e.g. ghostview for postscript).
  * \li Syntax: buffer-update [<FORMAT>]
  * \li Params: <FORMAT>: The format to display, where this is one of the
-                         formats defined (in the current GUI) in the
-                         Tools>Preferences>File Formats dialog.
+                         formats defined in the Tools>Preferences>File Formats dialog,
+                        use the "Short name" field.
                          If no format is given, the default format as
                          specified in the same dialog is used.
  * \li Origin: Dekel, 5 Aug 2000
@@ -892,7 +887,8 @@ void LyXAction::init()
  * \li Notion: Saves the current buffer to disk, using the filename that
                is already associated with the buffer, asking for one if
                none is yet assigned.
- * \li Syntax: buffer-write
+ * \li Syntax: buffer-write [force]
+ * \li Params: force: write even if buffer is clean.
  * \endvar
  */
                { LFUN_BUFFER_WRITE, "buffer-write", ReadOnly, Buffer },
@@ -1061,7 +1057,7 @@ void LyXAction::init()
  * \li Origin: Levon, 16 Oct 2002
  * \endvar
  */
-               { LFUN_CHANGES_MERGE, "changes-merge", Noop, Edit },
+               { LFUN_CHANGES_MERGE, "changes-merge", ReadOnly, Edit },
 
 /*!
  * \var lyx::FuncCode lyx::LFUN_CHANGES_OUTPUT
@@ -1252,6 +1248,18 @@ void LyXAction::init()
  * \endvar
  */
                { LFUN_CITATION_INSERT, "citation-insert", Noop, Edit },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_CITATION_OPEN
+ * \li Action: Opens the corresponding pdf/url for a given citation inset.
+ * \li Syntax: citation-open [EXTERNAL] TARGET
+ * \li Params: <TARGET>: URL (https:,file:) of the document. \n
+               <EXTERNAL>: Use external executable script for finding target \n
+              and launching viewer. In this case TARGET consists of author and year \n
+              and will be passed as an input argument to the script.
+ * \li Origin: Sanda, 16 Aug 2020
+ * \endvar
+ */
+               { LFUN_CITATION_OPEN, "citation-open", ReadOnly | NoUpdate | Argument, Edit },
 
 /*!
  * \var lyx::FuncCode lyx::LFUN_CLIPBOARD_PASTE
@@ -1474,7 +1482,7 @@ void LyXAction::init()
  * \li Action: Shows hidden dialog or creates new one for a given function/inset settings etc.
  * \li Syntax: dialog-show <NAME> [<DATA>]
  * \li Params: <NAME>: aboutlyx|bibitem|bibtex|box|branch|changes|character|citation|\n
-               compare|document|errorlist|ert|external|file|findreplace|findreplaceadv|float|\n
+               compare|counter|document|errorlist|ert|external|file|findreplace|findreplaceadv|float|\n
                graphics|href|include|index|index_print|info|label|line|listings|log|mathdelimiter|\n
                mathmatrix|mathspace|nomenclature|nomencl_print|note|paragraph|phantom|prefs|\n
                print|ref|sendto|space|spellchecker|symbols|tabular|tabularcreate|\n
@@ -1835,6 +1843,15 @@ void LyXAction::init()
  */
                { LFUN_FONT_CROSSOUT, "font-crossout", Noop, Layout },
 
+/*!
+ * \var lyx::FuncCode lyx::LFUN_FONT_NO_SPELLCHECK
+ * \li Action: Toggles nospellcheck status in the font (selection-wise).
+ * \li Syntax: font-nospellcheck
+ * \li Origin: spitz, 5 March 2021
+ * \endvar
+ */
+               { LFUN_FONT_NO_SPELLCHECK, "font-nospellcheck", Noop, Layout },
+
 /*!
  * \var lyx::FuncCode lyx::LFUN_FONT_TYPEWRITER
  * \li Action: Toggles the typewriter family font (selection-wise).
@@ -1901,6 +1918,16 @@ void LyXAction::init()
  */
                { LFUN_HELP_OPEN, "help-open", NoBuffer | Argument, Buffer },
 
+/*!
+ * \var lyx::FuncCode lyx::LFUN_LYXFILES_OPEN
+ * \li Action: Open lyxfiles (templates/examples). Create a view if he have none.
+ * \li Syntax: lyxfiles-open [<TYPE>]
+ * \li Params: <TYPE>: templates or examples. Default is templates.
+ * \li Origin: spitz, 10 Feb 2021
+ * \endvar
+ */
+               { LFUN_LYXFILES_OPEN, "lyxfiles-open", NoBuffer | Argument, Buffer },
+
 /*!
  * \var lyx::FuncCode lyx::LFUN_HREF_INSERT
  * \li Action: Inserts hyperlinks into the document (clickable in pdf output).
@@ -2145,8 +2172,10 @@ void LyXAction::init()
                yellow note insets.
  * \li Sample: Remove all index insets: \n
                    inset-forall Index char-delete-forward force \n
-               Close all Notes (also works for a particular branch, for example): \n
+               Close all Notes: \n
                    inset-forall Note inset-toggle close \n
+               Open all branch insets of branch "myBranch": \n
+                   inset-forall Branch:myBranch inset-toggle open \n
                Transform all yellow notes to comments \n
                    inset-forall Note:Note inset-modify note Note Comment \n
                Try to put LyX in an infinite loop if there is at least a Note: \n
@@ -2226,6 +2255,20 @@ void LyXAction::init()
  */
                { LFUN_INSET_SETTINGS, "inset-settings", ReadOnly | AtPoint, Edit },
 
+/*!
+ * \var lyx::FuncCode lyx::LFUN_INSET_SPLIT
+ * \li Action: Splits the current inset into two at current position.
+ * \li Syntax: inset-split [<INSET>]
+ * \li Params: <INSET>: this can be used to make sure the right kind of inset
+                       is dissolved. For example "split" entry in the charstyles
+                       sub-menu should only dissolve the charstyle inset, even if the
+                       cursor is inside several nested insets of different type.\n
+                       For values see #lyx::InsetLayout::lyxtype_ .
+ * \li Origin: spitz, 22 Dec 2020
+ * \endvar
+ */
+               { LFUN_INSET_SPLIT, "inset-split", AtPoint, Edit },
+
 /*!
  * \var lyx::FuncCode lyx::LFUN_INSET_TOGGLE
  * \li Action: Toggles the collapsible inset at cursor position,
@@ -2264,6 +2307,16 @@ void LyXAction::init()
  */
                { LFUN_IN_MATHMACROTEMPLATE, "in-mathmacrotemplate", Noop, Math },
 
+/*!
+ * \var lyx::FuncCode lyx::LFUN_INDEXMACRO_INSERT
+ * \li Action: Inserts special Index macros into the document.
+ * \li Syntax: indexmacro-insert <type>
+ * \li Params: <type>: see, seealso, subentry, sortkey.
+ * \li Origin: spitz, 20 Feb 2022
+ * \endvar
+ */
+               { LFUN_INDEXMACRO_INSERT, "indexmacro-insert", Noop, Edit },
+
 
 /*!
  * \var lyx::FuncCode lyx::LFUN_IPAMACRO_INSERT
@@ -2387,9 +2440,9 @@ void LyXAction::init()
 /*!
  * \var lyx::FuncCode lyx::LFUN_LAYOUT
  * \li Action: Sets the layout (that is, environment) for the current paragraph.
- * \li Syntax: layout <LAYOUT> [ignorenests]
+ * \li Syntax: layout <LAYOUT> [ignoreautonests]
  * \li Params: <LAYOUT>: the layout to use\n
-               ignorenests: If specified, nesting advices will be ignored.
+               ignoreautonests: If specified, nesting advices will be ignored.
  * \endvar
  */
                { LFUN_LAYOUT, "layout", Noop, Layout },
@@ -2400,9 +2453,9 @@ void LyXAction::init()
  * \li Notion: Contrary to `layout', this function resets the current
  *             (or selection) layout to the standard layout it already has the
  *             correct layout. Useful for toolbar icons.
- * \li Syntax: layout-toggle <LAYOUT> [ignorenests]
+ * \li Syntax: layout-toggle <LAYOUT> [ignoreautonests]
  * \li Params: <LAYOUT>: the layout to toggle\n
-               ignorenests: If specified, nesting advices will be ignored.
+               ignoreautonests: If specified, nesting advices will be ignored.
  * \li Origin: lasgouttes, 14 May 2018
  * \endvar
  */
@@ -3369,7 +3422,7 @@ void LyXAction::init()
 /*!
  * \var lyx::FuncCode lyx::LFUN_PRIMARY_SELECTION_PASTE
  * \li Action: Pastes the currently selected text.
- * \li Notion: Primary selection mechanism is linux-only thing.
+ * \li Notion: Primary selection mechanism is X11/Wayland-only thing.
  * \li Syntax: primary-selection-paste [<ARG>]
  * \li Params: <ARG>: "paragraph" will cause pasting as one paragraph, i.e. "Join lines".
  * \endvar
@@ -3460,7 +3513,7 @@ void LyXAction::init()
  * \var lyx::FuncCode lyx::LFUN_SEARCH_IGNORE
  * \li Action: Enables/disables searching for features in findadv
  * \li Syntax: search-ignore <type> <value>
- * \li Params: <type>: language|color|sectioning|font|series|shape|family|markup|underline|strike
+ * \li Params: <type>: language|color|sectioning|font|series|shape|family|markup|underline|strike|deleted|non-output-content\n
  * \li Params: <value>: true|false
  * \endvar
  */
@@ -3681,10 +3734,11 @@ void LyXAction::init()
 
 /*!
  * \var lyx::FuncCode lyx::LFUN_SET_COLOR
- * \li Action: Set the given LyX color to the color defined by the X11 name given.
+ * \li Action: Set the given LyX color to the color defined by the X11 name given,
+ *             and optionally a specific color for dark mode.
  * \li Notion: A new color entry is created if the color is unknown.
                Color names can be stored as a part of user settings.
- * \li Syntax: set-color <LYX_NAME> <X11_NAME>
+ * \li Syntax: set-color <LYX_NAME> <X11_NAME> [<X11_DARKNAME>]
  * \li Origin: SLior, 11 Jun 2000
  * \endvar
  */
@@ -3760,6 +3814,32 @@ void LyXAction::init()
  */
                { LFUN_SPELLING_ADD, "spelling-add", ReadOnly, Edit },
 
+/*!
+ * \var lyx::FuncCode lyx::LFUN_SPELLING_ADD_LOCAL
+ * \li Action: Add the word under the cursor to the document's local
+ *             spell checker dictionary.
+ *             The default for the language is retrieved from the cursor position.
+ * \li Syntax: spelling-add-local [<STRING>] [<LANG>]
+ * \li Params: <WORD>: word to add
+              <LANG>: language name (see file languages)
+ * \li Origin: spitz, 6 Mar 2021
+ * \endvar
+ */
+               { LFUN_SPELLING_ADD_LOCAL, "spelling-add-local", Noop, Edit },
+
+/*!
+ * \var lyx::FuncCode lyx::LFUN_SPELLING_REMOVE_LOCAL
+ * \li Action: Remove the word under the cursor from the document's local
+ *             spell checker dictionary.
+ *             The default for the language is retrieved from the cursor position.
+ * \li Syntax: spelling-remove-local [<STRING>] [<LANG>]
+ * \li Params: <WORD>: word to remove
+              <LANG>: language name (see file languages)
+ * \li Origin: spitz, 7 Mar 2021
+ * \endvar
+ */
+               { LFUN_SPELLING_REMOVE_LOCAL, "spelling-remove-local", Noop, Edit },
+
 /*!
  * \var lyx::FuncCode lyx::LFUN_SPELLING_CONTINUOUSLY
  * \li Action: Toggle continuous spell checking.
@@ -3825,17 +3905,17 @@ void LyXAction::init()
                        valign-top|valign-bottom|valign-middle|longtabular-align-left|\n
                        longtabular-align-center|longtabular-align-right|m-align-left|m-align-right|\n
                        m-align-center|m-valign-top|m-valign-bottom|m-valign-middle|multicolumn|\n
-                       reset-formal-default|set-all-lines|unset-all-lines|toggle-longtabular|\n
-                       set-longtabular|unset-longtabular|set-pwidth|\n
+                       reset-formal-default|set-all-lines|toggle-all-lines|unset-all-lines|\n
+                       toggle-longtabular|set-longtabular|unset-longtabular|set-pwidth|\n
                        set-mpwidth|set-rotate-tabular|unset-rotate-tabular|toggle-rotate-tabular|\n
                        set-rotate-cell|unset-rotate-cell|toggle-rotate-cell|set-usebox|set-lthead|\n
                        unset-lthead|set-ltfirsthead|unset-ltfirsthead|set-ltfoot|unset-ltfoot|\n
                        set-ltlastfoot|unset-ltlastfoot|set-ltnewpage|toggle-ltcaption|\n
                        set-special-column|set-special-multicolumn|set-special-multirow|\n
                        toggle-booktabs|set-booktabs|unset-booktabs|set-top-space|set-bottom-space|\n
-                       set-interline-space|set-border-lines|tabular-valign-top|\n
-                       tabular-valign-middle|tabular-valign-bottom|set-tabular-width|\n
-                       toggle-varwidth-column
+                       set-interline-space|tabular-valign-top|tabular-valign-middle|\n
+                       tabular-valign-bottom|set-tabular-width|toggle-varwidth-column|\n
+                       set-border-lines|toggle-border-lines|set-inner-lines|toggle-inner-lines
                Various math-environment features are handled as well, e.g. add-vline-left/right for\n
                the Grid/Array environment.\n
                <ARG>: additional argument for some commands, use debug mode to explore its values.
@@ -3975,6 +4055,19 @@ void LyXAction::init()
 */
                { LFUN_TOOLBAR_MOVABLE, "toolbar-movable", NoBuffer, Buffer },
 
+/*!
+ * \var lyx::FuncCode lyx::LFUN_TOOLBAR_SET
+ * \li Action: Sets visibility of a given toolbar to on, off, or auto.
+ * \li Notion: Skipping "auto" when allowauto is false.
+ * \li Syntax: toolbar-set <NAME> [on|off|auto]
+ * \li Params: <NAME>: standard|extra|table|math|mathmacrotemplate|\n
+                      minibuffer|review|view/update|math_panels|vcs|
+                      view-others|update-others
+ * \li Origin: spitz, 17 Dec 2020
+ * \endvar
+ */
+               { LFUN_TOOLBAR_SET, "toolbar-set", NoBuffer, Buffer },
+
 /*!
  * \var lyx::FuncCode lyx::LFUN_TOOLBAR_TOGGLE
  * \li Action: Toggles visibility of a given toolbar between on/off/auto.
@@ -3992,13 +4085,20 @@ void LyXAction::init()
  * \var lyx::FuncCode lyx::LFUN_UI_TOGGLE
  * \li Action: Various UI visibility-toggling actions.
  * \li Syntax: ui-toggle <statusbar|menubar|scrollbar|frame|fullscreen>
- * \li Params: statusbar  : Toggle visibility of the statusbar.\n
-               menubar    : Toggle visibility of the menubar.\n
-               scrollbar  : Toggle visibility of the scrollbar.\n
-               frame      : Toggle visibility of the frames around editing window.\n
-               fullscreen : Toggle fullscreen mode. This also covers calling the
-                            previous functions. However #LFUN_TOOLBAR_TOGGLE for the
-                            custom tweaks of the toolbars should be used.
+ * \li Params: statusbar     : Toggle visibility of the statusbar.\n
+               menubar       : Toggle visibility of the menubar.\n
+               scrollbar     : Toggle visibility of the scrollbar.\n
+               frame         : Toggle visibility of the frames around editing window.\n
+               zoomslider    : Toggle visibility of the zoom slider in statusbar.\n
+               zoomlevel     : Toggle visibility of the zoom level display in statusbar.\n
+               statistics-w  : Toggle visibility of the document word count in statusbar.\n
+               statistics-cb : Toggle visibility of the document character count (incl. blanks)
+                               in statusbar.\n
+               statistics-c  : Toggle visibility of the document character count (excl. blanks)
+                               in statusbar.\n
+               fullscreen    : Toggle fullscreen mode. This also covers calling the
+                               previous functions. However #LFUN_TOOLBAR_TOGGLE for the
+                               custom tweaks of the toolbars should be used.
  * \li Origin: sanda, 9 Feb 2007
  * \endvar
  */
@@ -4233,6 +4333,18 @@ void LyXAction::init()
  */
                { LFUN_WINDOW_NEW, "window-new", NoBuffer, Buffer },
 
+/*!
+ * \var lyx::FuncCode lyx::LFUN_WINDOW_RAISE
+ * \li Action: Raises the LyX window.
+ * \li Notion: Brings the LyX window to the front. Such behavior is allowed
+               on Windows only when no other application has focus.
+               This action is used when LyX is in single instance mode.
+ * \li Syntax: window-raise
+ * \li Origin: forenr, 21 Apr 2020
+ * \endvar
+ */
+               { LFUN_WINDOW_RAISE, "window-raise", ReadOnly | NoBuffer, Hidden },
+
 /*!
  * \var lyx::FuncCode lyx::LFUN_WORD_BACKWARD
  * \li Action: Moves the cursor to the logically previous beginning of a word.
@@ -4297,6 +4409,17 @@ void LyXAction::init()
  */
                { LFUN_WORD_FIND, "word-find", ReadOnly, Edit },
 
+/*! 
+ * \var lyx::FuncCode lyx::LFUN_SEARCH_STRING_SET
+ * \li Action: Set search string buffer.
+ * \li Syntax: search-string-set [<DATA>] 
+ * \li Params: <DATA>: string to search for. If no parameter is given,
+ *                     use (word under) selection.
+ * \li Origin: stwitt, spitz, Feb 12 2021 
+ * \endvar 
+ */ 
+               { LFUN_SEARCH_STRING_SET, "search-string-set", ReadOnly, Edit }, 
+
 /*!
  * \var lyx::FuncCode lyx::LFUN_WORD_FINDADV
  * \li Action: Search for next occurrence of a pattern.
@@ -4479,9 +4602,9 @@ LyXAction::LyXAction()
 }
 
 
-FuncRequest LyXAction::lookupFunc(string const & func) const
+FuncRequest LyXAction::lookupFunc(string const & func_name) const
 {
-       string const func2 = trim(func);
+       string const func2 = trim(func_name);
 
        if (func2.empty())
                return FuncRequest(LFUN_NOACTION);
@@ -4525,13 +4648,13 @@ bool LyXAction::funcHasFlag(FuncCode action,
 }
 
 
-LyXAction::const_iterator LyXAction::func_begin() const
+LyXAction::const_iterator LyXAction::begin() const
 {
        return lyx_func_map.begin();
 }
 
 
-LyXAction::const_iterator LyXAction::func_end() const
+LyXAction::const_iterator LyXAction::end() const
 {
        return lyx_func_map.end();
 }