]> git.lyx.org Git - lyx.git/blobdiff - src/LyXAction.cpp
Implement sane UI for switching tristate toolbars (#6364)
[lyx.git] / src / LyXAction.cpp
index 55c90ca1b36041d3b7afc5ad5e8aab9c8b7b6b16..462e397d3a7c8d6fd0c4a5c81684a1cfe228162c 100644 (file)
@@ -763,6 +763,15 @@ void LyXAction::init()
  */
                { LFUN_BUFFER_RELOAD, "buffer-reload", ReadOnly, Buffer },
 
+/*!
+ * \var lyx::FuncCode lyx::LFUN_BUFFER_RESET_EXPORT
+ * \li Action: Removes the auxiliary file before next export to assure export is done afresh.
+ * \li Syntax: buffer-reset-export
+ * \li Origin: spitz, 27 Dec 2019
+ * \endvar
+ */
+               { LFUN_BUFFER_RESET_EXPORT, "buffer-reset-export", ReadOnly, Buffer },
+
 /*!
  * \var lyx::FuncCode lyx::LFUN_BUFFER_SAVE_AS_DEFAULT
  * \li Action: Save the current document settings as default.
@@ -869,7 +878,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 },
@@ -1038,7 +1048,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
@@ -1229,6 +1239,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
@@ -1451,7 +1473,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
@@ -1900,6 +1922,19 @@ void LyXAction::init()
  */
                { LFUN_ICON_SIZE, "icon-size", NoBuffer, Buffer },
 
+
+/*!
+ * \var lyx::FuncCode lyx::LFUN_IF_RELATIVES
+ * \li Action: Helper function for master-related actions
+ * \li Notion: In a buffer, the function will be disabled if the buffer
+ *             has no master or children. It thus allows to enable
+ *             actions only in documents with master/children
+ * \li Syntax: ifrelatives <ACTION>
+ * \li Origin: spitz, 2 January 2020
+ * \endvar
+ */
+               { LFUN_IF_RELATIVES, "ifrelatives", Noop, Buffer },
+
 /*!
  * \var lyx::FuncCode lyx::LFUN_INDEX_INSERT
  * \li Action: Inserts Index entry.
@@ -2351,9 +2386,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 },
@@ -2364,9 +2399,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
  */
@@ -2564,6 +2599,26 @@ void LyXAction::init()
  * \endvar
  */
                { LFUN_MASTER_BUFFER_EXPORT, "master-buffer-export", ReadOnly, Buffer },
+               
+/*!
+ * \var lyx::FuncCode lyx::LFUN_MASTER_BUFFER_FORALL
+ * \li Action: Applies a command to a buffer and all it children, starting from the master.
+ * \li Syntax: master-buffer-forall <LFUN-COMMAND>
+ * \li Params: <LFUN-COMMAND>: The command to be applied to the buffers.
+ * \li Sample: Close all Notes in buffers: \n
+              master-buffer-forall inset-forall Note inset-toggle close \n
+              Toggle change tracking on buffers: \n
+              master-buffer-forall changes-track \n
+              Toggle read-only for buffers: \n
+              master-buffer-forall buffer-toggle-read-only \n
+              Show statistics for individual buffers: \n
+              master-buffer-forall statistics \n
+              Activate the branch named "Solutions" in buffers: \n
+              master-buffer-forall branch-activate Solutions \n
+ * \li Origin: spitz, 31 Dec 2019
+ * \endvar
+ */
+               { LFUN_MASTER_BUFFER_FORALL, "master-buffer-forall", ReadOnly | Argument, Buffer },
 
 /*!
  * \var lyx::FuncCode lyx::LFUN_MASTER_BUFFER_UPDATE
@@ -3625,10 +3680,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
  */
@@ -3919,6 +3975,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.
@@ -4177,6 +4246,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.
@@ -4423,9 +4504,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);
@@ -4469,13 +4550,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();
 }