Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Clipboard.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2010, The Cinder Project, All rights reserved.
3 
4  This code is intended for use with the Cinder C++ library: http://libcinder.org
5 
6  Redistribution and use in source and binary forms, with or without modification, are permitted provided that
7  the following conditions are met:
8 
9  * Redistributions of source code must retain the above copyright notice, this list of conditions and
10  the following disclaimer.
11  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
12  the following disclaimer in the documentation and/or other materials provided with the distribution.
13 
14  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
15  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
16  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
17  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
18  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
20  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
21  POSSIBILITY OF SUCH DAMAGE.
22 */
23 
24 #pragma once
25 
26 #include "cinder/Cinder.h"
27 #include "cinder/ImageIo.h"
28 
29 namespace cinder {
30 
32 class Clipboard {
33  public:
35  static bool hasString();
37  static bool hasImage();
38 
40  static std::string getString();
42  static ImageSourceRef getImage();
43 
45  static void setString( const std::string &str );
48 };
49 
50 } // namespace cinder
Singleton representing the system's clipboard.
Definition: Clipboard.h:32
GLsizei const GLchar ** string
Definition: GLee.h:2427
static void setImage(ImageSourceRef image, ImageTarget::Options options=ImageTarget::Options())
Sets the clipboard contents to the ImageSource image.
Definition: Clipboard.cpp:202
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: GLee.h:1023
Definition: ImageIo.h:159
static bool hasString()
Returns whether the clipboard contains a string.
Definition: Clipboard.cpp:70
static std::string getString()
Returns the clipboard contents as a UTF-8 string or an empty string if the clipboard does not contain...
Definition: Clipboard.cpp:106
static void setString(const std::string &str)
Sets the clipboard contents to the UTF-8 string str.
Definition: Clipboard.cpp:180
static ImageSourceRef getImage()
Returns the clipboard contents as an ImageSourceRef or a null if the clipboard does not contain an im...
Definition: Clipboard.cpp:145
static bool hasImage()
Returns whether the clipboard contains an image.
Definition: Clipboard.cpp:88
std::shared_ptr< class ImageSource > ImageSourceRef
Definition: Channel.h:33