]> git.lyx.org Git - lyx.git/blob - src/CutAndPaste.h
* remove various xforms relicts, in particular:
[lyx.git] / src / CutAndPaste.h
1 // -*- C++ -*-
2 /**
3  * \file CutAndPaste.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Jürgen Vigna
8  * \author Lars Gullik Bjønnes
9  * \author Alfredo Braunstein
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef CUTANDPASTE_H
15 #define CUTANDPASTE_H
16
17 #include "ParagraphList_fwd.h"
18
19 #include "support/types.h"
20
21 #include <string>
22 #include <vector>
23
24 class Buffer;
25 class ErrorList;
26 class InsetText;
27 class LyXTextClass;
28 class LCursor;
29
30 ///
31 namespace lyx {
32 namespace cap {
33
34 ///
35 std::vector<std::string> const availableSelections(Buffer const & buffer);
36 ///
37 lyx::size_type numberOfSelections();
38 ///
39 std::string getSelection(Buffer const & buffer, size_t sel_index);
40
41 ///
42 void cutSelection(LCursor & cur, bool doclear, bool realcut);
43
44 /**
45  * Sets the selection from the current cursor position to length
46  * characters to the right. No safety checks.
47  */
48 void setSelectionRange(LCursor & cur, lyx::pos_type length);
49 /// simply replace using the font of the first selected character
50 void replaceSelectionWithString(LCursor & cur, std::string const & str);
51 /// replace selection helper
52 void replaceSelection(LCursor & cur);
53
54 ///
55 void cutSelection(LCursor & cur, bool doclear = true, bool realcut = true);
56 ///
57 void copySelection(LCursor & cur);
58 ///
59 void pasteSelection(LCursor & cur, size_t sel_index = 0);
60
61 ///
62 void pasteParagraphList(LCursor & cur, ParagraphList const & parlist,
63                         textclass_type textclass);
64
65
66 /** Needed to switch between different classes. This works
67  *  for a list of paragraphs beginning with the specified par.
68  *  It changes layouts and character styles.
69  */
70 void switchBetweenClasses(lyx::textclass_type c1,
71                           lyx::textclass_type c2,
72                           InsetText & in, ErrorList &);
73
74 // only used by the spellchecker
75 void replaceWord(LCursor & cur, std::string const & replacestring);
76
77 ///
78 std::string grabSelection(LCursor const & cur);
79 ///
80 void eraseSelection(LCursor & cur);
81 ///
82 std::string grabAndEraseSelection(LCursor & cur);
83 // other selection methods
84 ///
85 void selCut(LCursor & cur);
86 ///
87 void selDel(LCursor & cur);
88 /// clears or deletes selection depending on lyxrc setting
89 void selClearOrDel(LCursor & cur);
90 /// pastes n-th element of cut buffer
91 void selPaste(LCursor & cur, size_t n);
92
93 /** Tabular has its own paste stack for multiple cells
94  *  but it needs to know whether there is a more recent
95  *  ordinary paste. Therefore which one is newer.
96  */
97 //FIXME: this is a workaround for bug 1919. Replace this by
98 //an all-for-one-paste mechanism in 1.5
99 /// store whether tabular or ordinary paste stack is newer
100 void dirtyTabularStack(bool b);
101 /// is the tabular paste stack newer than the ordinary one?
102 bool tabularStackDirty();
103 } // namespace cap
104 } // namespce lyx
105
106 #endif