3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
11 * Full author contact details are available in file CREDITS.
16 #include "LyXAction.h"
18 #include "support/debug.h"
19 #include "FuncRequest.h"
21 #include "support/lstrings.h"
23 #include <boost/assert.hpp>
26 using namespace lyx::support;
31 NAMING RULES FOR USER-COMMANDS
32 Here's the set of rules to apply when a new command name is introduced:
34 1) Use the object.event order. That is, use `word-forward'
35 instead of `forward-word'.
36 2) Don't introduce an alias for an already named object. Same for events.
37 3) Forward movement or focus is called `forward' (not `right').
38 4) Backward movement or focus is called `backward' (not `left').
39 5) Upward movement of focus is called `up'.
40 6) Downward movement is called `down'.
41 7) The begin of an object is called `begin' (not `start').
42 8) The end of an object is called `end'.
44 (May 19 1996, 12:04, RvdK)
47 /* LFUN documentation (a start at least, Chr 2007-08-12)
49 * The documentation below is primarily notes about restrictions and
50 * oddities relating to the different LFUNs.
52 * Try to find an appropriate (thematical) place when adding the new LFUN.
54 * Doxygen template below. Some notes: Parameters should be set in uppercase
55 * and put in <BRACKETS>, as so.
70 void LyXAction::newFunc(kb_action action, string const & name,
71 unsigned int attrib, LyXAction::func_type type)
73 lyx_func_map[name] = action;
76 tmpinfo.attrib = attrib;
78 lyx_info_map[action] = tmpinfo;
82 // Needed for LFUNs documentation to be accepted, since doxygen won't take
83 // \var inside functions.
84 #ifndef DOXYGEN_SHOULD_SKIP_THIS
85 void LyXAction::init()
87 // This function was changed to use the array below in initalization
88 // instead of calling newFunc numerous times because of compilation
89 // times. Since the array is not static we get back the memory it
90 // occupies after the init is completed. It compiles several
103 ev_item const items[] = {
106 * \li Action: adds an acute accent (á) to the next character typed
107 * \li Syntax: accent-acute
109 { LFUN_ACCENT_ACUTE, "accent-acute", Noop, Edit },
111 * \li Action: adds a breve accent to the next character typed
112 * \li Syntax: accent-breve
114 { LFUN_ACCENT_BREVE, "accent-breve", Noop, Edit },
116 * \li Action: adds a caron to the next character typed
117 * \li Syntax: accent-caron
119 { LFUN_ACCENT_CARON, "accent-caron", Noop, Edit },
121 * \li Action: adds a cedilla (ç) to the next character typed
122 * \li Syntax: accent-cedilla
124 { LFUN_ACCENT_CEDILLA, "accent-cedilla", Noop, Edit },
126 * \li Action: adds a circle accent (Å) to the next character typed
127 * \li Syntax: accent-circle
129 { LFUN_ACCENT_CIRCLE, "accent-circle", Noop, Edit },
131 * \li Action: adds a circumflex (â) to the next character typed
132 * \li Syntax: accent-circumflex
134 { LFUN_ACCENT_CIRCUMFLEX, "accent-circumflex", Noop, Edit },
136 * \li Action: adds a dot accent to the next character typed
137 * \li Syntax: accent-dot
139 { LFUN_ACCENT_DOT, "accent-dot", Noop, Edit },
141 * \li Action: adds a grave accent (à) to the next character typed
142 * \li Syntax: accent-grave
144 { LFUN_ACCENT_GRAVE, "accent-grave", Noop, Edit },
146 * \li Action: adds a Hungarian umlaut to the next character typed
147 * \li Syntax: accent-grave
149 { LFUN_ACCENT_HUNGARIAN_UMLAUT, "accent-hungarian-umlaut", Noop, Edit },
151 * \li Action: adds a macron to the next character typed
152 * \li Syntax: accent-macron
154 { LFUN_ACCENT_MACRON, "accent-macron", Noop, Edit },
156 * \li Action: adds an ogonek accent to the next character typed
157 * \li Syntax: accent-ogonek
159 { LFUN_ACCENT_OGONEK, "accent-ogonek", Noop, Edit },
160 { LFUN_ACCENT_SPECIAL_CARON, "accent-special-caron", Noop, Edit },
162 * \li Action: adds a tie over the next two character typed
163 * \li Syntax: accent-tie
165 { LFUN_ACCENT_TIE, "accent-tie", Noop, Edit },
167 * \li Action: adds a tilde (ñ) over the next character typed
168 * \li Syntax: accent-tilde
170 { LFUN_ACCENT_TILDE, "accent-tilde", Noop, Edit },
172 * \li Action: adds an umlaut (ö) over the next character typed
173 * \li Syntax: accent-umlaut
175 { LFUN_ACCENT_UMLAUT, "accent-umlaut", Noop, Edit },
177 * \li Action: adds a bar under the next character typed
178 * \li Syntax: accent-underbar
180 { LFUN_ACCENT_UNDERBAR, "accent-underbar", Noop, Edit },
182 * \li Action: adds a dot under the next character typed
183 * \li Syntax: accent-underdot
185 { LFUN_ACCENT_UNDERDOT, "accent-underdot", Noop, Edit },
188 * \li Action: Breaks the current paragraph at the current location
189 * \li Syntax: break-paragraph
191 { LFUN_BREAK_PARAGRAPH, "break-paragraph", Noop, Edit },
193 * \li Action: Breaks the current paragraph at the current location,
194 unless used at the beginning of a line, where it sets
195 the label width string to empty.
196 * \li Syntax: break-paragraph-skip
198 { LFUN_BREAK_PARAGRAPH_SKIP, "break-paragraph-skip", Noop, Edit },
200 * \li Action: Inserts a caption inset.
201 * \li Syntax: caption-insert
203 { LFUN_CAPTION_INSERT, "caption-insert", Noop, Edit },
205 * \li Action: Inserts the current date
206 * \li Syntax: date-insert <ARG>
207 * \li Param: <ARG>: Strangely, this is inserted verbatim, no matter
210 { LFUN_DATE_INSERT, "date-insert", Noop, Edit },
212 * \li Action: Inserts a footnote inset.
213 * \li Syntax: footnote-insert
215 { LFUN_FOOTNOTE_INSERT, "footnote-insert", Noop, Edit },
217 * \li Action: Inserts an ERT inset.
218 * \li Syntax: ert-insert
220 { LFUN_ERT_INSERT, "ert-insert", Noop, Edit },
221 { LFUN_FLOAT_INSERT, "float-insert", Noop, Edit },
222 { LFUN_FLOAT_WIDE_INSERT, "float-wide-insert", Noop, Edit },
223 { LFUN_WRAP_INSERT, "wrap-insert", Noop, Edit },
225 * \li Action: Inserts an hfill inset.
226 * \li Syntax: hfill-insert
228 { LFUN_HFILL_INSERT, "hfill-insert", Noop, Edit },
230 * \li Action: Inserts an optional-argument (short title) inset.
231 * \li Syntax: optional-insert
233 { LFUN_OPTIONAL_INSERT, "optional-insert", Noop, Edit },
235 * \li Action: Inserts a horizontal line.
236 * \li Syntax: line-insert
238 { LFUN_LINE_INSERT, "line-insert", Noop, Edit },
240 * \li Action: Inserts a new page.
241 * \li Syntax: newpage-insert
243 { LFUN_NEWPAGE_INSERT, "newpage-insert", Noop, Edit },
245 * \li Action: Inserts a pagebreak.
246 * \li Syntax: pagebreak-insert
248 { LFUN_PAGEBREAK_INSERT, "pagebreak-insert", Noop, Edit },
250 * \li Action: Inserts a marginal note.
251 * \li Syntax: marginalnote-insert
253 { LFUN_MARGINALNOTE_INSERT, "marginalnote-insert", Noop, Edit },
255 * \li Action: Inserts a single unicode character.
256 * \li Syntax: unicode-insert <CHAR>
257 * \li Params: <CHAR>: The character to insert, given as its code
258 point, in hexadecimal, e.g.: unicode-insert 0x0100.
260 { LFUN_UNICODE_INSERT, "unicode-insert", Noop, Edit },
262 * \li Action: Inserts a new listings inset.
263 * \li Syntax: listing-insert
265 { LFUN_LISTING_INSERT, "listing-insert", Noop, Edit },
266 { LFUN_QUOTE_INSERT, "quote-insert", Noop, Edit },
267 { LFUN_INFO_INSERT, "info-insert", Noop, Edit },
268 { LFUN_BRANCH_INSERT, "branch-insert", Noop, Edit },
269 { LFUN_BOX_INSERT, "box-insert", Noop, Edit },
270 { LFUN_FLEX_INSERT, "flex-insert", Noop, Edit },
271 { LFUN_SELF_INSERT, "self-insert", SingleParUpdate, Hidden },
272 { LFUN_SPACE_INSERT, "space-insert", Noop, Edit },
273 { LFUN_HYPERLINK_INSERT, "href-insert", Noop, Edit },
274 { LFUN_SPECIALCHAR_INSERT, "specialchar-insert", Noop, Edit },
275 { LFUN_CLEARPAGE_INSERT, "clearpage-insert", Noop, Edit },
276 { LFUN_CLEARDOUBLEPAGE_INSERT, "cleardoublepage-insert", Noop, Edit },
277 { LFUN_TOC_INSERT, "toc-insert", Noop, Edit },
278 { LFUN_APPENDIX, "appendix", Noop, Edit },
281 { LFUN_LIST_INSERT, "list-insert", Noop, Edit },
282 { LFUN_THEOREM_INSERT, "theorem-insert", Noop, Edit },
285 { LFUN_DELETE_BACKWARD_SKIP, "delete-backward-skip", Noop, Edit },
286 { LFUN_DELETE_FORWARD_SKIP, "delete-forward-skip", Noop, Edit },
287 { LFUN_DOWN, "down", ReadOnly | NoUpdate, Edit },
288 { LFUN_DOWN_SELECT, "down-select", ReadOnly | SingleParUpdate, Edit },
289 { LFUN_UP, "up", ReadOnly | NoUpdate, Edit },
290 { LFUN_UP_SELECT, "up-select", ReadOnly | SingleParUpdate, Edit },
291 { LFUN_SCREEN_DOWN, "screen-down", ReadOnly, Edit },
292 { LFUN_SCREEN_DOWN_SELECT, "screen-down-select", ReadOnly, Edit },
294 * \var lyx::kb_action lyx::LFUN_SCROLL
295 * \li Action: scroll the buffer view
296 * \li Notion: Only scrolls the screen up or down; does not move the cursor.
297 * \li Syntax: scroll <TYPE> <QUANTITY>
298 * \li Params: <TYPE>: line|page\n
299 <QUANTITY>: up|down|<number>\n
300 * \li Origin: Abdelrazak Younes, Dec 27 2007
302 { LFUN_SCROLL, "scroll", ReadOnly, Edit },
304 * \var lyx::kb_action lyx::LFUN_SCREEN_RECENTER
305 * \li Action: Recenters the screen on the current cursor position
306 * \li Syntax: screen-recenter
308 { LFUN_SCREEN_RECENTER, "screen-recenter", ReadOnly, Edit },
309 { LFUN_SCREEN_UP, "screen-up", ReadOnly, Edit },
310 { LFUN_SCREEN_UP_SELECT, "screen-up-select", ReadOnly, Edit },
312 { LFUN_ERROR_NEXT, "error-next", ReadOnly, Edit },
313 { LFUN_CHAR_BACKWARD, "char-backward", ReadOnly | NoUpdate, Edit },
314 { LFUN_CHAR_BACKWARD_SELECT, "char-backward-select", ReadOnly | SingleParUpdate, Edit },
315 { LFUN_CHAR_DELETE_BACKWARD, "delete-backward", SingleParUpdate, Edit },
316 { LFUN_CHAR_DELETE_FORWARD, "delete-forward", SingleParUpdate, Edit },
317 { LFUN_CHAR_FORWARD, "char-forward", ReadOnly | NoUpdate, Edit },
318 { LFUN_CHAR_FORWARD_SELECT, "char-forward-select", ReadOnly | SingleParUpdate, Edit },
319 { LFUN_CHAR_LEFT, "char-left", ReadOnly | NoUpdate, Edit },
320 { LFUN_CHAR_LEFT_SELECT, "char-left-select", ReadOnly | SingleParUpdate, Edit },
321 { LFUN_CHAR_RIGHT, "char-right", ReadOnly | NoUpdate, Edit },
322 { LFUN_CHAR_RIGHT_SELECT, "char-right-select", ReadOnly | SingleParUpdate, Edit },
324 { LFUN_WORD_BACKWARD, "word-backward", ReadOnly | NoUpdate, Edit },
325 { LFUN_WORD_BACKWARD_SELECT, "word-backward-select", ReadOnly | SingleParUpdate, Edit },
326 { LFUN_WORD_CAPITALIZE, "word-capitalize", Noop, Edit },
327 { LFUN_WORD_DELETE_BACKWARD, "word-delete-backward", Noop, Edit },
328 { LFUN_WORD_DELETE_FORWARD, "word-delete-forward", Noop, Edit },
329 { LFUN_WORD_FIND_BACKWARD, "word-find-backward", ReadOnly, Edit },
330 { LFUN_WORD_FIND_FORWARD, "word-find-forward", ReadOnly, Edit },
331 { LFUN_WORD_FORWARD, "word-forward", ReadOnly | NoUpdate, Edit },
332 { LFUN_WORD_FORWARD_SELECT, "word-forward-select", ReadOnly | SingleParUpdate, Edit },
333 { LFUN_WORD_LEFT, "word-left", ReadOnly | NoUpdate, Edit },
334 { LFUN_WORD_LEFT_SELECT, "word-left-select", ReadOnly | SingleParUpdate, Edit },
335 { LFUN_WORD_LOWCASE, "word-lowcase", Noop, Edit },
336 { LFUN_WORD_RIGHT, "word-right", ReadOnly | NoUpdate, Edit },
337 { LFUN_WORD_RIGHT_SELECT, "word-right-select", ReadOnly | SingleParUpdate, Edit },
338 { LFUN_WORD_SELECT, "word-select", ReadOnly, Edit },
339 { LFUN_WORD_UPCASE, "word-upcase", Noop, Edit },
340 { LFUN_WORD_FIND, "word-find", ReadOnly, Edit },
341 { LFUN_WORD_REPLACE, "word-replace", Noop, Edit },
343 * \var lyx::kb_action lyx::LFUN_THESAURUS_ENTRY
344 * \li Action: Look up thesaurus entries with respect to the word under the cursor.
345 * \li Syntax: thesaurus-entry
346 * \li Origin: Levon, 20 Jul 2001
348 { LFUN_THESAURUS_ENTRY, "thesaurus-entry", ReadOnly, Edit },
349 { LFUN_BUFFER_BEGIN, "buffer-begin", ReadOnly, Edit },
350 { LFUN_BUFFER_BEGIN_SELECT, "buffer-begin-select", ReadOnly, Edit },
351 { LFUN_BUFFER_END, "buffer-end", ReadOnly, Edit },
352 { LFUN_BUFFER_END_SELECT, "buffer-end-select", ReadOnly, Edit },
354 { LFUN_LINE_BEGIN, "line-begin", ReadOnly | NoUpdate, Edit },
355 { LFUN_LINE_BEGIN_SELECT, "line-begin-select", ReadOnly | SingleParUpdate, Edit },
356 { LFUN_LINE_BREAK, "line-break", Noop, Edit },
357 { LFUN_LINE_DELETE, "line-delete-forward", Noop, Edit }, // there is no line-delete-backward
358 { LFUN_LINE_END, "line-end", ReadOnly | NoUpdate, Edit },
359 { LFUN_LINE_END_SELECT, "line-end-select", ReadOnly | SingleParUpdate, Edit },
360 { LFUN_NEW_LINE, "new-line", Noop, Edit },
363 * \var lyx::kb_action lyx::LFUN_PARAGRAPH_MOVE_DOWN
364 * \li Action: Moves the current paragraph downwards in the document.
365 * \li Syntax: paragraph-move-down
366 * \li Origin: Edwin, 8 Apr 2006
368 { LFUN_PARAGRAPH_MOVE_DOWN, "paragraph-move-down", Noop, Edit },
370 * \var lyx::kb_action lyx::LFUN_PARAGRAPH_MOVE_UP
371 * \li Action: Moves the current paragraph upwards in the document.
372 * \li Syntax: paragraph-move-up
373 * \li Origin: Edwin, 8 Apr 2006
375 { LFUN_PARAGRAPH_MOVE_UP, "paragraph-move-up", Noop, Edit },
377 * \var lyx::kb_action lyx::LFUN_COPY
378 * \li Action: Copies to the clipboard the last edit
381 { LFUN_COPY, "copy", ReadOnly, Edit },
383 * \var lyx::kb_action lyx::LFUN_CUT
384 * \li Action: Cuts to the clipboard
387 { LFUN_CUT, "cut", Noop, Edit },
389 * \var lyx::kb_action lyx::LFUN_PASTE
390 * \li Action: Pastes from the active clipboard
393 { LFUN_PASTE, "paste", Noop, Edit },
394 { LFUN_CLIPBOARD_PASTE, "clipboard-paste", Noop, Edit },
396 * \var lyx::kb_action lyx::LFUN_PRIMARY_SELECTION_PASTE
397 * \li Action: Pastes the material currently selected
398 * \li Syntax: primary-selection-paste
400 { LFUN_PRIMARY_SELECTION_PASTE, "primary-selection-paste", Noop, Edit },
402 * \var lyx::kb_action lyx::LFUN_UNDO
403 * \li Action: Undoes the last edit
406 { LFUN_UNDO, "undo", Noop, Edit },
408 * \var lyx::kb_action lyx::LFUN_REDO
409 * \li Action: Redoes the last thing undone
412 { LFUN_REDO, "redo", Noop, Edit },
413 { LFUN_REPEAT, "repeat", NoBuffer, Edit },
414 { LFUN_CHARS_TRANSPOSE, "chars-transpose", Noop, Edit },
416 { LFUN_DEPTH_DECREMENT, "depth-decrement", Noop, Edit },
417 { LFUN_DEPTH_INCREMENT, "depth-increment", Noop, Edit },
418 { LFUN_ENVIRONMENT_INSERT, "environment-insert", Noop, Edit },
420 { LFUN_FONT_BOLD, "font-bold", Noop, Layout },
421 { LFUN_FONT_TYPEWRITER, "font-typewriter", Noop, Layout },
422 { LFUN_FONT_DEFAULT, "font-default", Noop, Layout },
423 { LFUN_FONT_EMPH, "font-emph", Noop, Layout },
424 { LFUN_FONT_FREE_APPLY, "font-free-apply", Noop, Layout },
425 { LFUN_FONT_FREE_UPDATE, "font-free-update", Noop, Layout },
426 { LFUN_FONT_NOUN, "font-noun", Noop, Layout },
427 { LFUN_FONT_ROMAN, "font-roman", Noop, Layout },
428 { LFUN_FONT_SANS, "font-sans", Noop, Layout },
429 { LFUN_FONT_FRAK, "font-frak", Noop, Layout },
430 { LFUN_FONT_ITAL, "font-ital", Noop, Layout },
431 { LFUN_FONT_SIZE, "font-size", Noop, Layout },
432 { LFUN_FONT_STATE, "font-state", ReadOnly, Layout },
433 { LFUN_FONT_UNDERLINE, "font-underline", Noop, Layout },
434 { LFUN_SCREEN_FONT_UPDATE, "screen-font-update", NoBuffer, Layout },
436 { LFUN_INDEX_INSERT, "index-insert", Noop, Edit },
437 { LFUN_INDEX_PRINT, "index-print", Noop, Edit },
439 { LFUN_NOMENCL_INSERT, "nomencl-insert", Noop, Edit },
440 { LFUN_NOMENCL_PRINT, "nomencl-print", Noop, Edit },
442 { LFUN_NOTE_INSERT, "note-insert", Noop, Edit },
443 { LFUN_NOTE_NEXT, "note-next", ReadOnly, Edit },
445 { LFUN_BIBITEM_INSERT, "bibitem-insert", Noop, Edit },
446 { LFUN_CITATION_INSERT, "citation-insert", Noop, Edit },
447 { LFUN_BIBTEX_DATABASE_ADD, "bibtex-database-add", Noop, Edit },
448 { LFUN_BIBTEX_DATABASE_DEL, "bibtex-database-del", Noop, Edit },
451 * \var lyx::kb_action lyx::LFUN_LAYOUT
452 * \li Action: Sets the layout (that is, environment) for the current paragraph
453 * \li Syntax: layout <LAYOUT>
454 * \li Params: <LAYOUT>: the layout to use
456 { LFUN_LAYOUT, "layout", Noop, Layout },
458 * \var lyx::kb_action lyx::LFUN_LAYOUT_PARAGRAPH
459 * \li Action: Launches the paragraph settings dialog
460 * \li Syntax: layout-paragraph
462 { LFUN_LAYOUT_PARAGRAPH, "layout-paragraph", ReadOnly, Layout },
463 { LFUN_LAYOUT_TABULAR, "layout-tabular", Noop, Layout },
465 * \var lyx::kb_action lyx::LFUN_DROP_LAYOUTS_CHOICE
466 * \li Action: Displays list of layout choices
467 * \li Notion: In the current (as of 2007) Qt4 frontend, this LFUN opens the
468 dropbox allowing for choice of layout
469 * \li Syntax: drop-layouts-choice
471 { LFUN_DROP_LAYOUTS_CHOICE, "drop-layouts-choice", ReadOnly, Layout },
473 * \var lyx::kb_action lyx::LFUN_LAYOUT_MODULES_CLEAR
474 * \li Action: Clears the module list
475 * \li Notion: Clears the list of included modules for the current buffer.
476 * \li Syntax: layout-modules-clear
477 * \li Origin: rgh, 25 August 2007
479 { LFUN_LAYOUT_MODULES_CLEAR, "layout-modules-clear", Noop, Layout },
481 * \var lyx::kb_action lyx::LFUN_LAYOUT_MODULE_ADD
482 * \li Action: Adds a module
483 * \li Notion: Adds a module to the list of included modules for the current buffer.
484 * \li Syntax: layout-module-add <MODULE>
485 * \li Params: <MODULE>: the module to be added
486 * \li Origin: rgh, 25 August 2007
488 { LFUN_LAYOUT_MODULE_ADD, "layout-module-add", Noop, Layout },
490 * \var lyx::kb_action lyx::LFUN_LAYOUT_RELOAD
491 * \li Action: Reloads layout information
492 * \li Notion: Reloads all layout information for the current buffer from disk, thus
493 recognizing any changes that have been made to layout files on the fly.
494 This is intended to be used only by layout developers and should not be
495 used when one is trying to do actual work.
496 * \li Syntax: layout-reload
497 * \li Origin: rgh, 3 September 2007
499 { LFUN_LAYOUT_RELOAD, "layout-reload", Noop, Layout },
501 * \var lyx::kb_action lyx::LFUN_TEXTCLASS_APPLY
502 * \li Action: Sets the text class for the current buffer
503 * \li Syntax: textclass-apply <TEXTCLASS>
504 * \li Params: <TEXTCLASS>: the textclass to set. Note that this must be
505 the filename, minus the ".layout" extension.
507 { LFUN_TEXTCLASS_APPLY, "textclass-apply", Noop, Layout },
509 * \var lyx::kb_action lyx::LFUN_TEXTCLASS_LOAD
510 * \li Action: Loads information for a textclass from disk
511 * \li Syntax: textclass-load <TEXTCLASS>
512 * \li Params: <TEXTCLASS>: the textclass to load. Note that this must be
513 the filename, minus the ".layout" extension.
515 { LFUN_TEXTCLASS_LOAD, "textclass-load", Noop, Layout },
518 * \var lyx::kb_action lyx::LFUN_MARK_OFF
519 * \li Action: Disable selecting of text-region.
520 * \li Syntax: mark-off
522 { LFUN_MARK_OFF, "mark-off", ReadOnly, Edit },
524 * \var lyx::kb_action lyx::LFUN_MARK_ON
525 * \li Action: Enable selecting of text-region.
526 * \li Notion: After enabling you can simply move arrow keys to get selected region.
527 * \li Syntax: mark-on
529 { LFUN_MARK_ON, "mark-on", ReadOnly, Edit },
531 * \var lyx::kb_action lyx::LFUN_MARK_TOGGLE
532 * \li Action: Toggle between MARK_ON and MARK_OFF
533 * \li Syntax: mark-toggle
534 * \li Origin: poenitz, May 5 2006
536 { LFUN_MARK_TOGGLE, "mark-toggle", ReadOnly, Edit },
538 { LFUN_MATH_DELIM, "math-delim", Noop, Math },
539 { LFUN_MATH_BIGDELIM, "math-bigdelim", Noop, Math },
540 { LFUN_MATH_DISPLAY, "math-display", Noop, Math },
541 { LFUN_MATH_INSERT, "math-insert", Noop, Math },
542 { LFUN_MATH_SUBSCRIPT, "math-subscript", Noop, Math },
543 { LFUN_MATH_SUPERSCRIPT, "math-superscript", Noop, Math },
544 { LFUN_MATH_LIMITS, "math-limits", Noop, Math },
545 { LFUN_MATH_MACRO, "math-macro", Noop, Math },
546 { LFUN_MATH_MUTATE, "math-mutate", Noop, Math },
547 { LFUN_MATH_SPACE, "math-space", Noop, Math },
548 { LFUN_MATH_IMPORT_SELECTION, "math-import-selection", Noop, Math },
549 { LFUN_MATH_MATRIX, "math-matrix", Noop, Math },
550 { LFUN_MATH_MODE, "math-mode", Noop, Math },
552 * \var lyx::kb_action lyx::LFUN_MATH_NUMBER_LINE_TOGGLE
553 * \li Action: Toggles numbering of the current formula line.
554 * \li Notion: Must be in display formula mode.
555 * \li Syntax: math-number-line-toggle
556 * \li Origin: Alejandro 18 Jun 1996
558 { LFUN_MATH_NUMBER_LINE_TOGGLE, "math-number-line-toggle", Noop, Math },
560 * \var lyx::kb_action lyx::LFUN_MATH_NUMBER_TOGGLE
561 * \li Action: Toggles numbering of the current formula.
562 * \li Notion: Must be in display formula mode.
563 * \li Syntax: math-number-toggle
564 * \li Origin: Alejandro 4 Jun 1996
566 { LFUN_MATH_NUMBER_TOGGLE, "math-number-toggle", Noop, Math },
567 { LFUN_MATH_EXTERN, "math-extern", Noop, Math },
568 { LFUN_MATH_SIZE, "math-size", Noop, Math },
570 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_UNFOLD
571 * \li Action: Unfold a Math Macro
572 * \li Notion: Unfold the Math Macro the cursor is in, i.e.
574 * \li Syntax: math-macro-unfold
575 * \li Origin: sts, 06 January 2008
577 { LFUN_MATH_MACRO_UNFOLD, "math-macro-unfold", ReadOnly | SingleParUpdate, Math },
579 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_FOLD
580 * \li Action: Fold a Math Macro
581 * \li Notion: Fold the Math Macro the cursor is in if it was
582 unfolded, i.e. displayed as \foo before.
583 * \li Syntax: math-macro-fold
584 * \li Origin: sts, 06 January 2008
586 { LFUN_MATH_MACRO_FOLD, "math-macro-fold", ReadOnly | SingleParUpdate, Math },
588 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_ADD_PARAM
589 * \li Action: Add a parameter
590 * \li Notion: Add a parameter to a Math Macro
591 * \li Params: <NUM>: The number of the parameter behind which the new one
592 will be added (1 for the first, i.e. use 0 for add a
593 parameter at the left), defaults to the last one.
594 * \li Syntax: math-macro-add-param <NUM>
595 * \li Origin: sts, 06 January 2008
597 { LFUN_MATH_MACRO_ADD_PARAM, "math-macro-add-param", Noop, Math },
599 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_REMOVE_PARAM
600 * \li Action: Remove the last parameter
601 * \li Notion: Remove the last parameter of a Math Macro and
602 remove its value in all instances of the macro
604 * \li Params: <NUM>: The number of the parameter to be deleted (1 for
605 the first), defaults to the last one.
606 * \li Syntax: math-macro-remove-param <NUM>
607 * \li Origin: sts, 06 January 2008
609 { LFUN_MATH_MACRO_REMOVE_PARAM, "math-macro-remove-param", Noop, Math },
611 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_APPEND_GREEDY_PARAM
612 * \li Action: Append a greedy parameter
613 * \li Notion: Append a greedy parameter to a Math Macro which
614 eats the following mathed cell in every instance of
615 the macro in the buffer.
616 * \li Syntax: math-macro-append-greedy-param
617 * \li Origin: sts, 06 January 2008
619 { LFUN_MATH_MACRO_APPEND_GREEDY_PARAM, "math-macro-append-greedy-param", Noop, Math },
621 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_REMOVE_GREEDY_PARAM
622 * \li Action: Remove a greedy parameter
623 * \li Notion: Remove a greedy parameter of a Math Macro and spit
624 out the values of it in every instance of the macro
625 in the buffer. If it is an optional parameter the [valud]
627 * \li Syntax: math-macro-remove-greedy-param
628 * \li Origin: sts, 06 January 2008
630 { LFUN_MATH_MACRO_REMOVE_GREEDY_PARAM, "math-macro-remove-greedy-param", Noop, Math },
632 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_MAKE_OPTIONAL
633 * \li Action: Make a parameter optional
634 * \li Notion: Turn the first non-optional parameter of a Math Macro
635 into an optional parameter with a default value.
636 * \li Syntax: math-macro-make-optional
637 * \li Origin: sts, 06 January 2008
639 { LFUN_MATH_MACRO_MAKE_OPTIONAL, "math-macro-make-optional", Noop, Math },
641 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_MAKE_NONOPTIONAL
642 * \li Action: Make a parameter non-optional
643 * \li Notion: Turn the last optional parameter of a Math Macro
644 into a non-optional parameter. The default value is
645 remembered to be reused later if the user changes his mind.
646 * \li Syntax: math-macro-make-nonoptional
647 * \li Origin: sts, 06 January 2008
649 { LFUN_MATH_MACRO_MAKE_NONOPTIONAL, "math-macro-make-nonoptional", Noop, Math },
651 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_ADD_OPTIONAL_PARAM
652 * \li Action: Add an optional parameter
653 * \li Notion: Insert an optional parameter just behind the
654 already existing optional parameters.
655 * \li Syntax: math-macro-add-optional-param
656 * \li Origin: sts, 06 January 2008
658 { LFUN_MATH_MACRO_ADD_OPTIONAL_PARAM, "math-macro-add-optional-param", Noop, Math },
660 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_REMOVE_OPTIONAL_PARAM
661 * \li Action: Remove the last optional parameter
662 * \li Notion: Remove the last optional parameter of a Math Macro and
663 remove it in all the instances of the macro in the buffer.
664 * \li Syntax: math-macro-remove-optional-param
665 * \li Origin: sts, 06 January 2008
667 { LFUN_MATH_MACRO_REMOVE_OPTIONAL_PARAM, "math-macro-remove-optional-param", Noop, Math },
669 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM
670 * \li Action: Add a greedy optional parameter
671 * \li Notion: Add a greedy optional parameter which eats the value
672 from the following cells in mathed which are in the [value]
674 * \li Syntax: math-macro-add-greedy-optional-param
675 * \li Origin: sts, 06 January 2008
677 { LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM, "math-macro-add-greedy-optional-param", Noop, Math },
679 * \var lyx::kb_action lyx::LFUN_IN_MATHMACROTEMPLATE
680 * \li Action: Only active in Math Macro definition
681 * \li Notion: Dummy function which is only active in a Math Macro definition.
682 It's used to toggle the Math Macro toolbar if the cursor moves
683 into a Math Macro definition.
684 * \li Syntax: in-mathmacrotemplate
685 * \li Origin: sts, 06 January 2008
687 { LFUN_IN_MATHMACROTEMPLATE, "in-mathmacrotemplate", Noop, Math },
689 { LFUN_PARAGRAPH_DOWN, "paragraph-down", ReadOnly | NoUpdate, Edit },
690 { LFUN_PARAGRAPH_DOWN_SELECT, "paragraph-down-select", ReadOnly, Edit },
691 { LFUN_PARAGRAPH_GOTO, "paragraph-goto", ReadOnly, Edit },
693 * \var lyx::kb_action lyx::LFUN_OUTLINE_UP
694 * \li Action: Move the current group in the upward direction in the
695 structure of the document.
696 * \li Notion: The "group" can be Part/Chapter/Section/etc. It moves
697 the whole substructure of the group.
698 * \li Syntax: outline-up
699 * \li Origin: Vermeer, 23 Mar 2006
701 { LFUN_OUTLINE_UP, "outline-up", Noop, Edit },
703 * \var lyx::kb_action lyx::LFUN_OUTLINE_DOWN
704 * \li Action: Move the current group in the downward direction in the
705 structure of the document.
706 * \li Notion: The "group" can be Part/Chapter/Section/etc. It moves
707 the whole substructure of the group.
708 * \li Syntax: outline-down
709 * \li Origin: Vermeer, 23 Mar 2006
711 { LFUN_OUTLINE_DOWN, "outline-down", Noop, Edit },
713 * \var lyx::kb_action lyx::LFUN_OUTLINE_IN
714 * \li Action: Moves the current group in the downward direction in the
715 hierarchy of the document structure.
716 * \li Notion: Part -> Chapter -> Section -> etc.
717 * \li Syntax: outline-in
718 * \li Origin: Vermeer, 23 Mar 2006
720 { LFUN_OUTLINE_IN, "outline-in", Noop, Edit },
722 * \var lyx::kb_action lyx::LFUN_OUTLINE_OUT
723 * \li Action: Moves the current group in the upward direction in the
724 hierarchy of the document structure.
725 * \li Notion: Part <- Chapter <- Section <- etc.
726 * \li Syntax: outline-out
727 * \li Origin: Vermeer, 23 Mar 2006
729 { LFUN_OUTLINE_OUT, "outline-out", Noop, Edit },
731 { LFUN_PARAGRAPH_SPACING, "paragraph-spacing", Noop, Edit },
732 { LFUN_PARAGRAPH_UP, "paragraph-up", ReadOnly | NoUpdate, Edit },
733 { LFUN_PARAGRAPH_UP_SELECT, "paragraph-up-select", ReadOnly, Edit },
735 { LFUN_EXTERNAL_EDIT, "external-edit", Noop, Edit },
736 { LFUN_GRAPHICS_EDIT, "graphics-edit", Noop, Edit },
738 { LFUN_CELL_BACKWARD, "cell-backward", Noop, Edit },
739 { LFUN_CELL_FORWARD, "cell-forward", Noop, Edit },
740 { LFUN_CELL_SPLIT, "cell-split", Noop, Edit },
741 { LFUN_TABULAR_INSERT, "tabular-insert", Noop, Edit },
742 { LFUN_TABULAR_FEATURE, "tabular-feature", Noop, Edit },
744 { LFUN_VC_CHECK_IN, "vc-check-in", ReadOnly, System },
745 { LFUN_VC_CHECK_OUT, "vc-check-out", ReadOnly, System },
746 { LFUN_VC_REGISTER, "vc-register", ReadOnly, System },
747 { LFUN_VC_REVERT, "vc-revert", ReadOnly, System },
748 { LFUN_VC_UNDO_LAST, "vc-undo-last", ReadOnly, System },
750 { LFUN_CHANGES_TRACK, "changes-track", Noop, Edit },
751 { LFUN_CHANGES_OUTPUT, "changes-output", Noop, Edit },
752 { LFUN_CHANGE_NEXT, "change-next", ReadOnly, Edit },
753 { LFUN_CHANGES_MERGE, "changes-merge", Noop, Edit },
754 { LFUN_CHANGE_ACCEPT, "change-accept", Noop, Edit },
755 { LFUN_CHANGE_REJECT, "change-reject", Noop, Edit },
756 { LFUN_ALL_CHANGES_ACCEPT, "all-changes-accept", Noop, Edit },
757 { LFUN_ALL_CHANGES_REJECT, "all-changes-reject", Noop, Edit },
759 { LFUN_INSET_APPLY, "inset-apply", Noop, Edit },
760 { LFUN_INSET_DISSOLVE, "inset-dissolve", Noop, Edit },
761 { LFUN_INSET_INSERT, "inset-insert", Noop, Edit },
762 { LFUN_INSET_MODIFY, "", Noop, Hidden },
763 { LFUN_INSET_DIALOG_UPDATE, "", Noop, Hidden },
764 { LFUN_INSET_SETTINGS, "inset-settings", ReadOnly, Edit },
765 { LFUN_INSET_REFRESH, "", Noop, Hidden },
766 { LFUN_NEXT_INSET_TOGGLE, "next-inset-toggle", ReadOnly, Edit },
767 { LFUN_INSET_TOGGLE, "", ReadOnly, Hidden },
768 { LFUN_ALL_INSETS_TOGGLE, "all-insets-toggle", ReadOnly, Edit },
771 * \var lyx::kb_action lyx::LFUN_PARAGRAPH_PARAMS
772 * \li Action: Change paragraph settings
773 * \li Notion: Modifies the current paragraph, or currently selected paragraphs.
774 This function only modifies, and does not override, existing settings.
775 Note that the "leftindent" indent setting is deprecated.
776 * \li Syntax: paragraph-params [<INDENT>] [<SPACING>] [<ALIGN>] [<OTHERS>]
777 * \li Params: <INDENT>: \\noindent|\\indent|\\indent-toggle|\\leftindent LENGTH\n
778 <SPACING>: \\paragraph_spacing default|single|onehalf|double|other\n
779 <ALIGN>: \\align block|left|right|center|default\n
780 <OTHERS>: \\labelwidthstring WIDTH|\\start_of_appendix\n
781 * \li Origin: rgh, Aug 15 2007
783 { LFUN_PARAGRAPH_PARAMS, "paragraph-params", Noop, Edit },
785 * \var lyx::kb_action lyx::LFUN_PARAGRAPH_PARAMS_APPLY
786 * \li Action: Change paragraph settings.
787 * \li Notion: Overwrite all nonspecified settings to the default ones.
788 Use paragraph-params lfun if you don't want to overwrite others settings.
789 * \li Syntax: paragraph-params-apply <INDENT> <SPACING> <ALIGN> <OTHERS>
790 * \li Params: For parameters see LFUN_PARAGRAPH_PARAMS
791 * \li Origin: leeming, 30 Mar 2004
793 { LFUN_PARAGRAPH_PARAMS_APPLY, "paragraph-params-apply", Noop, Edit },
794 { LFUN_PARAGRAPH_UPDATE, "", Noop, Hidden },
796 { LFUN_FINISHED_FORWARD, "", ReadOnly, Hidden },
797 { LFUN_FINISHED_BACKWARD, "", ReadOnly, Hidden },
798 { LFUN_FINISHED_RIGHT, "", ReadOnly, Hidden },
799 { LFUN_FINISHED_LEFT, "", ReadOnly, Hidden },
801 { LFUN_LANGUAGE, "language", Noop, Edit },
803 { LFUN_LABEL_GOTO, "label-goto", ReadOnly, Edit },
804 { LFUN_LABEL_INSERT, "label-insert", Noop, Edit },
805 { LFUN_REFERENCE_NEXT, "reference-next", ReadOnly, Edit },
808 * \var lyx::kb_action lyx::LFUN_BOOKMARK_GOTO
809 * \li Action: Goto a bookmark
810 * \li Notion: Moves the cursor to the numbered bookmark, opening the file
811 if necessary. Note that bookmarsk are saved per-session, not
813 * \li Syntax: bookmark-goto <NUMBER>
814 * \li Params: <NUMBER>: the number of the bookmark to restore.
815 * \li Origin: Dekel, 27 January 2001
817 { LFUN_BOOKMARK_GOTO, "bookmark-goto", NoBuffer, Edit },
819 * \var lyx::kb_action lyx::LFUN_BOOKMARK_SAVE
820 * \li Action: Save a bookmark
821 * \li Notion: Saves a numbered bookmark to the sessions file. The number
822 must be between 1 and 9, inclusive. Note that bookmarks are
823 saved per-session, not per file.
824 * \li Syntax: bookmark-save <NUMBER>
825 * \li Params: <NUMBER>: the number of the bookmark to save.
826 * \li Origin: Dekel, 27 January 2001
828 { LFUN_BOOKMARK_SAVE, "bookmark-save", ReadOnly, Edit },
830 * \var lyx::kb_action lyx::LFUN_BOOKMARK_CLEAR
831 * \li Action: Clears the list of saved bookmarks
832 * \li Syntax: bookmark-clear
833 * \li Origin: bpeng, 31 October 2006
835 { LFUN_BOOKMARK_CLEAR, "bookmark-clear", NoBuffer, Edit },
837 { LFUN_HELP_OPEN, "help-open", NoBuffer | Argument, Buffer },
839 * \var lyx::kb_action lyx::LFUN_LYX_QUIT
840 * \li Action: Terminates the current LyX instance
841 * \li Notion: Terminates the current LyX instance, asking whether to save
842 modified documents, etc.
843 * \li Syntax: lyx-quit
845 { LFUN_LYX_QUIT, "lyx-quit", NoBuffer, Buffer },
846 { LFUN_TOOLBAR_TOGGLE, "toolbar-toggle", NoBuffer, Buffer },
847 { LFUN_MENU_OPEN, "menu-open", NoBuffer, Buffer },
849 { LFUN_WINDOW_NEW, "window-new", NoBuffer, Buffer },
850 { LFUN_WINDOW_CLOSE, "window-close", NoBuffer, Buffer },
852 { LFUN_DIALOG_SHOW, "dialog-show", NoBuffer, Edit },
853 { LFUN_DIALOG_SHOW_NEW_INSET, "dialog-show-new-inset", Noop, Edit },
854 { LFUN_DIALOG_UPDATE, "dialog-update", NoBuffer, Edit },
855 { LFUN_DIALOG_HIDE, "dialog-hide", NoBuffer, Edit },
856 { LFUN_DIALOG_TOGGLE, "dialog-toggle", NoBuffer, Edit },
857 { LFUN_DIALOG_DISCONNECT_INSET, "dialog-disconnect-inset", Noop, Edit },
859 { LFUN_MOUSE_PRESS, "", ReadOnly, Hidden },
860 { LFUN_MOUSE_MOTION, "", ReadOnly | SingleParUpdate, Hidden },
861 { LFUN_MOUSE_RELEASE, "", ReadOnly, Hidden },
862 { LFUN_MOUSE_DOUBLE, "", ReadOnly, Hidden },
863 { LFUN_MOUSE_TRIPLE, "", ReadOnly, Hidden },
865 { LFUN_KEYMAP_OFF, "keymap-off", ReadOnly, Edit },
866 { LFUN_KEYMAP_PRIMARY, "keymap-primary", ReadOnly, Edit },
867 { LFUN_KEYMAP_SECONDARY, "keymap-secondary", ReadOnly, Edit },
868 { LFUN_KEYMAP_TOGGLE, "keymap-toggle", ReadOnly, Edit },
870 { LFUN_MESSAGE, "message", NoBuffer, System },
871 { LFUN_FLOAT_LIST, "float-list", Noop, Edit },
872 { LFUN_ESCAPE, "escape", ReadOnly, Edit },
874 { LFUN_SERVER_CHAR_AFTER, "server-char-after", ReadOnly, System },
875 { LFUN_SERVER_GET_FONT, "server-get-font", ReadOnly, System },
876 { LFUN_SERVER_GET_LAYOUT, "server-get-layout", ReadOnly, System },
877 { LFUN_SERVER_GET_NAME, "server-get-name", ReadOnly, System },
878 { LFUN_SERVER_GET_XY, "server-get-xy", ReadOnly, System },
879 { LFUN_SERVER_GOTO_FILE_ROW, "server-goto-file-row", ReadOnly, System },
880 { LFUN_SERVER_NOTIFY, "server-notify", ReadOnly, System },
881 { LFUN_SERVER_SET_XY, "server-set-xy", ReadOnly, System },
883 { LFUN_BUILD_PROGRAM, "build-program", ReadOnly, Buffer },
886 * \var lyx::kb_action lyx::LFUN_BUFFER_AUTO_SAVE
887 * \li Action: Saves the current buffer to a temporary file
888 * \li Notion: Saves the current buffer to a file named "#filename#". This LFUN
889 is called automatically by LyX, to "autosave" the current buffer.
890 * \li Syntax: buffer-auto-save
892 { LFUN_BUFFER_AUTO_SAVE, "buffer-auto-save", Noop, Buffer },
893 { LFUN_BUFFER_CHILD_OPEN, "buffer-child-open", ReadOnly, Buffer },
894 { LFUN_BUFFER_CHKTEX, "buffer-chktex", ReadOnly, Buffer },
895 { LFUN_BUFFER_TOGGLE_COMPRESSION, "buffer-toggle-compression", Noop, Buffer },
896 { LFUN_BUFFER_TOGGLE_EMBEDDING, "buffer-toggle-embedding", Noop, Buffer },
898 * \var lyx::kb_action lyx::LFUN_BUFFER_CLOSE
899 * \li Action: Closes the current buffer
900 * \li Notion: Closes the current buffer, asking whether to save it, etc,
901 if the buffer has been modified.
902 * \li Syntax: buffer-close
904 { LFUN_BUFFER_CLOSE, "buffer-close", ReadOnly, Buffer },
905 { LFUN_BUFFER_EXPORT, "buffer-export", ReadOnly, Buffer },
906 { LFUN_BUFFER_EXPORT_CUSTOM, "buffer-export-custom", ReadOnly, Buffer },
907 { LFUN_BUFFER_PRINT, "buffer-print", ReadOnly, Buffer },
908 { LFUN_BUFFER_IMPORT, "buffer-import", NoBuffer, Buffer },
910 * \var lyx::kb_action lyx::LFUN_BUFFER_NEW
911 * \li Action: Creates a new buffer (that is, document)
912 * \li Syntax: buffer-new
914 { LFUN_BUFFER_NEW, "buffer-new", NoBuffer, Buffer },
915 { LFUN_BUFFER_NEW_TEMPLATE,"buffer-new-template", NoBuffer, Buffer },
916 { LFUN_BUFFER_RELOAD, "buffer-reload", ReadOnly, Buffer },
917 { LFUN_BUFFER_SWITCH, "buffer-switch", NoBuffer | ReadOnly, Buffer },
918 { LFUN_BUFFER_TOGGLE_READ_ONLY, "buffer-toggle-read-only", ReadOnly, Buffer },
919 { LFUN_BUFFER_UPDATE, "buffer-update", ReadOnly, Buffer },
921 * \var lyx::kb_action lyx::LFUN_BUFFER_VIEW
922 * \li Action: Displays current buffer in chosen format
923 * \li Notion: Displays the contents of the current buffer in the chosen
924 format, for example, PDF or DVI. This runs the necessary
925 converter, calls the defined viewer, and so forth.
926 * \li Syntax: buffer-view <FORMAT>
927 * \li Params: <FORMAT>: The format to display, where this is one of the
928 formats defined (in the current GUI) in the
929 Tools>Preferences>File Formats dialog.
931 { LFUN_BUFFER_VIEW, "buffer-view", ReadOnly, Buffer },
933 * \var lyx::kb_action lyx::LFUN_BUFFER_WRITE
934 * \li Action: Saves the current buffer
935 * \li Notion: Saves the current buffer to disk, using the filename that
936 is already associated with the buffer, asking for one if
937 none is yet assigned.
938 * \li Syntax: buffer-write
940 { LFUN_BUFFER_WRITE, "buffer-write", ReadOnly, Buffer },
942 * \var lyx::kb_action lyx::LFUN_BUFFER_WRITE_AS
943 * \li Action: Rename and save current buffer.
944 * \li Syntax: buffer-write-as <FILENAME>
945 * \li Params: <FILENAME>: New name of the buffer/file. A relative path
946 * is with respect to the original location of the buffer/file.
948 { LFUN_BUFFER_WRITE_AS, "buffer-write-as", ReadOnly, Buffer },
949 { LFUN_BUFFER_WRITE_ALL, "buffer-write-all", ReadOnly, Buffer },
950 { LFUN_BUFFER_NEXT, "buffer-next", ReadOnly, Buffer },
951 { LFUN_BUFFER_PREVIOUS, "buffer-previous", ReadOnly, Buffer },
952 { LFUN_MASTER_BUFFER_UPDATE, "master-buffer-update", ReadOnly, Buffer },
953 { LFUN_MASTER_BUFFER_VIEW, "master-buffer-view", ReadOnly, Buffer },
954 { LFUN_BUFFER_LANGUAGE, "buffer-language", Noop, Buffer },
955 { LFUN_BUFFER_SAVE_AS_DEFAULT, "buffer-save-as-default", Noop, Buffer },
956 { LFUN_BUFFER_PARAMS_APPLY, "buffer-params-apply", Noop, Buffer },
958 { LFUN_FILE_INSERT, "file-insert", Noop, Edit },
959 { LFUN_FILE_INSERT_PLAINTEXT, "file-insert-plaintext", Noop, Edit },
960 { LFUN_FILE_INSERT_PLAINTEXT_PARA, "file-insert-plaintext-para", Noop, Edit },
961 { LFUN_FILE_NEW, "file-new", NoBuffer, Buffer },
962 { LFUN_FILE_OPEN, "file-open", NoBuffer, Buffer },
964 { LFUN_META_PREFIX, "meta-prefix", NoBuffer, System },
967 * \var lyx::kb_action lyx::LFUN_CALL
968 * \li Action: Executes a command defined in a .def file.
969 * \li Notion: The definitions are by default read from lib/commands/default.def .
970 A .def file allows to define a command with \\define "<NAME>" "<LFUN>"
971 where <NAME> is the name of the new command and <LFUN> is the lfun code
972 to be executed (see e.g. command-sequence LFUN).
973 \\def_file "FileName" allows to include another .def file.
974 This is particularly useful in connection with toolbar buttons:
975 Since the name of the button image for this lfun is
976 lib/images/commands/<NAME>.png this is the way to assign an image
977 to a complex command-sequence.
978 * \li Syntax: call <NAME>
979 * \li Params: <NAME>: Name of the command that must be called.
980 * \li Origin: broider, 2 Oct 2007
982 { LFUN_CALL, "call", NoBuffer, System },
983 { LFUN_CANCEL, "cancel", NoBuffer, System },
985 { LFUN_COMMAND_EXECUTE, "command-execute", NoBuffer, Edit },
986 { LFUN_COMMAND_PREFIX, "command-prefix", NoBuffer, Hidden },
987 { LFUN_COMMAND_SEQUENCE, "command-sequence", NoBuffer, System },
990 * \var lyx::kb_action lyx::LFUN_PREFERENCES_SAVE
991 * \li Action: Save user preferences.
992 * \li Syntax: preferences-save
993 * \li Origin: Lgb, 27 Nov 1999
995 { LFUN_PREFERENCES_SAVE, "preferences-save", NoBuffer, System },
997 * \var lyx::kb_action lyx::LFUN_RECONFIGURE
998 * \li Action: Reconfigure the automatic settings.
999 * \li Syntax: reconfigure
1000 * \li Origin: Asger, 14 Feb 1997
1002 { LFUN_RECONFIGURE, "reconfigure", NoBuffer, System },
1003 { LFUN_LYXRC_APPLY, "lyxrc-apply", NoBuffer, System },
1005 * \var lyx::kb_action lyx::LFUN_TOGGLE_CURSOR_FOLLOWS_SCROLLBAR
1006 * \li Action: Determine whether keep cursor inside the editing window regardless
1007 the scrollbar movement.
1008 * \li Syntax: toggle-cursor-follows-scrollbar
1009 * \li Origin: ARRae, 2 Dec 1997
1011 { LFUN_TOGGLE_CURSOR_FOLLOWS_SCROLLBAR, "toggle-cursor-follows-scrollbar", ReadOnly, System },
1013 * \var lyx::kb_action lyx::LFUN_SET_COLOR
1014 * \li Action: Set the given LyX color to the color defined by the X11 name given.
1015 * \li Notion: A new color entry is created if the color is unknown.
1016 Color names can be stored as a part of user settings.
1017 * \li Syntax: set-color <LYX_NAME> <X11_NAME>
1018 * \li Origin: SLior, 11 Jun 2000
1020 { LFUN_SET_COLOR, "set-color", ReadOnly | NoBuffer, System },
1022 * \var lyx::kb_action lyx::LFUN_STATISTICS
1023 * \li Action: Count the statistics (number of words and characters)
1024 in the document or in the given selection.
1025 * \li Notion: Note that this function gives the number of words/chars written,
1026 not the number of characters which will be typeset.
1027 * \li Syntax: statistics
1028 * \li Origin: lasgouttes, Jan 27 2004; ps, Jan 8 2008
1030 { LFUN_STATISTICS, "statistics", ReadOnly, System },
1032 { LFUN_NOACTION, "", Noop, Hidden }
1033 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1036 for (int i = 0; items[i].action != LFUN_NOACTION; ++i) {
1037 newFunc(items[i].action, items[i].name, items[i].attrib, items[i].type);
1044 LyXAction::LyXAction()
1050 // Returns an action tag from a string.
1051 FuncRequest LyXAction::lookupFunc(string const & func) const
1053 string const func2 = trim(func);
1055 if (func2.empty()) {
1056 return FuncRequest(LFUN_NOACTION);
1060 string const arg = split(func2, cmd, ' ');
1062 func_map::const_iterator fit = lyx_func_map.find(cmd);
1064 return fit != lyx_func_map.end() ? FuncRequest(fit->second, arg) : FuncRequest(LFUN_UNKNOWN_ACTION);
1068 string const LyXAction::getActionName(kb_action action) const
1070 info_map::const_iterator const it = lyx_info_map.find(action);
1071 return it != lyx_info_map.end() ? it->second.name : string();
1075 LyXAction::func_type const LyXAction::getActionType(kb_action action) const
1077 info_map::const_iterator const it = lyx_info_map.find(action);
1078 return it != lyx_info_map.end() ? it->second.type : Hidden;
1082 bool LyXAction::funcHasFlag(kb_action action,
1083 LyXAction::func_attrib flag) const
1085 info_map::const_iterator ici = lyx_info_map.find(action);
1087 if (ici == lyx_info_map.end()) {
1088 LYXERR0("action: " << action << " is not known.");
1089 BOOST_ASSERT(false);
1092 return ici->second.attrib & flag;
1096 LyXAction::const_func_iterator LyXAction::func_begin() const
1098 return lyx_func_map.begin();
1102 LyXAction::const_func_iterator LyXAction::func_end() const
1104 return lyx_func_map.end();