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_SELECTION_H
15 #define BASE_SELECTION_H
17 #include "support/docstring.h"
23 * A Selection class manages the selection.
28 virtual ~Selection() {}
30 /// Tell the window system whether we have a selection.
31 virtual void haveSelection(bool) = 0;
33 * Get the X selection contents.
34 * This is a noop on systems that don't have a selection.
35 * The format is plain text.
36 * This should be called when the user presses the middle mouse
39 virtual docstring const get() const = 0;
41 * Fill the X selection.
42 * The format is plain text.
43 * Does nothing on systems that don't have a selection.
44 * Since the X selection protocol is asyncronous this should never be
45 * called from the kernel.
46 * If another application requests the current selection a
47 * SelectionRequest XEvent will be triggered. The response of the
48 * frontend to this event should be to retrieve the current selection
49 * from the kernel and push it to X with this method.
51 virtual void put(docstring const &) = 0;
54 } // namespace frontend
56 /// Implementation is in Application.C
57 extern frontend::Selection & theSelection();
62 #endif // BASE_SELECTION_H