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.
59 * \var lyx::kb_action lyx::LFUN_
71 void LyXAction::newFunc(kb_action action, string const & name,
72 unsigned int attrib, LyXAction::func_type type)
74 lyx_func_map[name] = action;
77 tmpinfo.attrib = attrib;
79 lyx_info_map[action] = tmpinfo;
83 // Needed for LFUNs documentation to be accepted, since doxygen won't take
84 // \var inside functions.
85 #ifndef DOXYGEN_SHOULD_SKIP_THIS
86 void LyXAction::init()
88 // This function was changed to use the array below in initalization
89 // instead of calling newFunc numerous times because of compilation
90 // times. Since the array is not static we get back the memory it
91 // occupies after the init is completed. It compiles several
104 ev_item const items[] = {
107 * \var lyx::kb_action lyx::LFUN_ACCENT_ACUTE
108 * \li Action: Adds an acute accent \htmlonly (á)\endhtmlonly
109 to the next character typed.
110 * \li Syntax: accent-acute
112 { LFUN_ACCENT_ACUTE, "accent-acute", Noop, Edit },
114 * \var lyx::kb_action lyx::LFUN_ACCENT_BREVE
115 * \li Action: Adds a breve accent \htmlonly (ă)\endhtmlonly
116 to the next character typed.
117 * \li Syntax: accent-breve
119 { LFUN_ACCENT_BREVE, "accent-breve", Noop, Edit },
121 * \var lyx::kb_action lyx::LFUN_ACCENT_CARON
122 * \li Action: Adds a caron \htmlonly (ǎ)\endhtmlonly
123 to the next character typed.
124 * \li Syntax: accent-caron
126 { LFUN_ACCENT_CARON, "accent-caron", Noop, Edit },
128 * \var lyx::kb_action lyx::LFUN_ACCENT_CEDILLA
129 * \li Action: Adds a cedilla \htmlonly (ç)\endhtmlonly
130 to the next character typed.
131 * \li Syntax: accent-cedilla
133 { LFUN_ACCENT_CEDILLA, "accent-cedilla", Noop, Edit },
135 * \var lyx::kb_action lyx::LFUN_ACCENT_CIRCLE
136 * \li Action: Adds a circle accent \htmlonly (å)\endhtmlonly
137 to the next character typed.
138 * \li Syntax: accent-circle
140 { LFUN_ACCENT_CIRCLE, "accent-circle", Noop, Edit },
142 * \var lyx::kb_action lyx::LFUN_ACCENT_CIRCUMFLEX
143 * \li Action: Adds a circumflex \htmlonly (ê)\endhtmlonly
144 to the next character typed.
145 * \li Syntax: accent-circumflex
147 { LFUN_ACCENT_CIRCUMFLEX, "accent-circumflex", Noop, Edit },
149 * \var lyx::kb_action lyx::LFUN_ACCENT_DOT
150 * \li Action: Adds a dot accent \htmlonly (ż)\endhtmlonly
151 to the next character typed.
152 * \li Syntax: accent-dot
154 { LFUN_ACCENT_DOT, "accent-dot", Noop, Edit },
156 * \var lyx::kb_action lyx::LFUN_ACCENT_GRAVE
157 * \li Action: Adds a grave accent \htmlonly (è)\endhtmlonly
158 to the next character typed.
159 * \li Syntax: accent-grave
161 { LFUN_ACCENT_GRAVE, "accent-grave", Noop, Edit },
163 * \var lyx::kb_action lyx::LFUN_ACCENT_HUNGARIAN_UMLAUT
164 * \li Action: Adds a Hungarian umlaut \htmlonly (ő)\endhtmlonly
165 to the next character typed.
166 * \li Syntax: accent-grave
168 { LFUN_ACCENT_HUNGARIAN_UMLAUT, "accent-hungarian-umlaut", Noop, Edit },
170 * \var lyx::kb_action lyx::LFUN_ACCENT_MACRON
171 * \li Action: Adds a macron \htmlonly (ā)\endhtmlonly
172 to the next character typed.
173 * \li Syntax: accent-macron
175 { LFUN_ACCENT_MACRON, "accent-macron", Noop, Edit },
177 * \var lyx::kb_action lyx::LFUN_ACCENT_OGONEK
178 * \li Action: Adds an ogonek accent \htmlonly (ą)\endhtmlonly
179 to the next character typed.
180 * \li Syntax: accent-ogonek
182 { LFUN_ACCENT_OGONEK, "accent-ogonek", Noop, Edit },
183 { LFUN_ACCENT_SPECIAL_CARON, "accent-special-caron", Noop, Edit },
185 * \var lyx::kb_action lyx::LFUN_ACCENT_TIE
186 * \li Action: Adds a tie \htmlonly (a͡)\endhtmlonly
187 over the next two character typed.
188 * \li Notion: the following char will finish the tie.
189 * \li Syntax: accent-tie
191 { LFUN_ACCENT_TIE, "accent-tie", Noop, Edit },
193 * \var lyx::kb_action lyx::LFUN_ACCENT_TILDE
194 * \li Action: Adds a tilde \htmlonly (ã)\endhtmlonly
195 over the next character typed.
196 * \li Syntax: accent-tilde
198 { LFUN_ACCENT_TILDE, "accent-tilde", Noop, Edit },
200 * \var lyx::kb_action lyx::LFUN_ACCENT_UMLAUT
201 * \li Action: Adds an umlaut \htmlonly (ä)\endhtmlonly
202 over the next character typed.
203 * \li Syntax: accent-umlaut
205 { LFUN_ACCENT_UMLAUT, "accent-umlaut", Noop, Edit },
207 * \var lyx::kb_action lyx::LFUN_ACCENT_UNDERBAR
208 * \li Action: Adds a bar \htmlonly (a̠)\endhtmlonly
209 under the next character typed.
210 * \li Syntax: accent-underbar
212 { LFUN_ACCENT_UNDERBAR, "accent-underbar", Noop, Edit },
214 * \var lyx::kb_action lyx::LFUN_ACCENT_UNDERDOT
215 * \li Action: Adds a dot \htmlonly (ạ)\endhtmlonly
216 under the next character typed.
217 * \li Syntax: accent-underdot
219 { LFUN_ACCENT_UNDERDOT, "accent-underdot", Noop, Edit },
222 * \var lyx::kb_action lyx::LFUN_BREAK_PARAGRAPH
223 * \li Action: Breaks the current paragraph at the current location.
224 * \li Syntax: break-paragraph
226 { LFUN_BREAK_PARAGRAPH, "break-paragraph", Noop, Edit },
228 * \var lyx::kb_action lyx::LFUN_BREAK_PARAGRAPH_SKIP
229 * \li Action: Breaks the current paragraph at the current location,
230 unless used at the beginning of a line, where it sets
231 the label width string to empty.
232 * \li Syntax: break-paragraph-skip
234 { LFUN_BREAK_PARAGRAPH_SKIP, "break-paragraph-skip", Noop, Edit },
236 * \var lyx::kb_action lyx::LFUN_CAPTION_INSERT
237 * \li Action: Inserts a caption inset.
238 * \li Syntax: caption-insert
239 * \li Origin: Lgb, 18 Jul 2000
241 { LFUN_CAPTION_INSERT, "caption-insert", Noop, Edit },
243 * \var lyx::kb_action lyx::LFUN_DATE_INSERT
244 * \li Action: Inserts the current date.
245 * \li Syntax: date-insert [<ARG>]
246 * \li Param: <ARG>: Format of date. The default value (%x) can be set
247 in Preferences->Date format. For possible formats
248 see manual page of strftime function.
249 * \li Origin: jdblair, 31 Jan 2000
251 { LFUN_DATE_INSERT, "date-insert", Noop, Edit },
253 * \var lyx::kb_action lyx::LFUN_FOOTNOTE_INSERT
254 * \li Action: Inserts a footnote inset.
255 * \li Syntax: footnote-insert
256 * \li Origin: Jug, 7 Mar 2000
258 { LFUN_FOOTNOTE_INSERT, "footnote-insert", Noop, Edit },
260 * \var lyx::kb_action lyx::LFUN_ERT_INSERT
261 * \li Action: Inserts an ERT inset.
262 * \li Syntax: ert-insert
263 * \li Origin: Jug, 18 Feb 2000
265 { LFUN_ERT_INSERT, "ert-insert", Noop, Edit },
266 { LFUN_FLOAT_INSERT, "float-insert", Noop, Edit },
267 { LFUN_FLOAT_WIDE_INSERT, "float-wide-insert", Noop, Edit },
268 { LFUN_WRAP_INSERT, "wrap-insert", Noop, Edit },
270 * \var lyx::kb_action lyx::LFUN_HFILL_INSERT
271 * \li Action: Inserts an hfill inset.
272 * \li Syntax: hfill-insert
274 { LFUN_HFILL_INSERT, "hfill-insert", Noop, Edit },
276 * \var lyx::kb_action lyx::LFUN_OPTIONAL_INSERT
277 * \li Action: Inserts an optional-argument (short title) inset.
278 * \li Syntax: optional-insert
279 * \li Origin: Martin, 12 Aug 2002
281 { LFUN_OPTIONAL_INSERT, "optional-insert", Noop, Edit },
283 * \var lyx::kb_action lyx::LFUN_LINE_INSERT
284 * \li Action: Inserts a horizontal line.
285 * \li Syntax: line-insert
286 * \li Origin: poenitz, Oct 27 2003
288 { LFUN_LINE_INSERT, "line-insert", Noop, Edit },
290 * \var lyx::kb_action lyx::LFUN_NEWPAGE_INSERT
291 * \li Action: Inserts a new page.
292 * \li Syntax: newpage-insert
293 * \li Origin: uwestoehr, 24 Nov 2007
295 { LFUN_NEWPAGE_INSERT, "newpage-insert", Noop, Edit },
297 * \var lyx::kb_action lyx::LFUN_PAGEBREAK_INSERT
298 * \li Action: Inserts a pagebreak.
299 * \li Syntax: pagebreak-insert
300 * \li Origin: poenitz, Oct 27 2003
302 { LFUN_PAGEBREAK_INSERT, "pagebreak-insert", Noop, Edit },
304 * \var lyx::kb_action lyx::LFUN_MARGINALNOTE_INSERT
305 * \li Action: Inserts a marginal note.
306 * \li Syntax: marginalnote-insert
307 * \li Origin: Lgb, 26 Jun 2000
309 { LFUN_MARGINALNOTE_INSERT, "marginalnote-insert", Noop, Edit },
311 * \var lyx::kb_action lyx::LFUN_UNICODE_INSERT
312 * \li Action: Inserts a single unicode character.
313 * \li Syntax: unicode-insert <CHAR>
314 * \li Params: <CHAR>: The character to insert, given as its code
315 point, in hexadecimal, e.g.: unicode-insert 0x0100.
316 * \li Origin: Lgb, 22 Oct 2006
318 { LFUN_UNICODE_INSERT, "unicode-insert", Noop, Edit },
320 * \var lyx::kb_action lyx::LFUN_LISTING_INSERT
321 * \li Action: Inserts a new listings inset.
322 * \li Syntax: listing-insert
323 * \li Origin: Herbert, 10 Nov 2001; bpeng, 2 May 2007
325 { LFUN_LISTING_INSERT, "listing-insert", Noop, Edit },
326 { LFUN_QUOTE_INSERT, "quote-insert", Noop, Edit },
327 { LFUN_INFO_INSERT, "info-insert", Noop, Edit },
328 { LFUN_BRANCH_INSERT, "branch-insert", Noop, Edit },
329 { LFUN_BOX_INSERT, "box-insert", Noop, Edit },
330 { LFUN_FLEX_INSERT, "flex-insert", Noop, Edit },
331 { LFUN_SELF_INSERT, "self-insert", SingleParUpdate, Hidden },
332 { LFUN_SPACE_INSERT, "space-insert", Noop, Edit },
333 { LFUN_HYPERLINK_INSERT, "href-insert", Noop, Edit },
334 { LFUN_SPECIALCHAR_INSERT, "specialchar-insert", Noop, Edit },
335 { LFUN_CLEARPAGE_INSERT, "clearpage-insert", Noop, Edit },
336 { LFUN_CLEARDOUBLEPAGE_INSERT, "cleardoublepage-insert", Noop, Edit },
337 { LFUN_TOC_INSERT, "toc-insert", Noop, Edit },
338 { LFUN_APPENDIX, "appendix", Noop, Edit },
341 { LFUN_LIST_INSERT, "list-insert", Noop, Edit },
342 { LFUN_THEOREM_INSERT, "theorem-insert", Noop, Edit },
345 { LFUN_DELETE_BACKWARD_SKIP, "delete-backward-skip", Noop, Edit },
346 { LFUN_DELETE_FORWARD_SKIP, "delete-forward-skip", Noop, Edit },
347 { LFUN_DOWN, "down", ReadOnly | NoUpdate, Edit },
348 { LFUN_DOWN_SELECT, "down-select", ReadOnly | SingleParUpdate, Edit },
349 { LFUN_UP, "up", ReadOnly | NoUpdate, Edit },
350 { LFUN_UP_SELECT, "up-select", ReadOnly | SingleParUpdate, Edit },
351 { LFUN_SCREEN_DOWN, "screen-down", ReadOnly, Edit },
352 { LFUN_SCREEN_DOWN_SELECT, "screen-down-select", ReadOnly, Edit },
354 * \var lyx::kb_action lyx::LFUN_SCROLL
355 * \li Action: Scroll the buffer view.
356 * \li Notion: Only scrolls the screen up or down; does not move the cursor.
357 * \li Syntax: scroll <TYPE> <QUANTITY>
358 * \li Params: <TYPE>: line|page\n
359 <QUANTITY>: up|down|<number>\n
360 * \li Origin: Abdelrazak Younes, Dec 27 2007
362 { LFUN_SCROLL, "scroll", ReadOnly, Edit },
364 * \var lyx::kb_action lyx::LFUN_SCREEN_RECENTER
365 * \li Action: Recenters the screen on the current cursor position.
366 * \li Syntax: screen-recenter
368 { LFUN_SCREEN_RECENTER, "screen-recenter", ReadOnly, Edit },
369 { LFUN_SCREEN_UP, "screen-up", ReadOnly, Edit },
370 { LFUN_SCREEN_UP_SELECT, "screen-up-select", ReadOnly, Edit },
372 { LFUN_ERROR_NEXT, "error-next", ReadOnly, Edit },
374 * \var lyx::kb_action lyx::LFUN_CHAR_BACKWARD
375 * \li Action: Moves the cursor one position logically backwards.
376 * \li Notion: This is not the action which should be bound to the arrow keys,
377 because backwards may be left or right, depending on the
378 language. The arrow keys should be bound to #LFUN_CHAR_LEFT or
379 #LFUN_CHAR_RIGHT actions, which in turn may employ this one.
380 * \li Syntax: char-backward
382 { LFUN_CHAR_BACKWARD, "char-backward", ReadOnly | NoUpdate, Edit },
384 * \var lyx::kb_action lyx::LFUN_CHAR_BACKWARD_SELECT
385 * \li Action: Moves the cursor one position logically backwards, adding
386 traversed position to the selection.
387 * \li Notion: See also #LFUN_CHAR_BACKWARD.
388 * \li Syntax: char-backward-select
390 { LFUN_CHAR_BACKWARD_SELECT, "char-backward-select", ReadOnly | SingleParUpdate, Edit },
391 { LFUN_CHAR_DELETE_BACKWARD, "delete-backward", SingleParUpdate, Edit },
392 { LFUN_CHAR_DELETE_FORWARD, "delete-forward", SingleParUpdate, Edit },
394 * \var lyx::kb_action lyx::LFUN_CHAR_FORWARD
395 * \li Action: Moves the cursor one position logically forward.
396 * \li Notion: This is not the action which should be bound to the arrow keys,
397 because forward may be left or right, depending on the language.
398 The arrow keys should be bound to #LFUN_CHAR_LEFT or
399 #LFUN_CHAR_RIGHT actions, which in turn may employ this one.
400 * \li Syntax: char-forward
402 { LFUN_CHAR_FORWARD, "char-forward", ReadOnly | NoUpdate, Edit },
404 * \var lyx::kb_action lyx::LFUN_CHAR_FORWARD_SELECT
405 * \li Action: Moves the cursor one position logically forward, adding
406 traversed position to the selection.
407 * \li Notion: See also #LFUN_CHAR_FORWARD.
408 * \li Syntax: char-forward-select
410 { LFUN_CHAR_FORWARD_SELECT, "char-forward-select", ReadOnly | SingleParUpdate, Edit },
412 * \var lyx::kb_action lyx::LFUN_CHAR_LEFT
413 * \li Action: Moves the cursor one position "to the left".
414 * \li Notion: This is the action which should be taken when the "left" key
415 is pressed. Generally, it moves the cursor one position to the
416 left. However, in Bidi text this become slightly more
417 complicated, and there are different modes of cursor movement.
418 In "visual mode", this moves left, plain and simple. In "logical
419 mode", movement is logically forward in RTL paragraphs, and
420 logically backwards in LTR paragraphs.
421 * \li Syntax: char-left
423 { LFUN_CHAR_LEFT, "char-left", ReadOnly | NoUpdate, Edit },
425 * \var lyx::kb_action lyx::LFUN_CHAR_LEFT_SELECT
426 * \li Action: Moves the cursor one position "to the left", adding
427 traversed position to the selection.
428 * \li Notion: See also #LFUN_CHAR_LEFT for exact details of the movement.
429 * \li Syntax: char-left-select
431 { LFUN_CHAR_LEFT_SELECT, "char-left-select", ReadOnly | SingleParUpdate, Edit },
433 * \var lyx::kb_action lyx::LFUN_CHAR_RIGHT
434 * \li Action: Moves the cursor one position "to the right".
435 * \li Notion: This is the action which should be taken when the "right" key
436 is pressed. Generally, it moves the cursor one position to the
437 right. However, in Bidi text this become slightly more
438 complicated, and there are different modes of cursor movement.
439 In "visual mode", this moves right, plain and simple. In "logical
440 mode", movement is logically forward in LTR paragraphs, and
441 logically backwards in RTL paragraphs.
442 * \li Syntax: char-right
444 { LFUN_CHAR_RIGHT, "char-right", ReadOnly | NoUpdate, Edit },
446 * \var lyx::kb_action lyx::LFUN_CHAR_RIGHT_SELECT
447 * \li Action: Moves the cursor one position "to the right", adding
448 traversed position to the selection.
449 * \li Notion: See also #LFUN_CHAR_RIGHT for exact details of the movement.
450 * \li Syntax: char-right-select
452 { LFUN_CHAR_RIGHT_SELECT, "char-right-select", ReadOnly | SingleParUpdate, Edit },
454 { LFUN_WORD_BACKWARD, "word-backward", ReadOnly | NoUpdate, Edit },
455 { LFUN_WORD_BACKWARD_SELECT, "word-backward-select", ReadOnly | SingleParUpdate, Edit },
456 { LFUN_WORD_CAPITALIZE, "word-capitalize", Noop, Edit },
457 { LFUN_WORD_DELETE_BACKWARD, "word-delete-backward", Noop, Edit },
458 { LFUN_WORD_DELETE_FORWARD, "word-delete-forward", Noop, Edit },
459 { LFUN_WORD_FIND_BACKWARD, "word-find-backward", ReadOnly, Edit },
460 { LFUN_WORD_FIND_FORWARD, "word-find-forward", ReadOnly, Edit },
461 { LFUN_WORD_FORWARD, "word-forward", ReadOnly | NoUpdate, Edit },
462 { LFUN_WORD_FORWARD_SELECT, "word-forward-select", ReadOnly | SingleParUpdate, Edit },
463 { LFUN_WORD_LEFT, "word-left", ReadOnly | NoUpdate, Edit },
464 { LFUN_WORD_LEFT_SELECT, "word-left-select", ReadOnly | SingleParUpdate, Edit },
465 { LFUN_WORD_LOWCASE, "word-lowcase", Noop, Edit },
466 { LFUN_WORD_RIGHT, "word-right", ReadOnly | NoUpdate, Edit },
467 { LFUN_WORD_RIGHT_SELECT, "word-right-select", ReadOnly | SingleParUpdate, Edit },
468 { LFUN_WORD_SELECT, "word-select", ReadOnly, Edit },
469 { LFUN_WORD_UPCASE, "word-upcase", Noop, Edit },
470 { LFUN_WORD_FIND, "word-find", ReadOnly, Edit },
471 { LFUN_WORD_REPLACE, "word-replace", Noop, Edit },
473 * \var lyx::kb_action lyx::LFUN_THESAURUS_ENTRY
474 * \li Action: Look up thesaurus entries with respect to the word under the cursor.
475 * \li Syntax: thesaurus-entry
476 * \li Origin: Levon, 20 Jul 2001
478 { LFUN_THESAURUS_ENTRY, "thesaurus-entry", ReadOnly, Edit },
479 { LFUN_BUFFER_BEGIN, "buffer-begin", ReadOnly, Edit },
480 { LFUN_BUFFER_BEGIN_SELECT, "buffer-begin-select", ReadOnly, Edit },
481 { LFUN_BUFFER_END, "buffer-end", ReadOnly, Edit },
482 { LFUN_BUFFER_END_SELECT, "buffer-end-select", ReadOnly, Edit },
484 { LFUN_LINE_BEGIN, "line-begin", ReadOnly | NoUpdate, Edit },
485 { LFUN_LINE_BEGIN_SELECT, "line-begin-select", ReadOnly | SingleParUpdate, Edit },
486 { LFUN_LINE_BREAK, "line-break", Noop, Edit },
487 { LFUN_LINE_DELETE, "line-delete-forward", Noop, Edit }, // there is no line-delete-backward
488 { LFUN_LINE_END, "line-end", ReadOnly | NoUpdate, Edit },
489 { LFUN_LINE_END_SELECT, "line-end-select", ReadOnly | SingleParUpdate, Edit },
490 { LFUN_NEW_LINE, "new-line", Noop, Edit },
493 * \var lyx::kb_action lyx::LFUN_PARAGRAPH_MOVE_DOWN
494 * \li Action: Moves the current paragraph downwards in the document.
495 * \li Syntax: paragraph-move-down
496 * \li Origin: Edwin, 8 Apr 2006
498 { LFUN_PARAGRAPH_MOVE_DOWN, "paragraph-move-down", Noop, Edit },
500 * \var lyx::kb_action lyx::LFUN_PARAGRAPH_MOVE_UP
501 * \li Action: Moves the current paragraph upwards in the document.
502 * \li Syntax: paragraph-move-up
503 * \li Origin: Edwin, 8 Apr 2006
505 { LFUN_PARAGRAPH_MOVE_UP, "paragraph-move-up", Noop, Edit },
507 * \var lyx::kb_action lyx::LFUN_COPY
508 * \li Action: Copies to the clipboard the last edit.
511 { LFUN_COPY, "copy", ReadOnly, Edit },
513 * \var lyx::kb_action lyx::LFUN_CUT
514 * \li Action: Cuts to the clipboard.
517 { LFUN_CUT, "cut", Noop, Edit },
519 * \var lyx::kb_action lyx::LFUN_PASTE
520 * \li Action: Pastes from the active clipboard.
523 { LFUN_PASTE, "paste", Noop, Edit },
524 { LFUN_CLIPBOARD_PASTE, "clipboard-paste", Noop, Edit },
526 * \var lyx::kb_action lyx::LFUN_PRIMARY_SELECTION_PASTE
527 * \li Action: Pastes the material currently selected.
528 * \li Syntax: primary-selection-paste
530 { LFUN_PRIMARY_SELECTION_PASTE, "primary-selection-paste", Noop, Edit },
532 * \var lyx::kb_action lyx::LFUN_UNDO
533 * \li Action: Undoes the last edit.
536 { LFUN_UNDO, "undo", Noop, Edit },
538 * \var lyx::kb_action lyx::LFUN_REDO
539 * \li Action: Redoes the last thing undone.
542 { LFUN_REDO, "redo", Noop, Edit },
543 { LFUN_REPEAT, "repeat", NoBuffer, Edit },
544 { LFUN_CHARS_TRANSPOSE, "chars-transpose", Noop, Edit },
546 { LFUN_DEPTH_DECREMENT, "depth-decrement", Noop, Edit },
547 { LFUN_DEPTH_INCREMENT, "depth-increment", Noop, Edit },
548 { LFUN_ENVIRONMENT_INSERT, "environment-insert", Noop, Edit },
550 { LFUN_FONT_BOLD, "font-bold", Noop, Layout },
551 { LFUN_FONT_TYPEWRITER, "font-typewriter", Noop, Layout },
552 { LFUN_FONT_DEFAULT, "font-default", Noop, Layout },
553 { LFUN_FONT_EMPH, "font-emph", Noop, Layout },
554 { LFUN_FONT_FREE_APPLY, "font-free-apply", Noop, Layout },
555 { LFUN_FONT_FREE_UPDATE, "font-free-update", Noop, Layout },
556 { LFUN_FONT_NOUN, "font-noun", Noop, Layout },
557 { LFUN_FONT_ROMAN, "font-roman", Noop, Layout },
558 { LFUN_FONT_SANS, "font-sans", Noop, Layout },
559 { LFUN_FONT_FRAK, "font-frak", Noop, Layout },
560 { LFUN_FONT_ITAL, "font-ital", Noop, Layout },
561 { LFUN_FONT_SIZE, "font-size", Noop, Layout },
562 { LFUN_FONT_STATE, "font-state", ReadOnly, Layout },
563 { LFUN_FONT_UNDERLINE, "font-underline", Noop, Layout },
564 { LFUN_SCREEN_FONT_UPDATE, "screen-font-update", NoBuffer, Layout },
566 { LFUN_INDEX_INSERT, "index-insert", Noop, Edit },
567 { LFUN_INDEX_PRINT, "index-print", Noop, Edit },
569 { LFUN_NOMENCL_INSERT, "nomencl-insert", Noop, Edit },
570 { LFUN_NOMENCL_PRINT, "nomencl-print", Noop, Edit },
572 { LFUN_NOTE_INSERT, "note-insert", Noop, Edit },
573 { LFUN_NOTE_NEXT, "note-next", ReadOnly, Edit },
575 { LFUN_BIBITEM_INSERT, "bibitem-insert", Noop, Edit },
576 { LFUN_CITATION_INSERT, "citation-insert", Noop, Edit },
577 { LFUN_BIBTEX_DATABASE_ADD, "bibtex-database-add", Noop, Edit },
578 { LFUN_BIBTEX_DATABASE_DEL, "bibtex-database-del", Noop, Edit },
581 * \var lyx::kb_action lyx::LFUN_LAYOUT
582 * \li Action: Sets the layout (that is, environment) for the current paragraph.
583 * \li Syntax: layout <LAYOUT>
584 * \li Params: <LAYOUT>: the layout to use
586 { LFUN_LAYOUT, "layout", Noop, Layout },
588 * \var lyx::kb_action lyx::LFUN_LAYOUT_PARAGRAPH
589 * \li Action: Launches the paragraph settings dialog.
590 * \li Syntax: layout-paragraph
592 { LFUN_LAYOUT_PARAGRAPH, "layout-paragraph", ReadOnly, Layout },
593 { LFUN_LAYOUT_TABULAR, "layout-tabular", Noop, Layout },
595 * \var lyx::kb_action lyx::LFUN_DROP_LAYOUTS_CHOICE
596 * \li Action: Displays list of layout choices.
597 * \li Notion: In the current (as of 2007) Qt4 frontend, this LFUN opens the
598 dropbox allowing for choice of layout.
599 * \li Syntax: drop-layouts-choice
601 { LFUN_DROP_LAYOUTS_CHOICE, "drop-layouts-choice", ReadOnly, Layout },
603 * \var lyx::kb_action lyx::LFUN_LAYOUT_MODULES_CLEAR
604 * \li Action: Clears the module list.
605 * \li Notion: Clears the list of included modules for the current buffer.
606 * \li Syntax: layout-modules-clear
607 * \li Origin: rgh, 25 August 2007
609 { LFUN_LAYOUT_MODULES_CLEAR, "layout-modules-clear", Noop, Layout },
611 * \var lyx::kb_action lyx::LFUN_LAYOUT_MODULE_ADD
612 * \li Action: Adds a module.
613 * \li Notion: Adds a module to the list of included modules for the current buffer.
614 * \li Syntax: layout-module-add <MODULE>
615 * \li Params: <MODULE>: the module to be added
616 * \li Origin: rgh, 25 August 2007
618 { LFUN_LAYOUT_MODULE_ADD, "layout-module-add", Noop, Layout },
620 * \var lyx::kb_action lyx::LFUN_LAYOUT_RELOAD
621 * \li Action: Reloads layout information.
622 * \li Notion: Reloads all layout information for the current buffer from disk, thus
623 recognizing any changes that have been made to layout files on the fly.
624 This is intended to be used only by layout developers and should not be
625 used when one is trying to do actual work.
626 * \li Syntax: layout-reload
627 * \li Origin: rgh, 3 September 2007
629 { LFUN_LAYOUT_RELOAD, "layout-reload", Noop, Layout },
631 * \var lyx::kb_action lyx::LFUN_TEXTCLASS_APPLY
632 * \li Action: Sets the text class for the current buffer.
633 * \li Syntax: textclass-apply <TEXTCLASS>
634 * \li Params: <TEXTCLASS>: the textclass to set. Note that this must be
635 the filename, minus the ".layout" extension.
637 { LFUN_TEXTCLASS_APPLY, "textclass-apply", Noop, Layout },
639 * \var lyx::kb_action lyx::LFUN_TEXTCLASS_LOAD
640 * \li Action: Loads information for a textclass from disk.
641 * \li Syntax: textclass-load <TEXTCLASS>
642 * \li Params: <TEXTCLASS>: the textclass to load. Note that this must be
643 the filename, minus the ".layout" extension.
645 { LFUN_TEXTCLASS_LOAD, "textclass-load", Noop, Layout },
648 * \var lyx::kb_action lyx::LFUN_MARK_OFF
649 * \li Action: Disable selecting of text-region.
650 * \li Syntax: mark-off
652 { LFUN_MARK_OFF, "mark-off", ReadOnly, Edit },
654 * \var lyx::kb_action lyx::LFUN_MARK_ON
655 * \li Action: Enable selecting of text-region.
656 * \li Notion: After enabling you can simply move arrow keys to get selected region.
657 * \li Syntax: mark-on
659 { LFUN_MARK_ON, "mark-on", ReadOnly, Edit },
661 * \var lyx::kb_action lyx::LFUN_MARK_TOGGLE
662 * \li Action: Toggle between #LFUN_MARK_ON and #LFUN_MARK_OFF .
663 * \li Syntax: mark-toggle
664 * \li Origin: poenitz, May 5 2006
666 { LFUN_MARK_TOGGLE, "mark-toggle", ReadOnly, Edit },
668 { LFUN_MATH_DELIM, "math-delim", Noop, Math },
669 { LFUN_MATH_BIGDELIM, "math-bigdelim", Noop, Math },
670 { LFUN_MATH_DISPLAY, "math-display", Noop, Math },
671 { LFUN_MATH_INSERT, "math-insert", Noop, Math },
672 { LFUN_MATH_SUBSCRIPT, "math-subscript", Noop, Math },
673 { LFUN_MATH_SUPERSCRIPT, "math-superscript", Noop, Math },
674 { LFUN_MATH_LIMITS, "math-limits", Noop, Math },
675 { LFUN_MATH_MACRO, "math-macro", Noop, Math },
676 { LFUN_MATH_MUTATE, "math-mutate", Noop, Math },
677 { LFUN_MATH_SPACE, "math-space", Noop, Math },
678 { LFUN_MATH_IMPORT_SELECTION, "math-import-selection", Noop, Math },
679 { LFUN_MATH_MATRIX, "math-matrix", Noop, Math },
680 { LFUN_MATH_MODE, "math-mode", Noop, Math },
682 * \var lyx::kb_action lyx::LFUN_MATH_NUMBER_LINE_TOGGLE
683 * \li Action: Toggles numbering of the current formula line.
684 * \li Notion: Must be in display formula mode.
685 * \li Syntax: math-number-line-toggle
686 * \li Origin: Alejandro 18 Jun 1996
688 { LFUN_MATH_NUMBER_LINE_TOGGLE, "math-number-line-toggle", Noop, Math },
690 * \var lyx::kb_action lyx::LFUN_MATH_NUMBER_TOGGLE
691 * \li Action: Toggles numbering of the current formula.
692 * \li Notion: Must be in display formula mode.
693 * \li Syntax: math-number-toggle
694 * \li Origin: Alejandro 4 Jun 1996
696 { LFUN_MATH_NUMBER_TOGGLE, "math-number-toggle", Noop, Math },
697 { LFUN_MATH_EXTERN, "math-extern", Noop, Math },
698 { LFUN_MATH_SIZE, "math-size", Noop, Math },
700 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_UNFOLD
701 * \li Action: Unfold a Math Macro.
702 * \li Notion: Unfold the Math Macro the cursor is in, i.e.
704 * \li Syntax: math-macro-unfold
705 * \li Origin: sts, 06 January 2008
707 { LFUN_MATH_MACRO_UNFOLD, "math-macro-unfold", ReadOnly | SingleParUpdate, Math },
709 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_FOLD
710 * \li Action: Fold a Math Macro.
711 * \li Notion: Fold the Math Macro the cursor is in if it was
712 unfolded, i.e. displayed as \foo before.
713 * \li Syntax: math-macro-fold
714 * \li Origin: sts, 06 January 2008
716 { LFUN_MATH_MACRO_FOLD, "math-macro-fold", ReadOnly | SingleParUpdate, Math },
718 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_ADD_PARAM
719 * \li Action: Add a parameter.
720 * \li Notion: Add a parameter to a Math Macro.
721 * \li Params: <NUM>: The number of the parameter behind which the new one
722 will be added (1 for the first, i.e. use 0 for add a
723 parameter at the left), defaults to the last one.
724 * \li Syntax: math-macro-add-param <NUM>
725 * \li Origin: sts, 06 January 2008
727 { LFUN_MATH_MACRO_ADD_PARAM, "math-macro-add-param", Noop, Math },
729 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_REMOVE_PARAM
730 * \li Action: Remove the last parameter.
731 * \li Notion: Remove the last parameter of a Math Macro and
732 remove its value in all instances of the macro
734 * \li Params: <NUM>: The number of the parameter to be deleted (1 for
735 the first), defaults to the last one.
736 * \li Syntax: math-macro-remove-param <NUM>
737 * \li Origin: sts, 06 January 2008
739 { LFUN_MATH_MACRO_REMOVE_PARAM, "math-macro-remove-param", Noop, Math },
741 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_APPEND_GREEDY_PARAM
742 * \li Action: Append a greedy parameter.
743 * \li Notion: Append a greedy parameter to a Math Macro which
744 eats the following mathed cell in every instance of
745 the macro in the buffer.
746 * \li Syntax: math-macro-append-greedy-param
747 * \li Origin: sts, 06 January 2008
749 { LFUN_MATH_MACRO_APPEND_GREEDY_PARAM, "math-macro-append-greedy-param", Noop, Math },
751 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_REMOVE_GREEDY_PARAM
752 * \li Action: Remove a greedy parameter.
753 * \li Notion: Remove a greedy parameter of a Math Macro and spit
754 out the values of it in every instance of the macro
755 in the buffer. If it is an optional parameter the [valud]
757 * \li Syntax: math-macro-remove-greedy-param
758 * \li Origin: sts, 06 January 2008
760 { LFUN_MATH_MACRO_REMOVE_GREEDY_PARAM, "math-macro-remove-greedy-param", Noop, Math },
762 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_MAKE_OPTIONAL
763 * \li Action: Make a parameter optional.
764 * \li Notion: Turn the first non-optional parameter of a Math Macro
765 into an optional parameter with a default value.
766 * \li Syntax: math-macro-make-optional
767 * \li Origin: sts, 06 January 2008
769 { LFUN_MATH_MACRO_MAKE_OPTIONAL, "math-macro-make-optional", Noop, Math },
771 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_MAKE_NONOPTIONAL
772 * \li Action: Make a parameter non-optional.
773 * \li Notion: Turn the last optional parameter of a Math Macro
774 into a non-optional parameter. The default value is
775 remembered to be reused later if the user changes his mind.
776 * \li Syntax: math-macro-make-nonoptional
777 * \li Origin: sts, 06 January 2008
779 { LFUN_MATH_MACRO_MAKE_NONOPTIONAL, "math-macro-make-nonoptional", Noop, Math },
781 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_ADD_OPTIONAL_PARAM
782 * \li Action: Add an optional parameter.
783 * \li Notion: Insert an optional parameter just behind the
784 already existing optional parameters.
785 * \li Syntax: math-macro-add-optional-param
786 * \li Origin: sts, 06 January 2008
788 { LFUN_MATH_MACRO_ADD_OPTIONAL_PARAM, "math-macro-add-optional-param", Noop, Math },
790 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_REMOVE_OPTIONAL_PARAM
791 * \li Action: Remove the last optional parameter.
792 * \li Notion: Remove the last optional parameter of a Math Macro and
793 remove it in all the instances of the macro in the buffer.
794 * \li Syntax: math-macro-remove-optional-param
795 * \li Origin: sts, 06 January 2008
797 { LFUN_MATH_MACRO_REMOVE_OPTIONAL_PARAM, "math-macro-remove-optional-param", Noop, Math },
799 * \var lyx::kb_action lyx::LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM
800 * \li Action: Add a greedy optional parameter.
801 * \li Notion: Add a greedy optional parameter which eats the value
802 from the following cells in mathed which are in the [value]
804 * \li Syntax: math-macro-add-greedy-optional-param
805 * \li Origin: sts, 06 January 2008
807 { LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM, "math-macro-add-greedy-optional-param", Noop, Math },
809 * \var lyx::kb_action lyx::LFUN_IN_MATHMACROTEMPLATE
810 * \li Action: Only active in Math Macro definition.
811 * \li Notion: Dummy function which is only active in a Math Macro definition.
812 It's used to toggle the Math Macro toolbar if the cursor moves
813 into a Math Macro definition.
814 * \li Syntax: in-mathmacrotemplate
815 * \li Origin: sts, 06 January 2008
817 { LFUN_IN_MATHMACROTEMPLATE, "in-mathmacrotemplate", Noop, Math },
819 { LFUN_PARAGRAPH_DOWN, "paragraph-down", ReadOnly | NoUpdate, Edit },
820 { LFUN_PARAGRAPH_DOWN_SELECT, "paragraph-down-select", ReadOnly, Edit },
821 { LFUN_PARAGRAPH_GOTO, "paragraph-goto", ReadOnly, Edit },
823 * \var lyx::kb_action lyx::LFUN_OUTLINE_UP
824 * \li Action: Move the current group in the upward direction in the
825 structure of the document.
826 * \li Notion: The "group" can be Part/Chapter/Section/etc. It moves
827 the whole substructure of the group.
828 * \li Syntax: outline-up
829 * \li Origin: Vermeer, 23 Mar 2006
831 { LFUN_OUTLINE_UP, "outline-up", Noop, Edit },
833 * \var lyx::kb_action lyx::LFUN_OUTLINE_DOWN
834 * \li Action: Move the current group in the downward direction in the
835 structure of the document.
836 * \li Notion: The "group" can be Part/Chapter/Section/etc. It moves
837 the whole substructure of the group.
838 * \li Syntax: outline-down
839 * \li Origin: Vermeer, 23 Mar 2006
841 { LFUN_OUTLINE_DOWN, "outline-down", Noop, Edit },
843 * \var lyx::kb_action lyx::LFUN_OUTLINE_IN
844 * \li Action: Moves the current group in the downward direction in the
845 hierarchy of the document structure.
846 * \li Notion: Part -> Chapter -> Section -> etc.
847 * \li Syntax: outline-in
848 * \li Origin: Vermeer, 23 Mar 2006
850 { LFUN_OUTLINE_IN, "outline-in", Noop, Edit },
852 * \var lyx::kb_action lyx::LFUN_OUTLINE_OUT
853 * \li Action: Moves the current group in the upward direction in the
854 hierarchy of the document structure.
855 * \li Notion: Part <- Chapter <- Section <- etc.
856 * \li Syntax: outline-out
857 * \li Origin: Vermeer, 23 Mar 2006
859 { LFUN_OUTLINE_OUT, "outline-out", Noop, Edit },
861 { LFUN_PARAGRAPH_SPACING, "paragraph-spacing", Noop, Edit },
862 { LFUN_PARAGRAPH_UP, "paragraph-up", ReadOnly | NoUpdate, Edit },
863 { LFUN_PARAGRAPH_UP_SELECT, "paragraph-up-select", ReadOnly, Edit },
865 { LFUN_EXTERNAL_EDIT, "external-edit", Noop, Edit },
866 { LFUN_GRAPHICS_EDIT, "graphics-edit", Noop, Edit },
868 { LFUN_CELL_BACKWARD, "cell-backward", Noop, Edit },
869 { LFUN_CELL_FORWARD, "cell-forward", Noop, Edit },
870 { LFUN_CELL_SPLIT, "cell-split", Noop, Edit },
871 { LFUN_TABULAR_INSERT, "tabular-insert", Noop, Edit },
872 { LFUN_TABULAR_FEATURE, "tabular-feature", Noop, Edit },
874 { LFUN_VC_CHECK_IN, "vc-check-in", ReadOnly, System },
875 { LFUN_VC_CHECK_OUT, "vc-check-out", ReadOnly, System },
876 { LFUN_VC_REGISTER, "vc-register", ReadOnly, System },
877 { LFUN_VC_REVERT, "vc-revert", ReadOnly, System },
878 { LFUN_VC_UNDO_LAST, "vc-undo-last", ReadOnly, System },
880 { LFUN_CHANGES_TRACK, "changes-track", Noop, Edit },
881 { LFUN_CHANGES_OUTPUT, "changes-output", Noop, Edit },
882 { LFUN_CHANGE_NEXT, "change-next", ReadOnly, Edit },
883 { LFUN_CHANGES_MERGE, "changes-merge", Noop, Edit },
884 { LFUN_CHANGE_ACCEPT, "change-accept", Noop, Edit },
885 { LFUN_CHANGE_REJECT, "change-reject", Noop, Edit },
886 { LFUN_ALL_CHANGES_ACCEPT, "all-changes-accept", Noop, Edit },
887 { LFUN_ALL_CHANGES_REJECT, "all-changes-reject", Noop, Edit },
889 { LFUN_INSET_APPLY, "inset-apply", Noop, Edit },
890 { LFUN_INSET_DISSOLVE, "inset-dissolve", Noop, Edit },
891 { LFUN_INSET_INSERT, "inset-insert", Noop, Edit },
892 { LFUN_INSET_MODIFY, "", Noop, Hidden },
893 { LFUN_INSET_DIALOG_UPDATE, "", Noop, Hidden },
894 { LFUN_INSET_SETTINGS, "inset-settings", ReadOnly, Edit },
895 { LFUN_INSET_REFRESH, "", Noop, Hidden },
896 { LFUN_NEXT_INSET_TOGGLE, "next-inset-toggle", ReadOnly, Edit },
897 { LFUN_INSET_TOGGLE, "", ReadOnly, Hidden },
898 { LFUN_ALL_INSETS_TOGGLE, "all-insets-toggle", ReadOnly, Edit },
901 * \var lyx::kb_action lyx::LFUN_PARAGRAPH_PARAMS
902 * \li Action: Change paragraph settings.
903 * \li Notion: Modifies the current paragraph, or currently selected paragraphs.
904 This function only modifies, and does not override, existing settings.
905 Note that the "leftindent" indent setting is deprecated.
906 * \li Syntax: paragraph-params [<INDENT>] [<SPACING>] [<ALIGN>] [<OTHERS>]
907 * \li Params: <INDENT>: \\noindent|\\indent|\\indent-toggle|\\leftindent LENGTH\n
908 <SPACING>: \\paragraph_spacing default|single|onehalf|double|other\n
909 <ALIGN>: \\align block|left|right|center|default\n
910 <OTHERS>: \\labelwidthstring WIDTH|\\start_of_appendix\n
911 * \li Origin: rgh, Aug 15 2007
913 { LFUN_PARAGRAPH_PARAMS, "paragraph-params", Noop, Edit },
915 * \var lyx::kb_action lyx::LFUN_PARAGRAPH_PARAMS_APPLY
916 * \li Action: Change paragraph settings.
917 * \li Notion: Overwrite all nonspecified settings to the default ones.
918 Use paragraph-params lfun if you don't want to overwrite others settings.
919 * \li Syntax: paragraph-params-apply <INDENT> <SPACING> <ALIGN> <OTHERS>
920 * \li Params: For parameters see LFUN_PARAGRAPH_PARAMS
921 * \li Origin: leeming, 30 Mar 2004
923 { LFUN_PARAGRAPH_PARAMS_APPLY, "paragraph-params-apply", Noop, Edit },
924 { LFUN_PARAGRAPH_UPDATE, "", Noop, Hidden },
927 * \var lyx::kb_action lyx::LFUN_FINISHED_FORWARD
928 * \li Action: Moves the cursor out of the current slice, going forward.
929 * \li Notion: Cursor movement within an inset may be different than cursor
930 movement in the surrounding text. This action should be called
931 automatically by the cursor movement within the inset, when
932 movement within the inset has ceased (reached the end of the
933 last paragraph, for example), in order to move correctly
934 back into the surrounding text.
935 * \li Syntax: finished-forward
937 { LFUN_FINISHED_FORWARD, "", ReadOnly, Hidden },
939 * \var lyx::kb_action lyx::LFUN_FINISHED_BACKWARD
940 * \li Action: Moves the cursor out of the current slice, going backwards.
941 * \li Notion: See also #LFUN_FINISHED_FORWARD.
942 * \li Syntax: finished-backward
944 { LFUN_FINISHED_BACKWARD, "", ReadOnly, Hidden },
946 * \var lyx::kb_action lyx::LFUN_FINISHED_RIGHT
947 * \li Action: Moves the cursor out of the current slice, going right.
948 * \li Notion: See also #LFUN_FINISHED_FORWARD
949 * \li Syntax: finished-right
951 { LFUN_FINISHED_RIGHT, "", ReadOnly, Hidden },
953 * \var lyx::kb_action lyx::LFUN_FINISHED_LEFT
954 * \li Action: Moves the cursor out of the current slice, going left.
955 * \li Notion: See also #LFUN_FINISHED_FORWARD.
956 * \li Syntax: finished-left
958 { LFUN_FINISHED_LEFT, "", ReadOnly, Hidden },
960 { LFUN_LANGUAGE, "language", Noop, Edit },
962 { LFUN_LABEL_GOTO, "label-goto", ReadOnly, Edit },
963 { LFUN_LABEL_INSERT, "label-insert", Noop, Edit },
964 { LFUN_REFERENCE_NEXT, "reference-next", ReadOnly, Edit },
967 * \var lyx::kb_action lyx::LFUN_BOOKMARK_GOTO
968 * \li Action: Goto a bookmark.
969 * \li Notion: Moves the cursor to the numbered bookmark, opening the file
970 if necessary. Note that bookmarsk are saved per-session, not
972 * \li Syntax: bookmark-goto <NUMBER>
973 * \li Params: <NUMBER>: the number of the bookmark to restore.
974 * \li Origin: Dekel, 27 January 2001
976 { LFUN_BOOKMARK_GOTO, "bookmark-goto", NoBuffer, Edit },
978 * \var lyx::kb_action lyx::LFUN_BOOKMARK_SAVE
979 * \li Action: Save a bookmark.
980 * \li Notion: Saves a numbered bookmark to the sessions file. The number
981 must be between 1 and 9, inclusive. Note that bookmarks are
982 saved per-session, not per file.
983 * \li Syntax: bookmark-save <NUMBER>
984 * \li Params: <NUMBER>: the number of the bookmark to save.
985 * \li Origin: Dekel, 27 January 2001
987 { LFUN_BOOKMARK_SAVE, "bookmark-save", ReadOnly, Edit },
989 * \var lyx::kb_action lyx::LFUN_BOOKMARK_CLEAR
990 * \li Action: Clears the list of saved bookmarks.
991 * \li Syntax: bookmark-clear
992 * \li Origin: bpeng, 31 October 2006
994 { LFUN_BOOKMARK_CLEAR, "bookmark-clear", NoBuffer, Edit },
996 { LFUN_HELP_OPEN, "help-open", NoBuffer | Argument, Buffer },
998 * \var lyx::kb_action lyx::LFUN_LYX_QUIT
999 * \li Action: Terminates the current LyX instance.
1000 * \li Notion: Terminates the current LyX instance, asking whether to save
1001 modified documents, etc.
1002 * \li Syntax: lyx-quit
1004 { LFUN_LYX_QUIT, "lyx-quit", NoBuffer, Buffer },
1005 { LFUN_TOOLBAR_TOGGLE, "toolbar-toggle", NoBuffer, Buffer },
1006 { LFUN_MENU_OPEN, "menu-open", NoBuffer, Buffer },
1008 { LFUN_WINDOW_NEW, "window-new", NoBuffer, Buffer },
1009 { LFUN_WINDOW_CLOSE, "window-close", NoBuffer, Buffer },
1011 { LFUN_DIALOG_SHOW, "dialog-show", NoBuffer, Edit },
1012 { LFUN_DIALOG_SHOW_NEW_INSET, "dialog-show-new-inset", Noop, Edit },
1013 { LFUN_DIALOG_UPDATE, "dialog-update", NoBuffer, Edit },
1014 { LFUN_DIALOG_HIDE, "dialog-hide", NoBuffer, Edit },
1015 { LFUN_DIALOG_TOGGLE, "dialog-toggle", NoBuffer, Edit },
1016 { LFUN_DIALOG_DISCONNECT_INSET, "dialog-disconnect-inset", Noop, Edit },
1018 { LFUN_MOUSE_PRESS, "", ReadOnly, Hidden },
1019 { LFUN_MOUSE_MOTION, "", ReadOnly | SingleParUpdate, Hidden },
1020 { LFUN_MOUSE_RELEASE, "", ReadOnly, Hidden },
1021 { LFUN_MOUSE_DOUBLE, "", ReadOnly, Hidden },
1022 { LFUN_MOUSE_TRIPLE, "", ReadOnly, Hidden },
1024 { LFUN_KEYMAP_OFF, "keymap-off", ReadOnly, Edit },
1025 { LFUN_KEYMAP_PRIMARY, "keymap-primary", ReadOnly, Edit },
1026 { LFUN_KEYMAP_SECONDARY, "keymap-secondary", ReadOnly, Edit },
1027 { LFUN_KEYMAP_TOGGLE, "keymap-toggle", ReadOnly, Edit },
1029 { LFUN_MESSAGE, "message", NoBuffer, System },
1030 { LFUN_FLOAT_LIST, "float-list", Noop, Edit },
1031 { LFUN_ESCAPE, "escape", ReadOnly, Edit },
1033 { LFUN_SERVER_CHAR_AFTER, "server-char-after", ReadOnly, System },
1034 { LFUN_SERVER_GET_FONT, "server-get-font", ReadOnly, System },
1035 { LFUN_SERVER_GET_LAYOUT, "server-get-layout", ReadOnly, System },
1036 { LFUN_SERVER_GET_NAME, "server-get-name", ReadOnly, System },
1037 { LFUN_SERVER_GET_XY, "server-get-xy", ReadOnly, System },
1038 { LFUN_SERVER_GOTO_FILE_ROW, "server-goto-file-row", ReadOnly, System },
1039 { LFUN_SERVER_NOTIFY, "server-notify", ReadOnly, System },
1040 { LFUN_SERVER_SET_XY, "server-set-xy", ReadOnly, System },
1042 { LFUN_BUILD_PROGRAM, "build-program", ReadOnly, Buffer },
1045 * \var lyx::kb_action lyx::LFUN_BUFFER_AUTO_SAVE
1046 * \li Action: Saves the current buffer to a temporary file.
1047 * \li Notion: Saves the current buffer to a file named "#filename#". This LFUN
1048 is called automatically by LyX, to "autosave" the current buffer.
1049 * \li Syntax: buffer-auto-save
1051 { LFUN_BUFFER_AUTO_SAVE, "buffer-auto-save", Noop, Buffer },
1052 { LFUN_BUFFER_CHILD_OPEN, "buffer-child-open", ReadOnly, Buffer },
1053 { LFUN_BUFFER_CHKTEX, "buffer-chktex", ReadOnly, Buffer },
1054 { LFUN_BUFFER_TOGGLE_COMPRESSION, "buffer-toggle-compression", Noop, Buffer },
1055 { LFUN_BUFFER_TOGGLE_EMBEDDING, "buffer-toggle-embedding", Noop, Buffer },
1057 * \var lyx::kb_action lyx::LFUN_BUFFER_CLOSE
1058 * \li Action: Closes the current buffer.
1059 * \li Notion: Closes the current buffer, asking whether to save it, etc,
1060 if the buffer has been modified.
1061 * \li Syntax: buffer-close
1063 { LFUN_BUFFER_CLOSE, "buffer-close", ReadOnly, Buffer },
1065 * \var lyx::kb_action lyx::LFUN_BUFFER_EXPORT
1066 * \li Action: Exports the current buffer (document) to the given format.
1067 * \li Syntax: buffer-export <FORMAT>
1068 * \li Params: <FORMAT> is either "custom" or one of the formats which you
1069 can find in Tools->Preferences->File formats->Format.
1070 Usual format you will enter is "pdf2" (pdflatex),
1071 "pdflatex" (plain tex for pdflatex) or "ps" for postscript.
1072 In case of "custom" you will be asked for a format you
1073 want to start from and for the command that you want to
1074 apply to this format.
1075 * \li Origin: Lgb, 29 Jul 1997
1077 { LFUN_BUFFER_EXPORT, "buffer-export", ReadOnly, Buffer },
1078 { LFUN_BUFFER_EXPORT_CUSTOM, "buffer-export-custom", ReadOnly, Buffer },
1079 { LFUN_BUFFER_PRINT, "buffer-print", ReadOnly, Buffer },
1080 { LFUN_BUFFER_IMPORT, "buffer-import", NoBuffer, Buffer },
1082 * \var lyx::kb_action lyx::LFUN_BUFFER_NEW
1083 * \li Action: Creates a new buffer (that is, document).
1084 * \li Syntax: buffer-new
1086 { LFUN_BUFFER_NEW, "buffer-new", NoBuffer, Buffer },
1087 { LFUN_BUFFER_NEW_TEMPLATE,"buffer-new-template", NoBuffer, Buffer },
1088 { LFUN_BUFFER_RELOAD, "buffer-reload", ReadOnly, Buffer },
1089 { LFUN_BUFFER_SWITCH, "buffer-switch", NoBuffer | ReadOnly, Buffer },
1090 { LFUN_BUFFER_TOGGLE_READ_ONLY, "buffer-toggle-read-only", ReadOnly, Buffer },
1091 { LFUN_BUFFER_UPDATE, "buffer-update", ReadOnly, Buffer },
1093 * \var lyx::kb_action lyx::LFUN_BUFFER_VIEW
1094 * \li Action: Displays current buffer in chosen format.
1095 * \li Notion: Displays the contents of the current buffer in the chosen
1096 format, for example, PDF or DVI. This runs the necessary
1097 converter, calls the defined viewer, and so forth.
1098 * \li Syntax: buffer-view <FORMAT>
1099 * \li Params: <FORMAT>: The format to display, where this is one of the
1100 formats defined (in the current GUI) in the
1101 Tools>Preferences>File Formats dialog.
1103 { LFUN_BUFFER_VIEW, "buffer-view", ReadOnly, Buffer },
1105 * \var lyx::kb_action lyx::LFUN_BUFFER_WRITE
1106 * \li Action: Saves the current buffer.
1107 * \li Notion: Saves the current buffer to disk, using the filename that
1108 is already associated with the buffer, asking for one if
1109 none is yet assigned.
1110 * \li Syntax: buffer-write
1112 { LFUN_BUFFER_WRITE, "buffer-write", ReadOnly, Buffer },
1114 * \var lyx::kb_action lyx::LFUN_BUFFER_WRITE_AS
1115 * \li Action: Rename and save current buffer.
1116 * \li Syntax: buffer-write-as <FILENAME>
1117 * \li Params: <FILENAME>: New name of the buffer/file. A relative path
1118 * is with respect to the original location of the buffer/file.
1120 { LFUN_BUFFER_WRITE_AS, "buffer-write-as", ReadOnly, Buffer },
1121 { LFUN_BUFFER_WRITE_ALL, "buffer-write-all", ReadOnly, Buffer },
1122 { LFUN_BUFFER_NEXT, "buffer-next", ReadOnly, Buffer },
1123 { LFUN_BUFFER_PREVIOUS, "buffer-previous", ReadOnly, Buffer },
1124 { LFUN_MASTER_BUFFER_UPDATE, "master-buffer-update", ReadOnly, Buffer },
1125 { LFUN_MASTER_BUFFER_VIEW, "master-buffer-view", ReadOnly, Buffer },
1126 { LFUN_BUFFER_LANGUAGE, "buffer-language", Noop, Buffer },
1127 { LFUN_BUFFER_SAVE_AS_DEFAULT, "buffer-save-as-default", Noop, Buffer },
1128 { LFUN_BUFFER_PARAMS_APPLY, "buffer-params-apply", Noop, Buffer },
1130 { LFUN_FILE_INSERT, "file-insert", Noop, Edit },
1131 { LFUN_FILE_INSERT_PLAINTEXT, "file-insert-plaintext", Noop, Edit },
1132 { LFUN_FILE_INSERT_PLAINTEXT_PARA, "file-insert-plaintext-para", Noop, Edit },
1133 { LFUN_FILE_NEW, "file-new", NoBuffer, Buffer },
1134 { LFUN_FILE_OPEN, "file-open", NoBuffer, Buffer },
1138 * \var lyx::kb_action lyx::LFUN_CALL
1139 * \li Action: Executes a command defined in a .def file.
1140 * \li Notion: The definitions are by default read from lib/commands/default.def .
1141 A .def file allows to define a command with \\define "<NAME>" "<LFUN>"
1142 where <NAME> is the name of the new command and <LFUN> is the lfun code
1143 to be executed (see e.g. #LFUN_COMMAND_SEQUENCE).
1144 \\def_file "FileName" allows to include another .def file. \n
1145 This is particularly useful in connection with toolbar buttons:
1146 Since the name of the button image for this lfun is
1147 lib/images/commands/<NAME>.png this is the way to assign an image
1148 to a complex command-sequence.
1149 * \li Syntax: call <NAME>
1150 * \li Params: <NAME>: Name of the command that must be called.
1151 * \li Origin: broider, 2 Oct 2007
1153 { LFUN_CALL, "call", NoBuffer, System },
1155 * \var lyx::kb_action lyx::LFUN_META_PREFIX
1156 * \li Action: Simulate halting Meta key (Alt key on PCs).
1157 * \li Notion: Used for buffer editation not for GUI control.
1158 * \li Syntax: meta-prefix
1160 { LFUN_META_PREFIX, "meta-prefix", NoBuffer, System },
1162 * \var lyx::kb_action lyx::LFUN_CANCEL
1163 * \li Action: Cancels sequence prepared by #LFUN_META_PREFIX .
1164 * \li Syntax: cancel
1166 { LFUN_CANCEL, "cancel", NoBuffer, System },
1169 * \var lyx::kb_action lyx::LFUN_COMMAND_EXECUTE
1170 * \li Action: Opens the minibuffer toolbar so that the user can type in there.
1171 * \li Notion: Usually bound to M-x shortcut.
1172 * \li Syntax: command-execute
1174 { LFUN_COMMAND_EXECUTE, "command-execute", NoBuffer, Edit },
1175 { LFUN_COMMAND_PREFIX, "command-prefix", NoBuffer, Hidden },
1177 * \var lyx::kb_action lyx::LFUN_COMMAND_SEQUENCE
1178 * \li Action: Run more commands (LFUN and its parameters) in a sequence.
1179 * \li Syntax: command-sequence <CMDS>
1180 * \li Params: <CMDS>: Sequence of commands separated by semicolons.
1181 * \li Sample: command-sequence cut; ert-insert; self-insert \; paste; self-insert {}; inset-toggle;
1182 * \li Origin: Andre', 11 Nov 1999
1184 { LFUN_COMMAND_SEQUENCE, "command-sequence", NoBuffer, System },
1187 * \var lyx::kb_action lyx::LFUN_PREFERENCES_SAVE
1188 * \li Action: Save user preferences.
1189 * \li Syntax: preferences-save
1190 * \li Origin: Lgb, 27 Nov 1999
1192 { LFUN_PREFERENCES_SAVE, "preferences-save", NoBuffer, System },
1194 * \var lyx::kb_action lyx::LFUN_RECONFIGURE
1195 * \li Action: Reconfigure the automatic settings.
1196 * \li Syntax: reconfigure
1197 * \li Origin: Asger, 14 Feb 1997
1199 { LFUN_RECONFIGURE, "reconfigure", NoBuffer, System },
1201 * \var lyx::kb_action lyx::LFUN_LYXRC_APPLY
1202 * \li Action: Apply the given settings to user preferences.
1203 * \li Syntax: lyxrc-apply <SETTINGS>
1204 * \li Params: <SETTINGS>: settings which are to be set. Take a look into ~/.lyx/preferences
1205 to get an idea which commands to use and their syntax.
1206 #lyx::LyXRC::LyXRCTags has the list of possible commands.
1208 { LFUN_LYXRC_APPLY, "lyxrc-apply", NoBuffer, System },
1210 * \var lyx::kb_action lyx::LFUN_TOGGLE_CURSOR_FOLLOWS_SCROLLBAR
1211 * \li Action: Determine whether keep cursor inside the editing window regardless
1212 the scrollbar movement.
1213 * \li Syntax: toggle-cursor-follows-scrollbar
1214 * \li Origin: ARRae, 2 Dec 1997
1216 { LFUN_TOGGLE_CURSOR_FOLLOWS_SCROLLBAR, "toggle-cursor-follows-scrollbar", ReadOnly, System },
1218 * \var lyx::kb_action lyx::LFUN_SET_COLOR
1219 * \li Action: Set the given LyX color to the color defined by the X11 name given.
1220 * \li Notion: A new color entry is created if the color is unknown.
1221 Color names can be stored as a part of user settings.
1222 * \li Syntax: set-color <LYX_NAME> <X11_NAME>
1223 * \li Origin: SLior, 11 Jun 2000
1225 { LFUN_SET_COLOR, "set-color", ReadOnly | NoBuffer, System },
1227 * \var lyx::kb_action lyx::LFUN_STATISTICS
1228 * \li Action: Count the statistics (number of words and characters)
1229 in the document or in the given selection.
1230 * \li Notion: Note that this function gives the number of words/chars written,
1231 not the number of characters which will be typeset.
1232 * \li Syntax: statistics
1233 * \li Origin: lasgouttes, Jan 27 2004; ps, Jan 8 2008
1235 { LFUN_STATISTICS, "statistics", ReadOnly, System },
1237 { LFUN_NOACTION, "", Noop, Hidden }
1238 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1241 for (int i = 0; items[i].action != LFUN_NOACTION; ++i) {
1242 newFunc(items[i].action, items[i].name, items[i].attrib, items[i].type);
1249 LyXAction::LyXAction()
1255 // Returns an action tag from a string.
1256 FuncRequest LyXAction::lookupFunc(string const & func) const
1258 string const func2 = trim(func);
1260 if (func2.empty()) {
1261 return FuncRequest(LFUN_NOACTION);
1265 string const arg = split(func2, cmd, ' ');
1267 func_map::const_iterator fit = lyx_func_map.find(cmd);
1269 return fit != lyx_func_map.end() ? FuncRequest(fit->second, arg) : FuncRequest(LFUN_UNKNOWN_ACTION);
1273 string const LyXAction::getActionName(kb_action action) const
1275 info_map::const_iterator const it = lyx_info_map.find(action);
1276 return it != lyx_info_map.end() ? it->second.name : string();
1280 LyXAction::func_type const LyXAction::getActionType(kb_action action) const
1282 info_map::const_iterator const it = lyx_info_map.find(action);
1283 return it != lyx_info_map.end() ? it->second.type : Hidden;
1287 bool LyXAction::funcHasFlag(kb_action action,
1288 LyXAction::func_attrib flag) const
1290 info_map::const_iterator ici = lyx_info_map.find(action);
1292 if (ici == lyx_info_map.end()) {
1293 LYXERR0("action: " << action << " is not known.");
1294 BOOST_ASSERT(false);
1297 return ici->second.attrib & flag;
1301 LyXAction::const_func_iterator LyXAction::func_begin() const
1303 return lyx_func_map.begin();
1307 LyXAction::const_func_iterator LyXAction::func_end() const
1309 return lyx_func_map.end();