Skip to content

Commit 8772586

Browse files
committed
Adding binaries
1 parent 30fb5e5 commit 8772586

13 files changed

Lines changed: 376 additions & 0 deletions

File tree

docs/pasteboard/clear.markdown

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# pasteboard.clear()
2+
3+
> --------------------- ------------------------------------------------------------------------------------------
4+
> __Type__ [function][api.type.function]
5+
> __Return value__ none
6+
> __Revision__ [REVISION_LABEL](REVISION_URL)
7+
> __Keywords__ clear, pasteboard
8+
> __See also__ [Pasteboard][plugin.pasteboard]
9+
> [pasteboard.copy()][plugin.pasteboard.copy]
10+
> [pasteboard.paste()][plugin.pasteboard.paste]
11+
> --------------------- ------------------------------------------------------------------------------------------
12+
13+
14+
## Overview
15+
16+
Clears the pasteboard of its data.
17+
18+
19+
## Syntax
20+
21+
pasteboard.clear()
22+
23+
24+
## Examples
25+
26+
``````lua
27+
local pasteboard = require( "plugin.pasteboard" )
28+
29+
-- Clear data from the pasteboard
30+
pasteboard.clear()
31+
``````

docs/pasteboard/copy.markdown

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# pasteboard.copy()
2+
3+
> --------------------- ------------------------------------------------------------------------------------------
4+
> __Type__ [function][api.type.function]
5+
> __Return value__ none
6+
> __Revision__ [REVISION_LABEL](REVISION_URL)
7+
> __Keywords__ copy, pasteboard
8+
> __See also__ [Pasteboard][plugin.pasteboard]
9+
> [pasteboard.paste()][plugin.pasteboard.paste]
10+
> [pasteboard.clear()][plugin.pasteboard.clear]
11+
> --------------------- ------------------------------------------------------------------------------------------
12+
13+
14+
## Overview
15+
16+
Copies a string, URL, or image to the device pasteboard.
17+
18+
19+
## Gotchas
20+
21+
Image copying/pasting is only supported on iOS.
22+
23+
24+
## Syntax
25+
26+
pasteboard.copy( copyType, string )
27+
pasteboard.copy( copyType, url )
28+
pasteboard.copy( copyType, fileName, baseDir )
29+
30+
##### copyType ~^(required)^~
31+
_[String][api.type.String]._ The type of data to copy to the pasteboard. Valid options include `"string"`, `"url"`, or `"image"`.
32+
33+
##### string ~^(optional)^~
34+
_[String][api.type.String]._ The string you wish to copy to the pasteboard. Applies only if `copyType` is `"string"`.
35+
36+
##### url ~^(optional)^~
37+
_[String][api.type.String]._ The URL you wish to copy to the pasteboard. Applies only if `copyType` is `"url"`.
38+
39+
##### fileName ~^(optional)^~
40+
_[String][api.type.String]._ The file name of the image you wish to copy to the pasteboard. Applies only if `copyType` is `"image"`. Note that image copying/pasting is only supported on iOS.
41+
42+
##### baseDir ~^(optional)^~
43+
_[Constant][api.type.Constant]._ The system [path][api.library.system.pathForFile] to load the image from. Applies only if `copyType` is `"image"`. Note that image copying/pasting is only supported on iOS.
44+
45+
46+
## Example
47+
48+
``````lua
49+
local pasteboard = require( "plugin.pasteboard" )
50+
51+
pasteboard.copy( "string", "Hello World!" )
52+
``````

docs/pasteboard/getType.markdown

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# pasteboard.getType()
2+
3+
> --------------------- ------------------------------------------------------------------------------------------
4+
> __Type__ [function][api.type.function]
5+
> __Return value__ [String][api.type.String]
6+
> __Revision__ [REVISION_LABEL](REVISION_URL)
7+
> __Keywords__ getType, pasteboard
8+
> __See also__ [Pasteboard][plugin.pasteboard]
9+
> [pasteboard.setAllowedTypes()][plugin.pasteboard.setAllowedTypes]
10+
> [pasteboard.copy()][plugin.pasteboard.copy]
11+
> --------------------- ------------------------------------------------------------------------------------------
12+
13+
14+
## Overview
15+
16+
Returns the type of data of the top-most item on the pasteboard. Returns either `"string"`, `"url"`, `"image"` when data is present. Otherwise returns `nil`.
17+
18+
19+
## Syntax
20+
21+
pasteboard.getType()
22+
23+
24+
## Example
25+
26+
``````lua
27+
local pasteboard = require( "plugin.pasteboard" )
28+
29+
-- Get the type of data on the pasteboard
30+
local dataType = pasteboard.getType()
31+
``````

