The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
clipboard.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2016 by David White <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 /** @file */
16 
17 #ifndef CLIPBOARD_HPP_INCLUDED
18 #define CLIPBOARD_HPP_INCLUDED
19 
20 #include <string>
21 
22 union SDL_Event;
23 
24 namespace desktop {
25 
26 namespace clipboard {
27 
28 /**
29  * Copies text to the clipboard.
30  *
31  * @param text The text to copy.
32  * @param mouse Is the selection done by the mouse? On UNIX systems there
33  * are multiple clipboards and the mouse selection uses a
34  * different clipboard. Ignored on other systems.
35  */
36 void copy_to_clipboard(const std::string& text, const bool mouse);
37 
38 /**
39  * Copies text from the clipboard.
40  *
41  * @param mouse Is the pasting done by the mouse?
42  *
43  * @returns String on clipbaord.
44  */
45 std::string copy_from_clipboard(const bool mouse);
46 
47 void handle_system_event(const SDL_Event& ev);
48 
49 /**
50  * Whether wesnoth was compiled with support for a clipboard.
51  */
52 bool available();
53 
54 } // end namespace clipboard
55 
56 } // end namespace desktop
57 
58 #endif
bool available()
Whether wesnoth was compiled with support for a clipboard.
Definition: clipboard.cpp:61
std::string copy_from_clipboard(const bool)
Copies text from the clipboard.
Definition: clipboard.cpp:45
void handle_system_event(const SDL_Event &)
Definition: clipboard.cpp:57
void copy_to_clipboard(const std::string &text, const bool)
Copies text to the clipboard.
Definition: clipboard.cpp:40
GLsizei const GLcharARB ** string
Definition: glew.h:4503