X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2FClipboard.h;h=5e16a26bbf8d31179d9b2a4d4a2224961ea80181;hb=713264ae2b82f23e80ed6369b19ae6c9b030b6e4;hp=cdbe98b9a6d0f92ef0434939847a10e43e081720;hpb=753aa0451d4925de69702a419d6bb1e025a5d4b4;p=lyx.git diff --git a/src/frontends/Clipboard.h b/src/frontends/Clipboard.h index cdbe98b9a6..5e16a26bbf 100644 --- a/src/frontends/Clipboard.h +++ b/src/frontends/Clipboard.h @@ -14,14 +14,14 @@ #ifndef BASE_CLIPBOARD_H #define BASE_CLIPBOARD_H -#include "Cursor.h" - -#include "support/FileName.h" #include "support/strfwd.h" -using lyx::support::FileName; - namespace lyx { + +class Cursor; + +namespace support { class FileName; } + namespace frontend { /** @@ -39,7 +39,16 @@ public: LinkBackGraphicsType, EmfGraphicsType, WmfGraphicsType, - AnyGraphicsType, + AnyGraphicsType + }; + + enum TextType { + AnyTextType, + LyXOrPlainTextType, + PlainTextType, + HtmlTextType, + LaTeXTextType, + LyXTextType, }; /** @@ -51,11 +60,13 @@ public: * clipboard. */ 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 in any text format except LyxTextType. + virtual docstring const getAsText(TextType type) const = 0; /// Get the contents of the window system clipboard as graphics file. - virtual FileName getAsGraphics(Cursor const & cur, GraphicsType type) const = 0; - + virtual support::FileName getAsGraphics(Cursor const & cur, GraphicsType type) const = 0; + + virtual docstring const & getFindBuffer() { return find_buffer_; } + /** * Fill the system clipboard. The format of \p lyx is as written in * .lyx files, the format of \p text is plain text. @@ -65,10 +76,15 @@ public: * This should be called when the user requests to cut or copy to * the clipboard. */ - virtual void put(std::string const & lyx, docstring const & text) = 0; + virtual void put(std::string const & lyx, docstring const & html, docstring const & text) = 0; - /// Does the clipboard contain LyX contents? - virtual bool hasLyXContents() const = 0; + /// Put a general string on the system clipboard (not LyX text) + virtual void put(std::string const & text) const = 0; + + virtual void setFindBuffer(docstring const & text) { find_buffer_ = text;} + + /// Does the clipboard contain text contents? + virtual bool hasTextContents(TextType type = AnyTextType) const = 0; /// Does the clipboard contain graphics contents of a certain type? virtual bool hasGraphicsContents(GraphicsType type = AnyGraphicsType) const = 0; /// state of clipboard. @@ -82,6 +98,9 @@ public: /// \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; + +private: + docstring find_buffer_; }; } // namespace frontend