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 BASE_CLIPBOARD_H
15 #define BASE_CLIPBOARD_H
17 #include "support/docstring.h"
23 * A Clipboard class manages the clipboard.
28 virtual ~Clipboard() {}
31 * Get the system clipboard contents. The format is as written in
32 * .lyx files (may even be an older version than ours if it comes
34 * Does not convert plain text to LyX if only plain text is available.
35 * This should be called when the user requests to paste from the
38 virtual std::string const getAsLyX() const = 0;
39 /// Get the contents of the window system clipboard in plain text format.
40 virtual docstring const getAsText() const = 0;
42 * Fill the system clipboard. The format of \p lyx is as written in
43 * .lyx files, the format of \p text is plain text.
44 * We put the clipboard contents in LyX format and plain text into
45 * the system clipboard if supported, so that it is useful for other
46 * applications as well as other instances of LyX.
47 * This should be called when the user requests to cut or copy to
50 virtual void put(std::string const & lyx, docstring const & text) = 0;
52 /// Does the clipboard contain LyX contents?
53 virtual bool hasLyXContents() const = 0;
54 /// state of clipboard.
55 /// \returns true if the system clipboard has been set within LyX
56 /// (document contents, dialogs count as external here).
57 virtual bool isInternal() const = 0;
58 /// Is the clipboard empty?
59 /// \returns true if both the LyX and the plaintext versions of the
60 /// clipboard are empty.
61 virtual bool empty() const = 0;
64 } // namespace frontend
66 /// Implementation is in Application.cpp
67 extern frontend::Clipboard & theClipboard();
72 #endif // BASE_CLIPBOARD_H