4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * \author Abdelrazak Younes
11 * Full author contact details are available in file CREDITS.
14 #ifndef GUICLIPBOARD_H
15 #define GUICLIPBOARD_H
17 #include "frontends/Clipboard.h"
21 #include <QStringList>
23 #include <boost/cstdint.hpp>
28 class QMacPasteboardMimeGraphics;
31 * \class CacheMimeData
33 * This class is used in order to query the clipboard only once on
34 * startup and once each time the contents of the clipboard changes.
36 class CacheMimeData : public QMimeData
40 // LyX calls "on_dataChanged" on startup, so it is not necessary to
41 // query the clipboard here.
45 /// reads the clipboard and updates the cached_formats_
47 /// returns the cached list of formats supported by the object
48 virtual QStringList formats() const { return cached_formats_; }
49 /// reads the clipboard and returns the data
50 QByteArray data(QString const & mimeType) const;
53 /// the cached list of formats supported by the object
54 QStringList cached_formats_;
59 * The Qt4 version of the Clipboard.
61 class GuiClipboard: public QObject, public Clipboard
67 /** Clipboard overloaded methods
70 std::string const getAsLyX() const;
71 FileName getAsGraphics(Cursor const & cur, GraphicsType type) const;
72 docstring const getAsText(TextType type) const;
73 void put(std::string const & text) const;
74 void put(std::string const & lyx, docstring const & html, docstring const & text);
75 bool hasGraphicsContents(GraphicsType type = AnyGraphicsType) const;
76 bool hasTextContents(TextType typetype = AnyTextType) const;
77 bool isInternal() const;
78 bool hasInternal() const;
82 FileName getPastedGraphicsFileName(Cursor const & cur,
83 Clipboard::GraphicsType & type) const;
86 void on_dataChanged();
89 bool plaintext_clipboard_empty_;
90 bool has_text_contents_;
91 bool has_graphics_contents_;
92 /// the cached mime data used to describe the information
93 /// that can be stored in the clipboard
95 /// checksum for internal clipboard data (used on Mac)
96 boost::uint32_t checksum;
99 QString const lyxMimeType();
100 QString const pdfMimeType();
101 QString const emfMimeType();
102 QString const wmfMimeType();
104 } // namespace frontend
107 #endif // GUICLIPBOARD_H