X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2FClipboard.h;h=92e7167708ae9a50adc8093726bb1af1f024f5a6;hb=0425500be524ed87baebea34a5e8b6e58d718bbc;hp=deddf5b0c98e72e914528b7907a94652af86d332;hpb=3500af60babc81d7c1d18221f7aae89805ee3adb;p=lyx.git diff --git a/src/frontends/Clipboard.h b/src/frontends/Clipboard.h index deddf5b0c9..92e7167708 100644 --- a/src/frontends/Clipboard.h +++ b/src/frontends/Clipboard.h @@ -14,7 +14,12 @@ #ifndef BASE_CLIPBOARD_H #define BASE_CLIPBOARD_H -#include "support/docstring.h" +#include "Cursor.h" + +#include "support/FileName.h" +#include "support/strfwd.h" + +using lyx::support::FileName; namespace lyx { namespace frontend { @@ -27,6 +32,16 @@ class Clipboard public: virtual ~Clipboard() {} + enum GraphicsType { + PdfGraphicsType, + PngGraphicsType, + JpegGraphicsType, + LinkBackGraphicsType, + EmfGraphicsType, + WmfGraphicsType, + AnyGraphicsType + }; + /** * Get the system clipboard contents. The format is as written in * .lyx files (may even be an older version than ours if it comes @@ -38,6 +53,9 @@ public: virtual std::string const getAsLyX() const = 0; /// Get the contents of the window system clipboard in plain text format. virtual docstring const getAsText() const = 0; + /// Get the contents of the window system clipboard as graphics file. + virtual FileName getAsGraphics(Cursor const & cur, GraphicsType type) const = 0; + /** * Fill the system clipboard. The format of \p lyx is as written in * .lyx files, the format of \p text is plain text. @@ -51,16 +69,26 @@ public: /// Does the clipboard contain LyX contents? virtual bool hasLyXContents() const = 0; + /// Does the clipboard contain text contents? + virtual bool hasTextContents() const = 0; + /// Does the clipboard contain graphics contents of a certain type? + virtual bool hasGraphicsContents(GraphicsType type = AnyGraphicsType) const = 0; /// state of clipboard. - /// \retval true if the system clipboard has been set within LyX. + /// \returns true if the system clipboard has been set within LyX + /// (document contents, dialogs count as external here). virtual bool isInternal() const = 0; + /// \returns true if the OS has the concept of clipboard ownership, + /// which is crucial for our concept of internal clipboard. + virtual bool hasInternal() const = 0; /// Is the clipboard empty? + /// \returns true if both the LyX and the plaintext versions of the + /// clipboard are empty, and no supported graphics format is available. virtual bool empty() const = 0; }; } // namespace frontend -/// Implementation is in Application.C +/// Implementation is in Application.cpp extern frontend::Clipboard & theClipboard(); } // namespace lyx