2000-04-10 14:29:05 +00:00
|
|
|
|
// -*- C++ -*-
|
2003-08-23 00:17:00 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file CutAndPaste.h
|
2003-05-06 09:34:56 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:27:08 +00:00
|
|
|
|
*
|
2003-09-07 01:45:40 +00:00
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
2003-05-06 09:34:56 +00:00
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
2003-06-28 01:23:11 +00:00
|
|
|
|
* \author Alfredo Braunstein
|
2002-03-21 17:27:08 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2003-05-06 09:34:56 +00:00
|
|
|
|
*/
|
2000-04-10 14:29:05 +00:00
|
|
|
|
|
|
|
|
|
#ifndef CUTANDPASTE_H
|
|
|
|
|
#define CUTANDPASTE_H
|
|
|
|
|
|
2003-09-06 12:36:58 +00:00
|
|
|
|
#include "ParagraphList_fwd.h"
|
2001-12-28 13:26:54 +00:00
|
|
|
|
#include "support/types.h"
|
2000-04-10 14:29:05 +00:00
|
|
|
|
|
2003-06-17 15:33:49 +00:00
|
|
|
|
#include <vector>
|
|
|
|
|
|
2003-09-06 12:36:58 +00:00
|
|
|
|
class Buffer;
|
2001-12-28 13:26:54 +00:00
|
|
|
|
class BufferParams;
|
2003-05-20 16:51:31 +00:00
|
|
|
|
class ErrorList;
|
2003-09-06 12:36:58 +00:00
|
|
|
|
class LyXTextClass;
|
|
|
|
|
class Paragraph;
|
2000-04-10 14:29:05 +00:00
|
|
|
|
|
|
|
|
|
///
|
2003-03-06 15:39:37 +00:00
|
|
|
|
namespace CutAndPaste {
|
2003-06-17 15:33:49 +00:00
|
|
|
|
|
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
|
std::vector<std::string>
|
2003-06-17 15:33:49 +00:00
|
|
|
|
CutAndPaste::availableSelections(Buffer const & buffer);
|
|
|
|
|
|
2003-04-29 09:40:49 +00:00
|
|
|
|
///
|
2003-06-10 14:39:45 +00:00
|
|
|
|
PitPosPair cutSelection(BufferParams const & params,
|
|
|
|
|
ParagraphList & pars,
|
|
|
|
|
ParagraphList::iterator startpit,
|
|
|
|
|
ParagraphList::iterator endpit,
|
|
|
|
|
int start, int end, lyx::textclass_type tc,
|
|
|
|
|
bool doclear = false);
|
2003-04-29 09:40:49 +00:00
|
|
|
|
///
|
2003-06-10 14:39:45 +00:00
|
|
|
|
PitPosPair eraseSelection(BufferParams const & params,
|
|
|
|
|
ParagraphList & pars,
|
|
|
|
|
ParagraphList::iterator startpit,
|
|
|
|
|
ParagraphList::iterator endpit,
|
|
|
|
|
int start, int end, bool doclear = false);
|
2003-03-06 15:39:37 +00:00
|
|
|
|
///
|
2003-05-06 09:34:56 +00:00
|
|
|
|
bool copySelection(ParagraphList::iterator startpit,
|
2003-04-30 10:32:01 +00:00
|
|
|
|
ParagraphList::iterator endpit,
|
2003-03-06 21:01:04 +00:00
|
|
|
|
int start, int end, lyx::textclass_type tc);
|
2003-03-06 15:39:37 +00:00
|
|
|
|
///
|
2003-04-30 10:32:01 +00:00
|
|
|
|
std::pair<PitPosPair, ParagraphList::iterator>
|
2003-06-10 14:39:45 +00:00
|
|
|
|
pasteSelection(Buffer const & buffer,
|
|
|
|
|
ParagraphList & pars,
|
2003-04-30 10:32:01 +00:00
|
|
|
|
ParagraphList::iterator pit, int pos,
|
2003-05-20 16:51:31 +00:00
|
|
|
|
lyx::textclass_type tc, ErrorList &);
|
2003-03-06 15:39:37 +00:00
|
|
|
|
|
2003-05-06 09:34:56 +00:00
|
|
|
|
///
|
|
|
|
|
std::pair<PitPosPair, ParagraphList::iterator>
|
2003-06-10 14:39:45 +00:00
|
|
|
|
pasteSelection(Buffer const & buffer,
|
|
|
|
|
ParagraphList & pars,
|
2003-05-06 09:34:56 +00:00
|
|
|
|
ParagraphList::iterator pit, int pos,
|
|
|
|
|
lyx::textclass_type tc,
|
2003-05-20 16:51:31 +00:00
|
|
|
|
size_t cuts_indexm, ErrorList &);
|
2003-05-06 09:34:56 +00:00
|
|
|
|
|
2003-03-06 15:39:37 +00:00
|
|
|
|
///
|
|
|
|
|
int nrOfParagraphs();
|
|
|
|
|
|
2003-05-06 09:34:56 +00:00
|
|
|
|
/** Needed to switch between different classes this works
|
2003-03-06 15:39:37 +00:00
|
|
|
|
for a list of paragraphs beginning with the specified par
|
2003-05-06 09:34:56 +00:00
|
|
|
|
return value is the number of wrong conversions.
|
2003-03-06 15:39:37 +00:00
|
|
|
|
*/
|
|
|
|
|
int SwitchLayoutsBetweenClasses(lyx::textclass_type c1,
|
|
|
|
|
lyx::textclass_type c2,
|
2003-05-28 06:47:15 +00:00
|
|
|
|
ParagraphList & par,
|
2003-05-20 16:51:31 +00:00
|
|
|
|
ErrorList &);
|
2003-03-06 15:39:37 +00:00
|
|
|
|
///
|
2003-03-06 21:01:04 +00:00
|
|
|
|
bool checkPastePossible();
|
2003-03-06 15:39:37 +00:00
|
|
|
|
|
|
|
|
|
} // end of CutAndPaste
|
2000-04-10 14:29:05 +00:00
|
|
|
|
|
|
|
|
|
#endif
|