4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
8 * \author Lars Gullik Bjønnes
9 * \author Alfredo Braunstein
11 * Full author contact details are available in file CREDITS.
17 #include "support/types.h"
33 std::vector<std::string> const availableSelections(Buffer const & buffer);
35 lyx::size_type numberOfSelections();
37 std::string getSelection(Buffer const & buffer, size_t sel_index);
40 void cutSelection(LCursor & cur, bool doclear, bool realcut);
43 * Sets the selection from the current cursor position to length
44 * characters to the right. No safety checks.
46 void setSelectionRange(LCursor & cur, lyx::pos_type length);
47 /// simply replace using the font of the first selected character
48 void replaceSelectionWithString(LCursor & cur, std::string const & str);
49 /// replace selection helper
50 void replaceSelection(LCursor & cur);
53 void cutSelection(LCursor & cur, bool doclear = true, bool realcut = true);
55 void copySelection(LCursor & cur);
57 void pasteSelection(LCursor & cur, size_t sel_index = 0);
59 /** Needed to switch between different classes. This works
60 * for a list of paragraphs beginning with the specified par.
61 * It changes layouts and character styles.
63 void SwitchBetweenClasses(lyx::textclass_type c1,
64 lyx::textclass_type c2,
68 // only used by the spellchecker
69 void replaceWord(LCursor & cur, std::string const & replacestring);
72 std::string grabSelection(LCursor const & cur);
74 void eraseSelection(LCursor & cur);
76 std::string grabAndEraseSelection(LCursor & cur);
77 // other selection methods
79 void selCut(LCursor & cur);
81 void selDel(LCursor & cur);
82 /// clears or deletes selection depending on lyxrc setting
83 void selClearOrDel(LCursor & cur);
84 /// pastes n-th element of cut buffer
85 void selPaste(LCursor & cur, size_t n);
87 /** Tabular has its own paste stack for multiple cells
88 * but it needs to know whether there is a more recent
89 * ordinary paste. Therefore which one is newer.
91 //FIXME: this is a workaround for bug 1919. Replace this by
92 //an all-for-one-paste mechanism in 1.5
93 /// store whether tabular or ordinary paste stack is newer
94 void dirtyTabularStack(bool b);
95 /// is the tabular paste stack newer than the ordinary one?
96 bool tabularStackDirty();