docs/pasteboard/index.markdown

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# pasteboard.*
2+
3+
> --------------------- ------------------------------------------------------------------------------------------
4+
> __Type__ [Library][api.type.library]
5+
> __Revision__ [REVISION_LABEL](REVISION_URL)
6+
> __Keywords__ pasteboard, clipboard, copy, paste
7+
> __Platforms__ Android, iOS
8+
> --------------------- ------------------------------------------------------------------------------------------
9+
10+
## Overview
11+
12+
The Pasteboard plugin enables you to copy/paste from/to the device's pasteboard.
13+
14+
15+
## Syntax
16+
17+
local pasteboard = require( "plugin.pasteboard" )
18+
19+
20+
## Functions
21+
22+
#### [pasteboard.clear()][plugin.pasteboard.clear]
23+
24+
#### [pasteboard.copy()][plugin.pasteboard.copy]
25+
26+
#### [pasteboard.getType()][plugin.pasteboard.getType]
27+
28+
#### [pasteboard.paste()][plugin.pasteboard.paste]
29+
30+
#### [pasteboard.setAllowedTypes()][plugin.pasteboard.setAllowedTypes]
31+
32+
33+
## Project Settings
34+
35+
To use this plugin, add an entry into the `plugins` table of `build.settings`. When added, the build server will integrate the plugin during the build phase.
36+
37+
``````lua
38+
settings =
39+
{
40+
plugins =
41+
{
42+
["plugin.pasteboard"] =
43+
{
44+
publisherId = "com.coronalabs",
45+
},
46+
},
47+
}
48+
``````
49+
50+
<!---
51+
52+
## Sample Code
53+
54+
[https://github.com/coronalabs/plugins-sample-pasteboard/](https://github.com/coronalabs/plugins-sample-pasteboard)
55+
56+
-->
57+
58+
## Support
59+
60+
* [Corona Forums](http://forums.coronalabs.com/forum/631-corona-premium-plugins/)

docs/pasteboard/paste.markdown

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# pasteboard.paste()
2+
3+
> --------------------- ------------------------------------------------------------------------------------------
4+
> __Type__ [function][api.type.function]
5+
> __Revision__ [REVISION_LABEL](REVISION_URL)
6+
> __Keywords__ paste, pasteboard
7+
> __See also__ [Pasteboard][plugin.pasteboard]
8+
> [pasteboard.copy()][plugin.pasteboard.copy]
9+
> [pasteboard.clear()][plugin.pasteboard.clear]
10+
> --------------------- ------------------------------------------------------------------------------------------
11+
12+
13+
## Overview
14+
15+
Pastes the top-most item on the pasteboard.
16+
17+
18+
## Gotchas
19+
20+
Image copying/pasting is only supported on iOS.
21+
22+
23+
## Syntax
24+
25+
pasteboard.paste( [listener] )
26+
27+
##### listener ~^(optional)^~
28+
_[Function][api.type.Function]._ Listener function to be called when the paste is executed. This function is passed an `event` table which may contain the following properties, depending on the type of the data pasted:
29+
30+
* `event.filename` ([string][api.type.String]) &mdash; Name of the image that was pasted.
31+
* `event.baseDir` ([constant][api.type.Constant]) &mdash; The base system directory of the pasted image.
32+
* `event.string` ([string][api.type.String]) &mdash; The pasted string.
33+
* `event.url` ([string][api.type.String]) &mdash; The pasted URL.
34+
35+
36+
## Example
37+
38+
``````lua
39+
local pasteboard = require( "plugin.pasteboard" )
40+
41+
-- Callback function for the paste method
42+
local function onPaste( event )
43+
44+
-- Print the type of data on the pasteboard
45+
print( "Type of data:", pasteboard.getType() )
46+
47+
-- Paste an image
48+
if ( event.filename ) then
49+
print( "filename is:", event.filename )
50+
print( "baseDir is:", event.baseDir )
51+
end
52+
53+
-- Paste a string
54+
if ( event.string ) then
55+
print( "string is:", event.string )
56+
end
57+
58+
-- Paste a URL
59+
if ( event.url ) then
60+
print( "URL is:", event.url )
61+
end
62+
end
63+
64+
pasteboard.paste( onPaste )
65+
``````
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# pasteboard.setAllowedTypes()
2+
3+
> --------------------- ------------------------------------------------------------------------------------------
4+
> __Type__ [function][api.type.function]
5+
> __Return value__ none
6+
> __Revision__ [REVISION_LABEL](REVISION_URL)
7+
> __Keywords__ setAllowedTypes, pasteboard
8+
> __See also__ [Pasteboard][plugin.pasteboard]
9+
> --------------------- ------------------------------------------------------------------------------------------
10+
11+
12+
## Overview
13+
14+
Sets the file types that your app will accept when pasting. For example, if you only wish the app to paste strings, include just `"string"` in the `allowedTypes` table.
15+
16+
17+
## Syntax
18+
19+
pasteboard.setAllowedTypes( allowedTypes )
20+
pasteboard.setAllowedTypes( nil )
21+
22+
##### allowedTypes ~^(optional)^~
23+
_[Table][api.type.Table]._ Table containing a comma-delimited list of data types the app will accept for a paste action. Valid options include `"image"`, `"string"`, and `"url"`. You can also pass `nil` to disable all paste operations.
24+
25+
26+
## Example
27+
28+
``````lua
29+
local pasteboard = require( "plugin.pasteboard" )
30+
31+
-- Set the data types this application allows for a paste action
32+
pasteboard.setAllowedTypes( { "string", "url", "image" } )
33+
``````
20.8 KB
Binary file not shown.
131 KB
Binary file not shown.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
local metadata =
2+
{
3+
plugin =
4+
{
5+
format = 'staticLibrary',
6+
7+
-- This is the name without the 'lib' prefix.
8+
-- In this case, the static library is called: libSTATIC_LIB_NAME.a
9+
staticLibs = { 'pasteboard' },
10+
11+
frameworks = {},
12+
frameworksOptional = {},
13+
},
14+
}
15+
16+
return metadata
133 KB
Binary file not shown.

0 commit comments

Comments
 (0)