]> git.lyx.org Git - lyx.git/blob - src/CutAndPaste.h
float2string #4 (Spacing)
[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 "support/types.h"
18
19 #include <string>
20 #include <vector>
21
22 class Buffer;
23 class ErrorList;
24 class LyXTextClass;
25 class LCursor;
26 class ParagraphList;
27
28 ///
29 namespace lyx {
30 namespace cap {
31
32 ///
33 std::vector<std::string> const availableSelections(Buffer const & buffer);
34 ///
35 std::string getSelection(Buffer const & buffer, size_t sel_index);
36
37 ///
38 void cutSelection(LCursor & cur, bool doclear, bool realcut);
39
40 /**
41  * Sets the selection from the current cursor position to length
42  * characters to the right. No safety checks.
43  */
44 void setSelectionRange(LCursor & cur, lyx::pos_type length);
45 /// simply replace using the font of the first selected character
46 void replaceSelectionWithString(LCursor & cur, std::string const & str);
47 /// replace selection helper
48 void replaceSelection(LCursor & cur);
49
50 ///
51 void cutSelection(LCursor & cur, bool doclear = true, bool realcut = true);
52 ///
53 void copySelection(LCursor & cur);
54 ///
55 void pasteSelection(LCursor & cur, size_t sel_index = 0);
56
57 /** Needed to switch between different classes. This works
58  *  for a list of paragraphs beginning with the specified par
59  *  return value is the number of wrong conversions.
60  */
61 int SwitchLayoutsBetweenClasses(lyx::textclass_type c1,
62                                 lyx::textclass_type c2,
63                                 ParagraphList & par,
64                                 ErrorList &);
65
66 // only used by the spellchecker
67 void replaceWord(LCursor & cur, std::string const & replacestring);
68
69 ///
70 std::string grabSelection(LCursor & cur);
71 ///
72 void eraseSelection(LCursor & cur);
73 ///
74 std::string grabAndEraseSelection(LCursor & cur);
75 // other selection methods
76 ///
77 void selCut(LCursor & cur);
78 ///
79 void selDel(LCursor & cur);
80 /// clears or deletes selection depending on lyxrc setting
81 void selClearOrDel(LCursor & cur);
82 /// pastes n-th element of cut buffer
83 void selPaste(LCursor & cur, size_t n);
84 } // namespace cap
85 } // namespce lyx
86
87 #endif