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