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 "ParagraphList_fwd.h"
19 #include "support/docstring.h"
34 std::vector<docstring> const availableSelections(Buffer const & buffer);
36 size_type numberOfSelections();
38 docstring getSelection(Buffer const & buffer, size_t sel_index);
40 /* Replace using the font of the first selected character and select
41 * the new string. When \c backwards == false, set anchor before
42 * cursor; otherwise set cursor before anchor.
44 void replaceSelectionWithString(LCursor & cur, docstring const & str,
46 /// replace selection helper
47 void replaceSelection(LCursor & cur);
50 void cutSelection(LCursor & cur, bool doclear = true, bool realcut = true);
52 void copySelection(LCursor & cur);
54 void pasteSelection(LCursor & cur, ErrorList &, size_t sel_index = 0);
56 /// Paste the paragraph list \p parlist at the position given by \p cur.
57 /// Does not handle undo. Does only work in text, not mathed.
58 void pasteParagraphList(LCursor & cur, ParagraphList const & parlist,
59 textclass_type textclass, ErrorList & errorList);
62 /** Needed to switch between different classes. This works
63 * for a list of paragraphs beginning with the specified par.
64 * It changes layouts and character styles.
66 void switchBetweenClasses(textclass_type c1, textclass_type c2,
67 InsetText & in, ErrorList &);
70 docstring grabSelection(LCursor const & cur);
72 void eraseSelection(LCursor & cur);
74 docstring grabAndEraseSelection(LCursor & cur);
75 // other selection methods
77 void selDel(LCursor & cur);
78 /// clears or deletes selection depending on lyxrc setting
79 void selClearOrDel(LCursor & cur);
80 /// pastes n-th element of cut buffer
81 void selPaste(LCursor & cur, size_t n);
83 /** Tabular has its own paste stack for multiple cells
84 * but it needs to know whether there is a more recent
85 * ordinary paste. Therefore which one is newer.
87 //FIXME: this is a workaround for bug 1919. Replace this by
88 //an all-for-one-paste mechanism in 1.5
89 /// store whether tabular or ordinary paste stack is newer
90 void dirtyTabularStack(bool b);
91 /// is the tabular paste stack newer than the ordinary one?
92 bool tabularStackDirty();