* de.po: sync with branch.
[lyx.git] / src / frontends / Selection.h
blobac902ffc1eaafcaef57e201ddf59fd9ff5d8ab73
1 // -*- C++ -*-
2 /**
3 * \file Selection.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author unknown
8 * \author John Levon
9 * \author Abdelrazak Younes
11 * Full author contact details are available in file CREDITS.
14 #ifndef SELECTION_H
15 #define SELECTION_H
17 #include "support/strfwd.h"
19 namespace lyx {
20 namespace frontend {
22 /**
23 * A Selection class manages the selection.
25 class Selection
27 public:
28 virtual ~Selection() {}
30 /**
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.
35 * \param own
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;
40 /**
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
45 * button.
47 virtual docstring const get() const = 0;
48 /**
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;
60 /**
61 * Is the X selection empty?
62 * This does always return true on systems that don't have a real
63 * selection.
65 virtual bool empty() const = 0;
68 } // namespace frontend
70 /// Implementation is in Application.cpp
71 extern frontend::Selection & theSelection();
73 } // namespace lyx
76 #endif // SELECTION_H