]> git.lyx.org Git - lyx.git/blobdiff - src/CutAndPaste.h
Alfredo's second patch
[lyx.git] / src / CutAndPaste.h
index 07a0dc910f691af398d1744e3f797ae87a0ba258..dbb7a297bbfa9229389da534f4c34069271e60be 100644 (file)
 #ifndef CUTANDPASTE_H
 #define CUTANDPASTE_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
-
 #include "support/types.h"
+#include "ParagraphList.h"
 
 class Paragraph;
 class BufferParams;
 class LyXTextClass;
 
 ///
-class CutAndPaste {
-public:
-       /// realcut == false is we actually want a delete
-       static
-       bool cutSelection(Paragraph * startpar, Paragraph ** endpar,
-                         int start, int & end, char tc, bool doclear = false,
-                         bool realcut = true);
-       ///
-       static
-       bool copySelection(Paragraph * startpar, Paragraph * endpar,
-                          int start, int end, char tc);
-       ///
-       static
-       bool pasteSelection(Paragraph ** par, Paragraph ** endpar,
-                           int & pos, char tc);
-       ///
-       static
-       int nrOfParagraphs();
-       /** needed to switch between different classes this works
-           for a list of paragraphs beginning with the specified par
-           return value is the number of wrong conversions
-       */
-       static
-       int SwitchLayoutsBetweenClasses(lyx::textclass_type c1,
-                                       lyx::textclass_type c2,
-                                       Paragraph * par,
-                                       BufferParams const & bparams);
-       ///
-       static
-       bool checkPastePossible(Paragraph *);
-};
+namespace CutAndPaste {
+///
+PitPosPair cutSelection(ParagraphList & pars,
+            ParagraphList::iterator startpit, 
+            ParagraphList::iterator endpit,
+            int start, int end, lyx::textclass_type tc,
+            bool doclear = false);
+///
+PitPosPair eraseSelection(ParagraphList & pars,
+              ParagraphList::iterator startpit, 
+              ParagraphList::iterator endpit,
+              int start, int end, bool doclear = false);
+///
+bool copySelection(ParagraphList::iterator startpit, 
+                  ParagraphList::iterator endpit,
+                  int start, int end, lyx::textclass_type tc);
+///
+std::pair<PitPosPair, ParagraphList::iterator>
+pasteSelection(ParagraphList & pars,
+              ParagraphList::iterator pit, int pos,
+              lyx::textclass_type tc);
+
+///
+int nrOfParagraphs();
+
+/** needed to switch between different classes this works
+    for a list of paragraphs beginning with the specified par
+    return value is the number of wrong conversions
+*/
+int SwitchLayoutsBetweenClasses(lyx::textclass_type c1,
+                               lyx::textclass_type c2,
+                               Paragraph * par,
+                               BufferParams const & bparams);
+///
+bool checkPastePossible();
+
+} // end of CutAndPaste
 
 #endif