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\n
72 is already associated with the buffer, asking for one if\n
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
245 LFUN_MATH_NUMBER, // Alejandro 040696
246 LFUN_MATH_NONUMBER, // Alejandro 180696
247 LFUN_MATH_SIZE, // Alejandro 150896
249 LFUN_MATH_MACRO, // ale970510
250 LFUN_MATH_EXTERN, // Andre' 20010424
251 LFUN_MATH_MUTATE, // Andre' 20010523
252 LFUN_MATH_IMPORT_SELECTION, // Andre' 20010704
253 LFUN_MATH_SPACE, // Andre' 20010725
255 LFUN_WORD_DELETE_FORWARD,
256 LFUN_WORD_DELETE_BACKWARD,
260 * \li Action: Disable selecting of text-region.
261 * \li Syntax: mark-off
266 * \li Action: Enable selecting of text-region.
267 * \li Notion: After enabling you can simply move arrow keys to get selected region.
268 * \li Syntax: mark-on
274 * \li Action: Sets the layout for the current paragraph
275 * \li Syntax: layout <LAYOUT>
276 * \li Params: <LAYOUT>: the layout to use
280 * LFUN_LAYOUT_PARAGRAPH
281 * \li Action: Launches the paragraph settings dialog
282 * \li Syntax: layout-paragraph
284 LFUN_LAYOUT_PARAGRAPH,
286 * LFUN_DROP_LAYOUTS_CHOICE
287 * \li Action: Displays list of layout choices
288 * \li Notion: In the current (as of 2007) Qt4 frontend, this LFUN opens the
289 dropbox allowing for choice of layout
290 * \li Syntax: drop-layouts-choice
292 LFUN_DROP_LAYOUTS_CHOICE, // used in bindings as of 20071228
293 LFUN_FONT_TYPEWRITER, // changed from FONT_CODE 20070920
303 LFUN_WORD_CAPITALIZE,
305 LFUN_DEPTH_DECREMENT,
306 LFUN_DEPTH_INCREMENT,
308 LFUN_MENU_OPEN, // used in bindings as of 20060905
311 LFUN_COMMAND_EXECUTE,
314 LFUN_FILE_INSERT_PLAINTEXT, // CFO-G 1997-11-19
315 LFUN_FILE_INSERT_PLAINTEXT_PARA,// Levon 2001-02-14
316 LFUN_FILE_NEW, // for scripting purposes
318 LFUN_PARAGRAPH_UP, // Asger 1996-10-01
320 LFUN_PARAGRAPH_UP_SELECT, // Asger 1996-10-01
321 LFUN_PARAGRAPH_DOWN, // Asger 1996-10-01
322 LFUN_PARAGRAPH_DOWN_SELECT, // Asger 1996-10-01
323 LFUN_BREAK_PARAGRAPH_SKIP,
324 LFUN_DELETE_BACKWARD_SKIP,
326 LFUN_DELETE_FORWARD_SKIP,
327 LFUN_BUFFER_NEW_TEMPLATE, // Asger 1997-02-02
328 LFUN_BUFFER_RELOAD, // Asger 1997-02-02
329 LFUN_RECONFIGURE, // Asger 1997-02-14
330 LFUN_INDEX_PRINT, // Lgb 97-02-27
333 LFUN_BUFFER_CHILD_OPEN, // Ale 970528
334 LFUN_TOC_INSERT, // Lgb 97-05-27
335 LFUN_FLOAT_LIST, // Lgb 20010503
336 LFUN_BUFFER_TOGGLE_READ_ONLY, // Lgb 97-05-27
338 LFUN_VC_REGISTER, // Lgb 97-07-01
339 LFUN_VC_CHECK_IN, // Lgb 97-07-01
340 LFUN_VC_CHECK_OUT, // Lgb 97-07-01
341 LFUN_VC_REVERT, // Lgb 97-07-01
342 LFUN_VC_UNDO_LAST, // Lgb 97-07-01
344 LFUN_BUFFER_EXPORT, // Lgb 97-07-29
345 LFUN_LABEL_GOTO, // Ale 970806
346 LFUN_TOGGLE_CURSOR_FOLLOWS_SCROLLBAR, // ARRae 971202
347 LFUN_BUFFER_CHKTEX, // Asger 971030
348 LFUN_HYPERLINK_INSERT, // CFO-G 971121
350 LFUN_WORD_FIND_FORWARD, // Etienne 980216
351 LFUN_WORD_FIND_BACKWARD, // Etienne 980220
352 LFUN_APPENDIX, // ettrich 980505
353 LFUN_BUFFER_IMPORT, // Asger 980724
354 LFUN_COMMAND_SEQUENCE, // Andre' 991111
356 LFUN_PREFERENCES_SAVE, // Lgb 991127
357 LFUN_HELP_OPEN, // Jug 990627
358 LFUN_DATE_INSERT, // jdblair 20000131
359 LFUN_LANGUAGE, // Dekel 20000203
360 LFUN_ERT_INSERT, // Jug 20000218
362 LFUN_FOOTNOTE_INSERT, // Jug 20000307
363 LFUN_PARAGRAPH_SPACING, // Lgb 20000411
364 LFUN_TABULAR_INSERT, // Jug 20000412
365 LFUN_LOFVIEW, // Dekel 20000519
366 LFUN_LOTVIEW, // Dekel 20000519
368 LFUN_LOAVIEW, // Dekel 20000519
369 LFUN_SET_COLOR, // SLior 20000611
370 LFUN_MARGINALNOTE_INSERT, // Lgb 20000626
371 LFUN_FLOAT_INSERT, // Lgb 20000627
372 LFUN_FLOAT_WIDE_INSERT, // Lgb 20010531
374 LFUN_CAPTION_INSERT, // Lgb 20000718; inactive as of 20060905
376 LFUN_TABULAR_FEATURE, // Jug 20000728
377 LFUN_LAYOUT_TABULAR, // Jug 20000731
378 LFUN_BUFFER_UPDATE, // Dekel 20000805
380 LFUN_INDEX_INSERT, // Angus 20000803
381 LFUN_SCREEN_FONT_UPDATE, // ARRae 20000813
382 LFUN_PARAGRAPH_GOTO, // Dekel 20000826
383 LFUN_REFERENCE_NEXT, // Dekel 20010114
386 * \li Action: Save a bookmark
387 * \li Notion: Saves a numbered bookmark to the sessions file. The number\n
388 must be between 1 and 9, inclusive. Note that bookmarks are\n
389 saved per-session, not per file.
390 * \li Syntax: bookmark-save <NUMBER>
391 * \li Params: <NUMBER>: the number of the bookmark to save.
392 * \li Origin: Dekel, 27 January 2001
398 * \li Action: Goto a bookmark
399 * \li Notion: Moves the cursor to the numbered bookmark, opening the file\n
400 if necessary. Note that bookmarsk are saved per-session, not\n
402 * \li Syntax: bookmark-goto <NUMBER>
403 * \li Params: <NUMBER>: the number of the bookmark to restore.
404 * \li Origin: Dekel, 27 January 2001
407 LFUN_SELECT_FILE_SYNC, // Levon 20010214
408 LFUN_MESSAGE, // Lgb 20010408; for scripting purposes, output in minibuffer
409 LFUN_CHARS_TRANSPOSE, // Lgb 20010425
410 LFUN_ESCAPE, // Lgb 20010517
412 LFUN_THESAURUS_ENTRY, // Levon 20010720
413 LFUN_OPTIONAL_INSERT, // Martin 12 Aug 2002
414 LFUN_MOUSE_PRESS, // André 9 Aug 2002
415 LFUN_MOUSE_MOTION, // André 9 Aug 2002
416 LFUN_MOUSE_RELEASE, // André 9 Aug 2002
418 LFUN_MOUSE_DOUBLE, // André 9 Aug 2002
419 LFUN_MOUSE_TRIPLE, // André 9 Aug 2002
420 LFUN_WRAP_INSERT, // Dekel 7 Apr 2002
421 LFUN_CHANGES_TRACK, // Levon 20021001 (cool date !)
422 LFUN_CHANGES_MERGE, // Levon 20021016
424 LFUN_CHANGE_ACCEPT, // Levon 20021016
425 LFUN_CHANGE_REJECT, // Levon 20021016
426 LFUN_ALL_CHANGES_ACCEPT, // Levon 20021016
427 LFUN_ALL_CHANGES_REJECT, // Levon 20021016
428 LFUN_BIBITEM_INSERT, // André 14 Feb 2003
431 LFUN_DIALOG_SHOW_NEW_INSET,
434 LFUN_DIALOG_TOGGLE, // JSpitzm 20070430
436 LFUN_DIALOG_DISCONNECT_INSET,
440 LFUN_INSET_DIALOG_UPDATE,
443 LFUN_PARAGRAPH_PARAMS_APPLY,
445 * LFUN_PARAGRAPH_PARAMS_APPLY
446 * \li Action: Change paragraph settings.
447 * \li Notion: Overwrite all nonspecified settings to the default ones.
448 Use paragraph-params lfun if you don't want to overwrite others settings.
449 * \li Syntax: paragraph-params-apply <INDENT> <SPACING> <ALIGN> <OTHERS>
450 * \li Params: For parameters see LFUN_PARAGRAPH_PARAMS
451 * \li Origin: leeming, 30 Mar 2004
453 LFUN_PARAGRAPH_UPDATE,
459 LFUN_NEWPAGE_INSERT, // uwestoehr 20071124
460 LFUN_PAGEBREAK_INSERT,
469 LFUN_BUFFER_EXPORT_CUSTOM,
471 LFUN_NEXT_INSET_TOGGLE,
472 LFUN_ALL_INSETS_TOGGLE,
473 LFUN_BUFFER_LANGUAGE,
476 * LFUN_TEXTCLASS_APPLY
477 * \li Action: Sets the text class for the current buffer
478 * \li Syntax: textclass-apply <TEXTCLASS>
479 * \li Params: <TEXTCLASS>: the textclass to set. Note that this must be \n
480 the filename, minus the ".layout" extension.
482 LFUN_TEXTCLASS_APPLY,
484 * LFUN_TEXTCLASS_LOAD
485 * \li Action: Loads information for a textclass from disk
486 * \li Syntax: textclass-load <TEXTCLASS>
487 * \li Params: <TEXTCLASS>: the textclass to load. Note that this must be \n
488 the filename, minus the ".layout" extension.
491 LFUN_BUFFER_SAVE_AS_DEFAULT,
492 LFUN_BUFFER_PARAMS_APPLY,
498 LFUN_BUFFER_PREVIOUS,
501 LFUN_CHANGES_OUTPUT, // jspitzm 20050121
502 LFUN_BIBTEX_DATABASE_ADD,
503 LFUN_BIBTEX_DATABASE_DEL,
504 LFUN_CITATION_INSERT,
505 LFUN_OUTLINE_UP, // Vermeer 20060323
510 LFUN_PARAGRAPH_MOVE_DOWN, // Edwin 20060408
511 LFUN_PARAGRAPH_MOVE_UP, // Edwin 20060408
513 LFUN_BUFFER_TOGGLE_COMPRESSION, // bpeng 20060427
515 LFUN_CLIPBOARD_PASTE,
516 LFUN_INSET_DISSOLVE, // jspitzm 20060807
519 LFUN_WINDOW_NEW, // Abdel 20061021
520 LFUN_WINDOW_CLOSE, // Abdel 20061023
521 LFUN_UNICODE_INSERT, // Lgb 20061022
523 * LFUN_BOOKMARK_CLEAR
524 * \li Action: Clears the list of saved bookmarks
525 * \li Syntax: bookmark-clear
526 * \li Origin: bpeng, 31 October 2006
528 LFUN_BOOKMARK_CLEAR, // bpeng 20061031
529 LFUN_NOMENCL_INSERT, // Ugras
531 LFUN_NOMENCL_PRINT, // Ugras
532 LFUN_CLEARPAGE_INSERT, // Ugras 20061125
533 LFUN_CLEARDOUBLEPAGE_INSERT, // Ugras 20061125
534 LFUN_LISTING_INSERT, // Herbert 20011110, bpeng 20070502
535 LFUN_TOOLBAR_TOGGLE, // Edwin 20070521
537 LFUN_BUFFER_WRITE_ALL, // rgh, gpothier 200707XX
538 LFUN_PARAGRAPH_PARAMS,
540 * LFUN_PARAGRAPH_PARAMS
541 * \li Action: Change paragraph settings
542 * \li Notion: Modifies the current paragraph, or currently selected paragraphs.
543 This function only modifies, and does not override, existing settings.
544 Note that the "leftindent" indent setting is deprecated.
545 * \li Syntax: paragraph-params <INDENT> <SPACING> <ALIGN> <OTHERS>
546 * \li Params: <INDENT>: \\noindent|\\indent|\\indent-toggle|\\leftindent LENGTH\n
547 <SPACING>: \\paragraph_spacing default|single|onehalf|double|other\n
548 <ALIGN>: \\align block|left|right|center|default\n
549 <OTHERS>: \\labelwidthstring WIDTH|\\start_of_appendix\n
550 * \li Origin: rgh, Aug 15 2007
553 * LFUN_LAYOUT_MODULES_CLEAR
554 * \li Action: Clears the module list
555 * \li Notion: Clears the list of included modules for the current buffer.
556 * \li Syntax: layout-modules-clear
557 * \li Origin: rgh, 25 August 2007
559 LFUN_LAYOUT_MODULES_CLEAR,
561 * LFUN_LAYOUT_MODULE_ADD
562 * \li Action: Adds a module
563 * \li Notion: Adds a module to the list of included modules for the current buffer.
564 * \li Syntax: layout-module-add <MODULE>
565 * \li Params: <MODULE>: the module to be added
566 * \li Origin: rgh, 25 August 2007
568 LFUN_LAYOUT_MODULE_ADD,
571 * \li Action: Reloads layout information
572 * \li Notion: Reloads all layout information for the current buffer.
573 * \li Syntax: layout-reload
574 * \li Origin: rgh, 3 September 2007
578 LFUN_MASTER_BUFFER_VIEW, // Tommaso, 20070920
579 LFUN_MASTER_BUFFER_UPDATE, // Tommaso, 20070920
580 LFUN_INFO_INSERT, // bpeng, 20071007
581 LFUN_CALL, // broider, 20071002
582 LFUN_BUFFER_TOGGLE_EMBEDDING, // bpeng, 20071021
584 LFUN_CHAR_LEFT, // dov, 20071022
585 LFUN_CHAR_LEFT_SELECT, // dov, 20071022
586 LFUN_CHAR_RIGHT, // dov, 20071022
587 LFUN_CHAR_RIGHT_SELECT, // dov, 20071022
588 LFUN_FINISHED_BACKWARD, // dov, 20071022
590 LFUN_FINISHED_FORWARD, // dov, 20071022
591 LFUN_WORD_LEFT, // dov, 20071028
592 LFUN_WORD_LEFT_SELECT, // dov, 20071028
593 LFUN_WORD_RIGHT, // dov, 20071028
594 LFUN_WORD_RIGHT_SELECT, // dov, 20071028
596 LFUN_MATH_MACRO_FOLD,
597 LFUN_MATH_MACRO_UNFOLD,
598 LFUN_MATH_MACRO_ADD_PARAM,
599 LFUN_MATH_MACRO_REMOVE_PARAM,
600 LFUN_MATH_MACRO_APPEND_GREEDY_PARAM,
602 LFUN_MATH_MACRO_REMOVE_GREEDY_PARAM,
603 LFUN_MATH_MACRO_MAKE_OPTIONAL,
604 LFUN_MATH_MACRO_MAKE_NONOPTIONAL,
605 LFUN_MATH_MACRO_ADD_OPTIONAL_PARAM,
606 LFUN_MATH_MACRO_REMOVE_OPTIONAL_PARAM,
609 LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM,
610 LFUN_IN_MATHMACROTEMPLATE,
612 * \li Action: scroll the buffer view
613 * \li Notion: Only scrolls the screen up or down; does not move the cursor.
614 * \li Syntax: scroll <TYPE> <QUANTITY>
615 * \li Params: <TYPE>: line|page\n
616 <QUANTITY>: up|down|<number>\n
617 * \li Origin: Abdelrazak Younes, Dec 27 2007
620 LFUN_LASTACTION // end of the table