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>
26 class QMacPasteboardMimeGraphics;
29 * \class CacheMimeData
31 * This class is used in order to query the clipboard only once on
32 * startup and once each time the contents of the clipboard changes.
34 class CacheMimeData : public QMimeData
38 // LyX calls "on_dataChanged" on startup, so it is not necessary to
39 // query the clipboard here.
43 /// reads the clipboard and updates the cached_formats_
45 /// returns the cached list of formats supported by the object
46 virtual QStringList formats() const { return cached_formats_; }
47 /// reads the clipboard and returns the data
48 QByteArray data(QString const & mimeType) const;
51 /// the cached list of formats supported by the object
52 QStringList cached_formats_;
57 * The Qt4 version of the Clipboard.
59 class GuiClipboard: public QObject, public Clipboard
65 /** Clipboard overloaded methods
68 std::string const getAsLyX() const;
69 FileName getAsGraphics(Cursor const & cur, GraphicsType type) const;
70 docstring const getAsText() const;
71 void put(std::string const & lyx, docstring const & text);
72 bool hasLyXContents() const;
73 bool hasGraphicsContents(GraphicsType type = AnyGraphicsType) const;
74 bool hasTextContents() const;
75 bool isInternal() const;
76 bool hasInternal() const;
80 FileName getPastedGraphicsFileName(Cursor const & cur,
81 Clipboard::GraphicsType & type) const;
84 void on_dataChanged();
87 bool text_clipboard_empty_;
88 bool has_lyx_contents_;
89 bool has_graphics_contents_;
90 /// the cached mime data used to describe the information
91 /// that can be stored in the clipboard
95 QString const lyxMimeType();
96 QString const pdfMimeType();
97 QString const emfMimeType();
98 QString const wmfMimeType();
100 } // namespace frontend
103 #endif // GUICLIPBOARD_H