4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * Full author contact details are available in file CREDITS.
9 * To add a new function:
10 * - add a new enum constant and doc immediately before LFUN_LASTACTION
11 * - add an appropriate line in LyXAction.cpp
12 * - add a branch to a suitable ::doDispatch() method
13 * - add correct test to the corresponding ::getStatus() method
19 #include "support/strfwd.h"
24 /** These are all the lyx functions, the main mechanism
25 * through which the frontends communicate with the core.
27 * They are managed in LyXAction.cpp and handled in various
28 * ::dispatch() functions, starting with LyXFunc.C:dispatch(),
29 * BufferView::dispatch(), Cursor::dispatch() and
30 * Inset*::doDispatch();
33 /* LFUN documentation (a start at least, Chr 2007-08-12)
35 * The documentation below is primarily notes about restrictions and
36 * oddities relating to the different LFUNs.
38 * Doxygen template below. Some notes: Parameters should be set in uppercase
39 * and put in <BRACKETS>, as so.
52 LFUN_UNKNOWN_ACTION = -1,
57 * LFUN_SCREEN_RECENTER
58 * \li Action: Recenters the screen on the current cursor position
59 * \li Syntax: screen-recenter
64 * \li Action: Creates a new buffer (that is, document)
65 * \li Syntax: buffer-new
70 * \li Action: Saves the current buffer
71 * \li Notion: Saves the current buffer to disk, using the filename that
72 is already associated with the buffer, asking for one if
74 * \li Syntax: buffer-write
79 * LFUN_BUFFER_WRITE_AS
80 * \li Action: Rename and save current buffer.
81 * \li Syntax: buffer-write-as <FILENAME>
82 * \li Params: <FILENAME>: New name of the buffer/file. A relative path
83 * is with respect to the original location of the buffer/file.
89 * \li Action: Displays current buffer in chosen format
90 * \li Notion: Displays the contents of the current buffer in the chosen
91 format, for example, PDF or DVI. This runs the necessary
92 converter, calls the defined viewer, and so forth.
93 * \li Syntax: buffer-view <FORMAT>
94 * \li Params: <FORMAT>: The format to display, where this is one of the
95 formats defined (in the current GUI) in the
96 Tools>Preferences>File Formats dialog.
101 * \li Action: Closes the current buffer
102 * \li Notion: Closes the current buffer, asking whether to save it, etc,
103 if the buffer has been modified.
104 * \li Syntax: buffer-close
109 * \li Action: Terminates the current LyX instance
110 * \li Notion: Terminates the current LyX instance, asking whether to save
111 modified documents, etc.
112 * \li Syntax: lyx-quit
117 * LFUN_BUFFER_AUTO_SAVE
118 * \li Action: Saves the current buffer to a temporary file
119 * \li Notion: Saves the current buffer to a file named "#filename#". This LFUN
120 is called automatically by LyX, to "autosave" the current buffer.
121 * \li Syntax: buffer-auto-save
123 LFUN_BUFFER_AUTO_SAVE,
127 LFUN_PRIMARY_SELECTION_PASTE,
136 LFUN_FONT_FREE_APPLY,
137 LFUN_FONT_FREE_UPDATE,
162 LFUN_CHAR_FORWARD_SELECT,
163 LFUN_CHAR_BACKWARD_SELECT,
167 LFUN_SCREEN_UP_SELECT,
168 LFUN_SCREEN_DOWN_SELECT,
169 LFUN_LINE_BEGIN_SELECT,
171 LFUN_LINE_END_SELECT,
172 LFUN_WORD_FORWARD_SELECT,
173 LFUN_WORD_BACKWARD_SELECT,
175 LFUN_BUFFER_BEGIN_SELECT,
177 LFUN_BUFFER_END_SELECT,
178 LFUN_SPACE_INSERT, // JSpitzm 20030520
179 LFUN_SPECIALCHAR_INSERT, // JSpitzm, 20071206
182 * \li Action: Toggle between MARK_ON and MARK_OFF
183 * \li Syntax: mark-toggle
184 * \li Origin: poenitz, May 5 2006
187 LFUN_CHAR_DELETE_FORWARD,
189 LFUN_CHAR_DELETE_BACKWARD,
191 LFUN_LINE_BREAK, // uwestoehr 20071125
192 LFUN_BREAK_PARAGRAPH,
195 LFUN_ACCENT_CIRCUMFLEX,
197 LFUN_MATH_SUPERSCRIPT,
204 LFUN_ACCENT_UNDERBAR,
205 LFUN_ACCENT_UNDERDOT,
211 LFUN_ACCENT_SPECIAL_CARON,
213 LFUN_ACCENT_HUNGARIAN_UMLAUT,
222 LFUN_SERVER_CHAR_AFTER,
225 LFUN_SERVER_GET_LAYOUT,
226 LFUN_SERVER_GET_FONT,
227 LFUN_SERVER_GET_NAME,
229 LFUN_SERVER_GOTO_FILE_ROW,
232 LFUN_ENVIRONMENT_INSERT, // unused as of 20060905
235 LFUN_KEYMAP_SECONDARY,
241 LFUN_MATH_DELIM, // Alejandro 180696
243 LFUN_MATH_DISPLAY, // Alejandro 180696
244 LFUN_MATH_MODE, // Alejandro 040696
247 * \li Action: Enable numbering of the current formula.
248 * \li Notion: Must be in display formula mode.
249 * \li Syntax: math-number
250 * \li Origin: Alejandro 4 Jun 1996
255 * \li Action: Disable numbering of the current formula.
256 * \li Notion: Must be in display formula mode.
257 * \li Syntax: math-nonumber
258 * \li Origin: Alejandro 18 Jun 1996
261 LFUN_MATH_SIZE, // Alejandro 150896
263 LFUN_MATH_MACRO, // ale970510
264 LFUN_MATH_EXTERN, // Andre' 20010424
265 LFUN_MATH_MUTATE, // Andre' 20010523
266 LFUN_MATH_IMPORT_SELECTION, // Andre' 20010704
267 LFUN_MATH_SPACE, // Andre' 20010725
269 LFUN_WORD_DELETE_FORWARD,
270 LFUN_WORD_DELETE_BACKWARD,
274 * \li Action: Disable selecting of text-region.
275 * \li Syntax: mark-off
280 * \li Action: Enable selecting of text-region.
281 * \li Notion: After enabling you can simply move arrow keys to get selected region.
282 * \li Syntax: mark-on
288 * \li Action: Sets the layout for the current paragraph
289 * \li Syntax: layout <LAYOUT>
290 * \li Params: <LAYOUT>: the layout to use
294 * LFUN_LAYOUT_PARAGRAPH
295 * \li Action: Launches the paragraph settings dialog
296 * \li Syntax: layout-paragraph
298 LFUN_LAYOUT_PARAGRAPH,
300 * LFUN_DROP_LAYOUTS_CHOICE
301 * \li Action: Displays list of layout choices
302 * \li Notion: In the current (as of 2007) Qt4 frontend, this LFUN opens the
303 dropbox allowing for choice of layout
304 * \li Syntax: drop-layouts-choice
306 LFUN_DROP_LAYOUTS_CHOICE, // used in bindings as of 20071228
307 LFUN_FONT_TYPEWRITER, // changed from FONT_CODE 20070920
317 LFUN_WORD_CAPITALIZE,
319 LFUN_DEPTH_DECREMENT,
320 LFUN_DEPTH_INCREMENT,
322 LFUN_MENU_OPEN, // used in bindings as of 20060905
325 LFUN_COMMAND_EXECUTE,
328 LFUN_FILE_INSERT_PLAINTEXT, // CFO-G 1997-11-19
329 LFUN_FILE_INSERT_PLAINTEXT_PARA,// Levon 2001-02-14
330 LFUN_FILE_NEW, // for scripting purposes
332 LFUN_PARAGRAPH_UP, // Asger 1996-10-01
334 LFUN_PARAGRAPH_UP_SELECT, // Asger 1996-10-01
335 LFUN_PARAGRAPH_DOWN, // Asger 1996-10-01
336 LFUN_PARAGRAPH_DOWN_SELECT, // Asger 1996-10-01
337 LFUN_BREAK_PARAGRAPH_SKIP,
338 LFUN_DELETE_BACKWARD_SKIP,
340 LFUN_DELETE_FORWARD_SKIP,
341 LFUN_BUFFER_NEW_TEMPLATE, // Asger 1997-02-02
342 LFUN_BUFFER_RELOAD, // Asger 1997-02-02
343 LFUN_RECONFIGURE, // Asger 1997-02-14
344 LFUN_INDEX_PRINT, // Lgb 97-02-27
347 LFUN_BUFFER_CHILD_OPEN, // Ale 970528
348 LFUN_TOC_INSERT, // Lgb 97-05-27
349 LFUN_FLOAT_LIST, // Lgb 20010503
350 LFUN_BUFFER_TOGGLE_READ_ONLY, // Lgb 97-05-27
352 LFUN_VC_REGISTER, // Lgb 97-07-01
353 LFUN_VC_CHECK_IN, // Lgb 97-07-01
354 LFUN_VC_CHECK_OUT, // Lgb 97-07-01
355 LFUN_VC_REVERT, // Lgb 97-07-01
356 LFUN_VC_UNDO_LAST, // Lgb 97-07-01
358 LFUN_BUFFER_EXPORT, // Lgb 97-07-29
359 LFUN_LABEL_GOTO, // Ale 970806
360 LFUN_TOGGLE_CURSOR_FOLLOWS_SCROLLBAR, // ARRae 971202
361 LFUN_BUFFER_CHKTEX, // Asger 971030
362 LFUN_HYPERLINK_INSERT, // CFO-G 971121
364 LFUN_WORD_FIND_FORWARD, // Etienne 980216
365 LFUN_WORD_FIND_BACKWARD, // Etienne 980220
366 LFUN_APPENDIX, // ettrich 980505
367 LFUN_BUFFER_IMPORT, // Asger 980724
368 LFUN_COMMAND_SEQUENCE, // Andre' 991111
370 LFUN_PREFERENCES_SAVE, // Lgb 991127
371 LFUN_HELP_OPEN, // Jug 990627
372 LFUN_DATE_INSERT, // jdblair 20000131
373 LFUN_LANGUAGE, // Dekel 20000203
374 LFUN_ERT_INSERT, // Jug 20000218
376 LFUN_FOOTNOTE_INSERT, // Jug 20000307
377 LFUN_PARAGRAPH_SPACING, // Lgb 20000411
378 LFUN_TABULAR_INSERT, // Jug 20000412
379 LFUN_LOFVIEW, // Dekel 20000519
380 LFUN_LOTVIEW, // Dekel 20000519
382 LFUN_LOAVIEW, // Dekel 20000519
383 LFUN_SET_COLOR, // SLior 20000611
384 LFUN_MARGINALNOTE_INSERT, // Lgb 20000626
385 LFUN_FLOAT_INSERT, // Lgb 20000627
386 LFUN_FLOAT_WIDE_INSERT, // Lgb 20010531
388 LFUN_CAPTION_INSERT, // Lgb 20000718; inactive as of 20060905
390 LFUN_TABULAR_FEATURE, // Jug 20000728
391 LFUN_LAYOUT_TABULAR, // Jug 20000731
392 LFUN_BUFFER_UPDATE, // Dekel 20000805
394 LFUN_INDEX_INSERT, // Angus 20000803
395 LFUN_SCREEN_FONT_UPDATE, // ARRae 20000813
396 LFUN_PARAGRAPH_GOTO, // Dekel 20000826
397 LFUN_REFERENCE_NEXT, // Dekel 20010114
400 * \li Action: Save a bookmark
401 * \li Notion: Saves a numbered bookmark to the sessions file. The number
402 must be between 1 and 9, inclusive. Note that bookmarks are
403 saved per-session, not per file.
404 * \li Syntax: bookmark-save <NUMBER>
405 * \li Params: <NUMBER>: the number of the bookmark to save.
406 * \li Origin: Dekel, 27 January 2001
412 * \li Action: Goto a bookmark
413 * \li Notion: Moves the cursor to the numbered bookmark, opening the file
414 if necessary. Note that bookmarsk are saved per-session, not
416 * \li Syntax: bookmark-goto <NUMBER>
417 * \li Params: <NUMBER>: the number of the bookmark to restore.
418 * \li Origin: Dekel, 27 January 2001
421 LFUN_SELECT_FILE_SYNC, // Levon 20010214
422 LFUN_MESSAGE, // Lgb 20010408; for scripting purposes, output in minibuffer
423 LFUN_CHARS_TRANSPOSE, // Lgb 20010425
424 LFUN_ESCAPE, // Lgb 20010517
426 LFUN_THESAURUS_ENTRY, // Levon 20010720
427 LFUN_OPTIONAL_INSERT, // Martin 12 Aug 2002
428 LFUN_MOUSE_PRESS, // André 9 Aug 2002
429 LFUN_MOUSE_MOTION, // André 9 Aug 2002
430 LFUN_MOUSE_RELEASE, // André 9 Aug 2002
432 LFUN_MOUSE_DOUBLE, // André 9 Aug 2002
433 LFUN_MOUSE_TRIPLE, // André 9 Aug 2002
434 LFUN_WRAP_INSERT, // Dekel 7 Apr 2002
435 LFUN_CHANGES_TRACK, // Levon 20021001 (cool date !)
436 LFUN_CHANGES_MERGE, // Levon 20021016
438 LFUN_CHANGE_ACCEPT, // Levon 20021016
439 LFUN_CHANGE_REJECT, // Levon 20021016
440 LFUN_ALL_CHANGES_ACCEPT, // Levon 20021016
441 LFUN_ALL_CHANGES_REJECT, // Levon 20021016
442 LFUN_BIBITEM_INSERT, // André 14 Feb 2003
445 LFUN_DIALOG_SHOW_NEW_INSET,
448 LFUN_DIALOG_TOGGLE, // JSpitzm 20070430
450 LFUN_DIALOG_DISCONNECT_INSET,
454 LFUN_INSET_DIALOG_UPDATE,
458 * LFUN_PARAGRAPH_PARAMS_APPLY
459 * \li Action: Change paragraph settings.
460 * \li Notion: Overwrite all nonspecified settings to the default ones.
461 Use paragraph-params lfun if you don't want to overwrite others settings.
462 * \li Syntax: paragraph-params-apply <INDENT> <SPACING> <ALIGN> <OTHERS>
463 * \li Params: For parameters see LFUN_PARAGRAPH_PARAMS
464 * \li Origin: leeming, 30 Mar 2004
466 LFUN_PARAGRAPH_PARAMS_APPLY,
467 LFUN_PARAGRAPH_UPDATE,
473 LFUN_NEWPAGE_INSERT, // uwestoehr 20071124
474 LFUN_PAGEBREAK_INSERT,
483 LFUN_BUFFER_EXPORT_CUSTOM,
485 LFUN_NEXT_INSET_TOGGLE,
486 LFUN_ALL_INSETS_TOGGLE,
487 LFUN_BUFFER_LANGUAGE,
490 * LFUN_TEXTCLASS_APPLY
491 * \li Action: Sets the text class for the current buffer
492 * \li Syntax: textclass-apply <TEXTCLASS>
493 * \li Params: <TEXTCLASS>: the textclass to set. Note that this must be
494 the filename, minus the ".layout" extension.
496 LFUN_TEXTCLASS_APPLY,
498 * LFUN_TEXTCLASS_LOAD
499 * \li Action: Loads information for a textclass from disk
500 * \li Syntax: textclass-load <TEXTCLASS>
501 * \li Params: <TEXTCLASS>: the textclass to load. Note that this must be
502 the filename, minus the ".layout" extension.
505 LFUN_BUFFER_SAVE_AS_DEFAULT,
506 LFUN_BUFFER_PARAMS_APPLY,
512 LFUN_BUFFER_PREVIOUS,
515 LFUN_CHANGES_OUTPUT, // jspitzm 20050121
516 LFUN_BIBTEX_DATABASE_ADD,
517 LFUN_BIBTEX_DATABASE_DEL,
518 LFUN_CITATION_INSERT,
519 LFUN_OUTLINE_UP, // Vermeer 20060323
524 LFUN_PARAGRAPH_MOVE_DOWN, // Edwin 20060408
525 LFUN_PARAGRAPH_MOVE_UP, // Edwin 20060408
527 LFUN_BUFFER_TOGGLE_COMPRESSION, // bpeng 20060427
529 LFUN_CLIPBOARD_PASTE,
530 LFUN_INSET_DISSOLVE, // jspitzm 20060807
533 LFUN_WINDOW_NEW, // Abdel 20061021
534 LFUN_WINDOW_CLOSE, // Abdel 20061023
535 LFUN_UNICODE_INSERT, // Lgb 20061022
537 * LFUN_BOOKMARK_CLEAR
538 * \li Action: Clears the list of saved bookmarks
539 * \li Syntax: bookmark-clear
540 * \li Origin: bpeng, 31 October 2006
542 LFUN_BOOKMARK_CLEAR, // bpeng 20061031
543 LFUN_NOMENCL_INSERT, // Ugras
545 LFUN_NOMENCL_PRINT, // Ugras
546 LFUN_CLEARPAGE_INSERT, // Ugras 20061125
547 LFUN_CLEARDOUBLEPAGE_INSERT, // Ugras 20061125
548 LFUN_LISTING_INSERT, // Herbert 20011110, bpeng 20070502
549 LFUN_TOOLBAR_TOGGLE, // Edwin 20070521
551 LFUN_BUFFER_WRITE_ALL, // rgh, gpothier 200707XX
553 * LFUN_PARAGRAPH_PARAMS
554 * \li Action: Change paragraph settings
555 * \li Notion: Modifies the current paragraph, or currently selected paragraphs.
556 This function only modifies, and does not override, existing settings.
557 Note that the "leftindent" indent setting is deprecated.
558 * \li Syntax: paragraph-params <INDENT> <SPACING> <ALIGN> <OTHERS>
559 * \li Params: <INDENT>: \\noindent|\\indent|\\indent-toggle|\\leftindent LENGTH\n
560 <SPACING>: \\paragraph_spacing default|single|onehalf|double|other\n
561 <ALIGN>: \\align block|left|right|center|default\n
562 <OTHERS>: \\labelwidthstring WIDTH|\\start_of_appendix\n
563 * \li Origin: rgh, Aug 15 2007
565 LFUN_PARAGRAPH_PARAMS,
567 * LFUN_LAYOUT_MODULES_CLEAR
568 * \li Action: Clears the module list
569 * \li Notion: Clears the list of included modules for the current buffer.
570 * \li Syntax: layout-modules-clear
571 * \li Origin: rgh, 25 August 2007
573 LFUN_LAYOUT_MODULES_CLEAR,
575 * LFUN_LAYOUT_MODULE_ADD
576 * \li Action: Adds a module
577 * \li Notion: Adds a module to the list of included modules for the current buffer.
578 * \li Syntax: layout-module-add <MODULE>
579 * \li Params: <MODULE>: the module to be added
580 * \li Origin: rgh, 25 August 2007
582 LFUN_LAYOUT_MODULE_ADD,
585 * \li Action: Reloads layout information
586 * \li Notion: Reloads all layout information for the current buffer.
587 * \li Syntax: layout-reload
588 * \li Origin: rgh, 3 September 2007
592 LFUN_MASTER_BUFFER_VIEW, // Tommaso, 20070920
593 LFUN_MASTER_BUFFER_UPDATE, // Tommaso, 20070920
594 LFUN_INFO_INSERT, // bpeng, 20071007
595 LFUN_CALL, // broider, 20071002
596 LFUN_BUFFER_TOGGLE_EMBEDDING, // bpeng, 20071021
598 LFUN_CHAR_LEFT, // dov, 20071022
599 LFUN_CHAR_LEFT_SELECT, // dov, 20071022
600 LFUN_CHAR_RIGHT, // dov, 20071022
601 LFUN_CHAR_RIGHT_SELECT, // dov, 20071022
602 LFUN_FINISHED_BACKWARD, // dov, 20071022
604 LFUN_FINISHED_FORWARD, // dov, 20071022
605 LFUN_WORD_LEFT, // dov, 20071028
606 LFUN_WORD_LEFT_SELECT, // dov, 20071028
607 LFUN_WORD_RIGHT, // dov, 20071028
608 LFUN_WORD_RIGHT_SELECT, // dov, 20071028
610 LFUN_MATH_MACRO_FOLD,
611 LFUN_MATH_MACRO_UNFOLD,
612 LFUN_MATH_MACRO_ADD_PARAM,
613 LFUN_MATH_MACRO_REMOVE_PARAM,
614 LFUN_MATH_MACRO_APPEND_GREEDY_PARAM,
616 LFUN_MATH_MACRO_REMOVE_GREEDY_PARAM,
617 LFUN_MATH_MACRO_MAKE_OPTIONAL,
618 LFUN_MATH_MACRO_MAKE_NONOPTIONAL,
619 LFUN_MATH_MACRO_ADD_OPTIONAL_PARAM,
620 LFUN_MATH_MACRO_REMOVE_OPTIONAL_PARAM,
623 LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM,
624 LFUN_IN_MATHMACROTEMPLATE,
626 * \li Action: scroll the buffer view
627 * \li Notion: Only scrolls the screen up or down; does not move the cursor.
628 * \li Syntax: scroll <TYPE> <QUANTITY>
629 * \li Params: <TYPE>: line|page\n
630 <QUANTITY>: up|down|<number>\n
631 * \li Origin: Abdelrazak Younes, Dec 27 2007
634 LFUN_LASTACTION // end of the table