]> git.lyx.org Git - lyx.git/blob - src/frontends/Selection.h
Split clipboard and X selection
[lyx.git] / src / frontends / Selection.h
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.
6  *
7  * \author unknown
8  * \author John Levon
9  * \author Abdelrazak Younes
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef BASE_SELECTION_H
15 #define BASE_SELECTION_H
16
17 #include <string>
18
19 namespace lyx {
20 namespace frontend {
21
22 /**
23  * A Selection class manages the selection.
24  */
25 class Selection
26 {
27 public:
28         virtual ~Selection() {}
29
30         /// Tell the window system whether we have a selection.
31         virtual void haveSelection(bool) = 0;
32         /**
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
37          * button.
38          */
39         virtual std::string const get() const = 0;
40         /**
41          * Fill the X selection.
42          * Does nothing on systems that don't have a selection.
43          * This should be called whenever some text is highlighted.
44          */
45         virtual void put(std::string const &) = 0;
46 };
47
48 } // namespace frontend
49 } // namespace lyx
50
51 #endif // BASE_SELECTION_H