#define CUTANDPASTE_H
#include "support/docstring.h"
-#include "TextClass_ptr.h"
+
+#include "frontends/Clipboard.h"
#include <vector>
+using lyx::frontend::Clipboard;
+
namespace lyx {
-class Buffer;
+class DocumentClass;
class ErrorList;
class InsetText;
-class TextClass;
class Cursor;
class ParagraphList;
namespace cap {
/// Get all elements of the cut buffer in plain text format.
-std::vector<docstring> const availableSelections(Buffer const & buffer);
+std::vector<docstring> availableSelections();
/// Get the number of available elements in the cut buffer.
size_type numberOfSelections();
/// Get the sel_index-th element of the cut buffer in plain text format.
-docstring getSelection(Buffer const & buffer, size_t sel_index);
+docstring selection(size_t sel_index);
/**
* Replace using the font of the first selected character and select
/// Paste the current selection at \p cur
/// Does handle undo. Does only work in text, not mathed.
void pasteSelection(Cursor & cur, ErrorList &);
-/// Replace the current selection with the clipboard contents (internal or
-/// external: which is newer)
+/// Replace the current selection with the clipboard contents as text
+/// (internal or external: which is newer).
+/// Does handle undo. Does only work in text, not mathed.
+void pasteClipboardText(Cursor & cur, ErrorList & errorList,
+ bool asParagraphs = true);
+/// Replace the current selection with the clipboard contents as graphic.
/// Does handle undo. Does only work in text, not mathed.
-void pasteClipboard(Cursor & cur, ErrorList & errorList, bool asParagraphs = true);
+void pasteClipboardGraphics(Cursor & cur, ErrorList & errorList,
+ Clipboard::GraphicsType preferedType = Clipboard::AnyGraphicsType);
/// Replace the current selection with cut buffer \c sel_index
/// Does handle undo. Does only work in text, not mathed.
void pasteFromStack(Cursor & cur, ErrorList & errorList, size_t sel_index);
/// Paste the paragraph list \p parlist at the position given by \p cur.
/// Does not handle undo. Does only work in text, not mathed.
void pasteParagraphList(Cursor & cur, ParagraphList const & parlist,
- TextClass_ptr textclass, ErrorList & errorList);
+ DocumentClass const * const textclass, ErrorList & errorList);
/** Needed to switch between different classes. This works
* for a list of paragraphs beginning with the specified par.
* It changes layouts and character styles.
*/
-void switchBetweenClasses(TextClass_ptr const & c1,
- TextClass_ptr const & c2, InsetText & in, ErrorList &);
+void switchBetweenClasses(DocumentClass const * const c1,
+ DocumentClass const * const c2, InsetText & in, ErrorList &);
/// Get the current selection as a string. Does not change the selection.
/// Does only work if the whole selection is in mathed.