1 // Clipboard access for Nasal
3 // Copyright (C) 2012 Thomas Geymayer <tomgey@gmail.com>
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License as
7 // published by the Free Software Foundation; either version 2 of the
8 // License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful, but
11 // WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef NASAL_CLIPOARD_HXX_
20 #define NASAL_CLIPOARD_HXX_
22 #include <simgear/nasal/nasal.h>
23 #include <boost/shared_ptr.hpp>
33 /// Standard clipboard as supported by nearly all operating systems
36 /// X11 platforms support also a mode called PRIMARY selection which
37 /// contains the current (mouse) selection and can typically be inserted
38 /// via a press on the middle mouse button
42 typedef boost::shared_ptr<NasalClipboard> Ptr;
44 virtual void update() {}
45 virtual std::string getText(Type type = CLIPBOARD) = 0;
46 virtual bool setText( const std::string& text,
47 Type type = CLIPBOARD ) = 0;
50 * Sets up the clipboard and puts all the extension functions into a new
51 * "clipboard" namespace.
53 static void init(FGNasalSys *nasal);
56 * Get clipboard platform specific instance
58 static Ptr getInstance();
62 static Ptr _clipboard;
65 * Implementation supplied by actual platform implementation
69 virtual ~NasalClipboard() = 0;
72 #endif /* NASAL_CLIPOARD_HXX_ */