]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/Selection.h
Honor pending spaces in InsetMathChar::write
[lyx.git] / src / frontends / Selection.h
index fd9c88973468049f1ed278e6ab1d38d356417e74..931cb4470efcb051949795a4f85cec0122e7e14f 100644 (file)
  * Full author contact details are available in file CREDITS.
  */
 
-#ifndef BASE_SELECTION_H
-#define BASE_SELECTION_H
+#ifndef SELECTION_H
+#define SELECTION_H
 
-#include "support/docstring.h"
+#include "support/strfwd.h"
 
 namespace lyx {
 namespace frontend {
@@ -27,7 +27,20 @@ class Selection
 public:
        virtual ~Selection() {}
 
-       /// Tell the window system whether we have a selection.
+       /**
+        * Returns true if the underlying system supports mouse selection
+        * (basically X11 and Wayland).
+        */
+       virtual bool supported() const = 0;
+       /**
+        * Tell the window system whether we set or cleared our selection.
+        * This is a noop on systems that don't have a selection.
+        * This should be called by the kernel whenever a selection is
+        * created, changed or cleared.
+        * \param own
+        * If true: Tell that we got a valid selection.
+        * If false: Tell that we cleared our selection.
+        */
        virtual void haveSelection(bool) = 0;
        /**
         * Get the X selection contents.
@@ -41,7 +54,7 @@ public:
         * Fill the X selection.
         * The format is plain text.
         * Does nothing on systems that don't have a selection.
-        * Since the X selection protocol is asyncronous this should never be
+        * Since the X selection protocol is asynchronous this should never be
         * called from the kernel.
         * If another application requests the current selection a
         * SelectionRequest XEvent will be triggered. The response of the
@@ -49,14 +62,20 @@ public:
         * from the kernel and push it to X with this method.
         */
        virtual void put(docstring const &) = 0;
+       /**
+        * Is the X selection empty?
+        * This does always return true on systems that don't have a real
+        * selection.
+        */
+       virtual bool empty() const = 0;
 };
 
 } // namespace frontend
 
-/// Implementation is in Application.C
+/// Implementation is in Application.cpp
 extern frontend::Selection & theSelection();
 
 } // namespace lyx
 
 
-#endif // BASE_SELECTION_H
+#endif // SELECTION_H