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<lyx::docstring> const availableSelections(Buffer const & buffer);
36 lyx::size_type numberOfSelections();
38 lyx::docstring getSelection(Buffer const & buffer, size_t sel_index);
41 void cutSelection(LCursor & cur, bool doclear, bool realcut);
43 /* Replace using the font of the first selected character and select
44 * the new string. When \c backwards == false, set anchor before
45 * cursor; otherwise set cursor before anchor.
47 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, ErrorList &, size_t sel_index = 0);
60 void pasteParagraphList(LCursor & cur, ParagraphList const & parlist,
61 textclass_type textclass, ErrorList & errorList);
64 /** Needed to switch between different classes. This works
65 * for a list of paragraphs beginning with the specified par.
66 * It changes layouts and character styles.
68 void switchBetweenClasses(lyx::textclass_type c1,
69 lyx::textclass_type c2,
70 InsetText & in, ErrorList &);
73 std::string grabSelection(LCursor const & cur);
75 void eraseSelection(LCursor & cur);
77 std::string grabAndEraseSelection(LCursor & cur);
78 // other selection methods
80 void selCut(LCursor & cur);
82 void selDel(LCursor & cur);
83 /// clears or deletes selection depending on lyxrc setting
84 void selClearOrDel(LCursor & cur);
85 /// pastes n-th element of cut buffer
86 void selPaste(LCursor & cur, size_t n);
88 /** Tabular has its own paste stack for multiple cells
89 * but it needs to know whether there is a more recent
90 * ordinary paste. Therefore which one is newer.
92 //FIXME: this is a workaround for bug 1919. Replace this by
93 //an all-for-one-paste mechanism in 1.5
94 /// store whether tabular or ordinary paste stack is newer
95 void dirtyTabularStack(bool b);
96 /// is the tabular paste stack newer than the ordinary one?
97 bool tabularStackDirty();