aboutsummaryrefslogtreecommitdiff
path: root/common/system.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/system.h')
-rw-r--r--common/system.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/common/system.h b/common/system.h
index f17625e215..ae0575f0e8 100644
--- a/common/system.h
+++ b/common/system.h
@@ -216,6 +216,12 @@ protected:
*/
FilesystemFactory *_fsFactory;
+ /**
+ * Used by the default clipboard implementation, for backends that don't
+ * implement clipboard support.
+ */
+ Common::String _clipboard;
+
private:
/**
* Indicate if initBackend() has been called.
@@ -374,8 +380,11 @@ public:
kFeatureDisplayLogFile,
/**
- * The presence of this feature indicates whether the hasTextInClipboard(),
- * getTextFromClipboard() and setTextInClipboard() calls are supported.
+ * The presence of this feature indicates whether the system clipboard is
+ * available. If this feature is not present, the hasTextInClipboard(),
+ * getTextFromClipboard() and setTextInClipboard() calls can still be used,
+ * however it should not be used in scenarios where the user is expected to
+ * copy data outside of the application.
*
* This feature has no associated state.
*/
@@ -1451,7 +1460,7 @@ public:
*
* @return true if there is text in the clipboard, false otherwise
*/
- virtual bool hasTextInClipboard() { return false; }
+ virtual bool hasTextInClipboard() { return !_clipboard.empty(); }
/**
* Returns clipboard contents as a String.
@@ -1462,7 +1471,7 @@ public:
*
* @return clipboard contents ("" if hasTextInClipboard() == false)
*/
- virtual Common::String getTextFromClipboard() { return ""; }
+ virtual Common::String getTextFromClipboard() { return _clipboard; }
/**
* Set the content of the clipboard to the given string.
@@ -1473,7 +1482,7 @@ public:
*
* @return true if the text was properly set in the clipboard, false otherwise
*/
- virtual bool setTextInClipboard(const Common::String &text) { return false; }
+ virtual bool setTextInClipboard(const Common::String &text) { _clipboard = text; return true; }
/**
* Open the given Url in the default browser (if available on the target