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.
17 #include "support/strfwd.h"
23 * A Selection class manages the selection.
28 virtual ~Selection() {}
31 * Tell the window system whether we set or cleared our selection.
32 * This is a noop on systems that don't have a selection.
33 * This should be called by the kernel whenever a selection is
34 * created, changed or cleared.
36 * If true: Tell that we got a valid selection.
37 * If false: Tell that we cleared our selection.
39 virtual void haveSelection(bool) = 0;
41 * Get the X selection contents.
42 * This is a noop on systems that don't have a selection.
43 * The format is plain text.
44 * This should be called when the user presses the middle mouse
47 virtual docstring const get() const = 0;
49 * Fill the X selection.
50 * The format is plain text.
51 * Does nothing on systems that don't have a selection.
52 * Since the X selection protocol is asyncronous this should never be
53 * called from the kernel.
54 * If another application requests the current selection a
55 * SelectionRequest XEvent will be triggered. The response of the
56 * frontend to this event should be to retrieve the current selection
57 * from the kernel and push it to X with this method.
59 virtual void put(docstring const &) = 0;
61 * Is the X selection empty?
62 * This does always return true on systems that don't have a real
65 virtual bool empty() const = 0;
68 } // namespace frontend
70 /// Implementation is in Application.cpp
71 extern frontend::Selection & theSelection();