The Battle for Wesnoth  1.13.10+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 - 2017 by David White <dave@whitevine.net>
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 #pragma once
18 
19 #include <string>
20 
21 union SDL_Event;
22 
23 namespace desktop {
24 
25 namespace clipboard {
26 
27 /**
28  * Copies text to the clipboard.
29  *
30  * @param text The text to copy.
31  * @param mouse Is the selection done by the mouse? On UNIX systems there
32  * are multiple clipboards and the mouse selection uses a
33  * different clipboard. Ignored on other systems.
34  */
35 void copy_to_clipboard(const std::string& text, const bool mouse);
36 
37 /**
38  * Copies text from the clipboard.
39  *
40  * @param mouse Is the pasting done by the mouse?
41  *
42  * @returns String on clipbaord.
43  */
44 std::string copy_from_clipboard(const bool mouse);
45 
46 void handle_system_event(const SDL_Event& ev);
47 
48 /**
49  * Whether wesnoth was compiled with support for a clipboard.
50  */
51 bool available();
52 
53 } // end namespace clipboard
54 
55 } // end namespace desktop
std::vector< char_t > string
bool available()
Whether wesnoth was compiled with support for a clipboard.
Definition: clipboard.cpp:56
std::string copy_from_clipboard(const bool)
Copies text from the clipboard.
Definition: clipboard.cpp:40
void handle_system_event(const SDL_Event &)
Definition: clipboard.cpp:52
void copy_to_clipboard(const std::string &text, const bool)
Copies text to the clipboard.
Definition: clipboard.cpp:35