]> git.lyx.org Git - lyx.git/blob - src/CutAndPaste.h
move some selection related stuff over to textcursor.C
[lyx.git] / src / CutAndPaste.h
1 // -*- C++ -*-
2 /* \file CutAndPaste.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Jurgen Vigna
7  * \author Lars Gullik Bjønnes
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef CUTANDPASTE_H
13 #define CUTANDPASTE_H
14
15 #include "support/types.h"
16 #include "ParagraphList.h"
17
18 #include <vector>
19
20 class Paragraph;
21 class BufferParams;
22 class LyXTextClass;
23 class ErrorList;
24
25 ///
26 namespace CutAndPaste {
27
28 ///
29 std::vector<string>
30 CutAndPaste::availableSelections(Buffer const & buffer);
31
32 ///
33 PitPosPair cutSelection(BufferParams const & params,
34                         ParagraphList & pars,
35                         ParagraphList::iterator startpit,
36                         ParagraphList::iterator endpit,
37                         int start, int end, lyx::textclass_type tc,
38                         bool doclear = false);
39 ///
40 PitPosPair eraseSelection(BufferParams const & params,
41                           ParagraphList & pars,
42                           ParagraphList::iterator startpit,
43                           ParagraphList::iterator endpit,
44                           int start, int end, bool doclear = false);
45 ///
46 bool copySelection(ParagraphList::iterator startpit,
47                    ParagraphList::iterator endpit,
48                    int start, int end, lyx::textclass_type tc);
49 ///
50 std::pair<PitPosPair, ParagraphList::iterator>
51 pasteSelection(Buffer const & buffer,
52                ParagraphList & pars,
53                ParagraphList::iterator pit, int pos,
54                lyx::textclass_type tc, ErrorList &);
55
56 ///
57 std::pair<PitPosPair, ParagraphList::iterator>
58 pasteSelection(Buffer const & buffer,
59                ParagraphList & pars,
60                ParagraphList::iterator pit, int pos,
61                lyx::textclass_type tc,
62                size_t cuts_indexm, ErrorList &);
63
64 ///
65 int nrOfParagraphs();
66
67 /** Needed to switch between different classes this works
68     for a list of paragraphs beginning with the specified par
69     return value is the number of wrong conversions.
70 */
71 int SwitchLayoutsBetweenClasses(lyx::textclass_type c1,
72                                 lyx::textclass_type c2,
73                                 ParagraphList & par,
74                                 ErrorList &);
75 ///
76 bool checkPastePossible();
77
78 } // end of CutAndPaste
79
80 #endif