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/types.h"
35 std::vector<std::string> const availableSelections(Buffer const & buffer);
37 lyx::size_type numberOfSelections();
39 std::string getSelection(Buffer const & buffer, size_t sel_index);
42 void cutSelection(LCursor & cur, bool doclear, bool realcut);
44 /* Replace using the font of the first selected character and select
45 * the new string. When \c backwards == false, set anchor before
46 * cursor; otherwise set cursor before anchor.
48 void replaceSelectionWithString(LCursor & cur, std::string const & str,
50 /// replace selection helper
51 void replaceSelection(LCursor & cur);
54 void cutSelection(LCursor & cur, bool doclear = true, bool realcut = true);
56 void copySelection(LCursor & cur);
58 void pasteSelection(LCursor & cur, ErrorList &, size_t sel_index = 0);
61 void pasteParagraphList(LCursor & cur, ParagraphList const & parlist,
62 textclass_type textclass, ErrorList & errorList);
65 /** Needed to switch between different classes. This works
66 * for a list of paragraphs beginning with the specified par.
67 * It changes layouts and character styles.
69 void switchBetweenClasses(lyx::textclass_type c1,
70 lyx::textclass_type c2,
71 InsetText & in, ErrorList &);
74 std::string grabSelection(LCursor const & cur);
76 void eraseSelection(LCursor & cur);
78 std::string grabAndEraseSelection(LCursor & cur);
79 // other selection methods
81 void selCut(LCursor & cur);
83 void selDel(LCursor & cur);
84 /// clears or deletes selection depending on lyxrc setting
85 void selClearOrDel(LCursor & cur);
86 /// pastes n-th element of cut buffer
87 void selPaste(LCursor & cur, size_t n);
89 /** Tabular has its own paste stack for multiple cells
90 * but it needs to know whether there is a more recent
91 * ordinary paste. Therefore which one is newer.
93 //FIXME: this is a workaround for bug 1919. Replace this by
94 //an all-for-one-paste mechanism in 1.5
95 /// store whether tabular or ordinary paste stack is newer
96 void dirtyTabularStack(bool b);
97 /// is the tabular paste stack newer than the ordinary one?
98 bool tabularStackDirty();