]> git.lyx.org Git - lyx.git/blob - src/CutAndPaste.h
ceefdc20d6970c45e7401da2f997871f444d843d
[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 #include "support/types.h"
19
20 #include "support/std_string.h"
21 #include <vector>
22
23 class Buffer;
24 class BufferParams;
25 class ErrorList;
26 class LyXTextClass;
27 class Paragraph;
28
29 ///
30 namespace CutAndPaste {
31
32 ///
33 std::vector<string>
34 CutAndPaste::availableSelections(Buffer const & buffer);
35
36 ///
37 PitPosPair cutSelection(BufferParams const & params,
38                         ParagraphList & pars,
39                         ParagraphList::iterator startpit,
40                         ParagraphList::iterator endpit,
41                         int start, int end, lyx::textclass_type tc,
42                         bool doclear = false);
43 ///
44 PitPosPair eraseSelection(BufferParams const & params,
45                           ParagraphList & pars,
46                           ParagraphList::iterator startpit,
47                           ParagraphList::iterator endpit,
48                           int start, int end, bool doclear = false);
49 ///
50 bool copySelection(ParagraphList::iterator startpit,
51                    ParagraphList::iterator endpit,
52                    int start, int end, lyx::textclass_type tc);
53 ///
54 std::pair<PitPosPair, ParagraphList::iterator>
55 pasteSelection(Buffer const & buffer,
56                ParagraphList & pars,
57                ParagraphList::iterator pit, int pos,
58                lyx::textclass_type tc, ErrorList &);
59
60 ///
61 std::pair<PitPosPair, ParagraphList::iterator>
62 pasteSelection(Buffer const & buffer,
63                ParagraphList & pars,
64                ParagraphList::iterator pit, int pos,
65                lyx::textclass_type tc,
66                size_t cuts_indexm, ErrorList &);
67
68 ///
69 int nrOfParagraphs();
70
71 /** Needed to switch between different classes this works
72     for a list of paragraphs beginning with the specified par
73     return value is the number of wrong conversions.
74 */
75 int SwitchLayoutsBetweenClasses(lyx::textclass_type c1,
76                                 lyx::textclass_type c2,
77                                 ParagraphList & par,
78                                 ErrorList &);
79 ///
80 bool checkPastePossible();
81
82 } // end of CutAndPaste
83
84 #endif