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
|
|
|
|
|
|
2001-12-28 13:26:54 +00:00
|
|
|
|
#include "support/types.h"
|
2000-04-10 14:29:05 +00:00
|
|
|
|
|
2003-10-07 06:45:25 +00:00
|
|
|
|
#include <string>
|
2003-06-17 15:33:49 +00:00
|
|
|
|
#include <vector>
|
|
|
|
|
|
2003-09-06 12:36:58 +00:00
|
|
|
|
class Buffer;
|
2003-05-20 16:51:31 +00:00
|
|
|
|
class ErrorList;
|
2003-09-06 12:36:58 +00:00
|
|
|
|
class LyXTextClass;
|
2004-03-25 09:16:36 +00:00
|
|
|
|
class LCursor;
|
|
|
|
|
class ParagraphList;
|
2000-04-10 14:29:05 +00:00
|
|
|
|
|
|
|
|
|
///
|
2004-03-25 09:16:36 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
namespace cap {
|
2003-06-17 15:33:49 +00:00
|
|
|
|
|
|
|
|
|
///
|
2003-10-08 11:31:51 +00:00
|
|
|
|
std::vector<std::string> const availableSelections(Buffer const & buffer);
|
2003-06-17 15:33:49 +00:00
|
|
|
|
|
2003-04-29 09:40:49 +00:00
|
|
|
|
///
|
2004-03-25 09:16:36 +00:00
|
|
|
|
void cutSelection(LCursor & cur, bool doclear, bool realcut);
|
2003-03-06 15:39:37 +00:00
|
|
|
|
|
2004-03-25 09:16:36 +00:00
|
|
|
|
/**
|
|
|
|
|
* Sets the selection from the current cursor position to length
|
|
|
|
|
* characters to the right. No safety checks.
|
|
|
|
|
*/
|
|
|
|
|
void setSelectionRange(LCursor & cur, lyx::pos_type length);
|
|
|
|
|
/// simply replace using the font of the first selected character
|
|
|
|
|
void replaceSelectionWithString(LCursor & cur, std::string const & str);
|
|
|
|
|
/// replace selection helper
|
|
|
|
|
void replaceSelection(LCursor & cur);
|
2003-05-06 09:34:56 +00:00
|
|
|
|
|
2003-03-06 15:39:37 +00:00
|
|
|
|
///
|
2004-03-25 09:16:36 +00:00
|
|
|
|
void cutSelection(LCursor & cur, bool doclear = true, bool realcut = true);
|
|
|
|
|
///
|
|
|
|
|
void copySelection(LCursor & cur);
|
|
|
|
|
///
|
|
|
|
|
void pasteSelection(LCursor & cur, size_t sel_index = 0);
|
2003-03-06 15:39:37 +00:00
|
|
|
|
|
2004-03-25 09:16:36 +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
|
|
|
|
|
2004-03-25 09:16:36 +00:00
|
|
|
|
// only used by the spellchecker
|
|
|
|
|
void replaceWord(LCursor & cur, std::string const & replacestring);
|
|
|
|
|
|
|
|
|
|
} // namespace cap
|
|
|
|
|
} // namespce lyx
|
2000-04-10 14:29:05 +00:00
|
|
|
|
|
|
|
|
|
#endif
|