FlightGear next
NasalClipboard.hxx
Go to the documentation of this file.
1// Clipboard access for Nasal
2//
3// Copyright (C) 2012 Thomas Geymayer <tomgey@gmail.com>
4//
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.
9//
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.
14//
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.
18
19#ifndef NASAL_CLIPOARD_HXX_
20#define NASAL_CLIPOARD_HXX_
21
22#include <simgear/nasal/nasal.h>
23#include <memory>
24#include <string>
25
26class FGNasalSys;
28{
29 public:
30
31 enum Type
32 {
35
40 };
41
42 typedef std::shared_ptr<NasalClipboard> Ptr;
43
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;
48
53 static void init(FGNasalSys *nasal);
54
58 static Ptr getInstance();
59
60 protected:
61
63
67 static Ptr create();
68
69 virtual ~NasalClipboard() = 0;
70};
71
72#endif /* NASAL_CLIPOARD_HXX_ */
virtual std::string getText(Type type=CLIPBOARD)=0
static Ptr create()
Implementation supplied by actual platform implementation.
@ PRIMARY
X11 platforms support also a mode called PRIMARY selection which contains the current (mouse) selecti...
@ CLIPBOARD
Standard clipboard as supported by nearly all operating systems.
virtual ~NasalClipboard()=0
static Ptr getInstance()
Get clipboard platform specific instance.
virtual void update()
std::shared_ptr< NasalClipboard > Ptr
virtual bool setText(const std::string &text, Type type=CLIPBOARD)=0
static void init(FGNasalSys *nasal)
Sets up the clipboard and puts all the extension functions into a new "clipboard" namespace.
static Ptr _clipboard