Skip to main content
Samsung Developer Program

SmartClip API Structure

This introduces Look S-Pen SmartClip API classes, interface, constructors, and methods, as well as their relationships. For details, see the online Look API Reference (http://img-developer.samsung.com/onlinedocs/sms/look/index.html).

For details about integrating the SmartClip API, see Integrating SmartClip.

Samsung Look S-Pen SmartClip Slook Classes and Methods.png

SlookSmartClip Class

A utility class that directly assigns and unassigns metadata to views, extracts metadata directly assigned to views, and registers listeners for SmartClipview calls issued after the user screen captures one or more views. View-call listeners send their extracted content to SmartClip in order to make it available to users.

Constructor  

SlookSmartClip(View view)

Instantiates a SmartClip object that targets the specified view for SmartClip metadata operations (such as directly assigning and unassigning metadata, and registering view-call listeners):

view     Name of the target view object
Methods    

void

addMetaTag(SlookSmartClipMetaTag metaTag)

 

Directly assigns the metadata of the specified meta-tag to the associated view object:

metaTag Declared name or specification of the meta-tag object

void

removeMetaTag(String tagType)

 

Unassigns the metadata of the specified meta-tag from the associated view object:

tagType Declared name or specification of the meta-tag object

void

clearAllMetaTag()

Unassigns ALL metadata that is directly assigned to the associated view object.

void

setDataExtractionListener(DataExtractionListener listener)


NOTE:  Can only be set for custom views.

Specifies the view-call listener for SmartClip calls issued  after the user crops a screen area that that includes part or all of the associated custom view:

listener

Declared name or specification of the view-call listener object

See DataExtractionListener.onExtractSmartClipData.

int

extractDefaultSmartClipData(
SlookSmartClipDataElement resultElement, SlookSmartClipCroppedArea, croppedArea)

Specified in view-call listeners to send the specified  user-cropped display text and user-cropped area to SmartClip for processing:

resultElement Variable name of the user-cropped display text of the listener's view

croppedArea

Variable name of the user-cropped area that includes part or all of the listener's view

SlookSmartClipMetaTag Class

Defines, instantiates, and manages meta-tags.

Constructor  

SlookSmartClipMetaTag(String tagType, String value)

 

Instantiates a SmartClip meta-tag object with the specified metadata kind and content:

tagType

Kind of metadata:

TAG_TYPE_PLAIN_TEXT Alphanumeric text
TAG_TYPE_TITLE Title data
TAG_TYPE_URL URL data
TAG_TYPE_APP_DEEP_LINK Uniform Resource Identifier (URI) that links to a specific location within a mobile app, rather than launching the app
value Content of the metadata
Methods    

String

getType()

Returns the kind of metadata of the associated meta-tag object:

TAG_TYPE_PLAIN_TEXT Alphanumeric text
TAG_TYPE_TITLE Title data
TAG_TYPE_URL URL data
TAG_TYPE_APP_DEEP_LINK Uniform Resource Identifier (URI) that links to a specific location within a mobile app, rather than launching the app
String getValue() Returns the metadata content of the associated meta-tag object.

void

setType(String tagType)

Specifies the kind of metadata of the associated meta-tag object:

tagType Kind of metadata:  
TAG_TYPE_PLAIN_TEXT Alphanumeric text
TAG_TYPE_TITLE Title data
TAG_TYPE_URL URL data
TAG_TYPE_APP_DEEP_LINK Uniform Resource Identifier (URI)
that links to a specific location within a mobile app, rather than launching the app

void

setValue(String value)

Specifies the metadata content of the associated meta-tag object:

value Metadata content of the meta-tag's metadata type that is to replace the previous content

SlookSmartClipMetaTagArray Class

Manages the meta tags with metadata that has been directly assigned to views.

Constructor  

SlookSmartClipMetaTagArray()

Instantiates an array object that contains all  meta-tags with metadata that is directly assigned to each view.

Methods    

abstract

getTag(String tagType)

Returns an array of all metadata of the specified metadata kind that is currently directly assigned to ALL views:

tagType Kind of metadata:  
TAG_TYPE_PLAIN_TEXT Alphanumeric text
TAG_TYPE_TITLE Title data
TAG_TYPE_URL URL data
TAG_TYPE_APP_DEEP_LINK Uniform Resource Identifier (URI)
that links to a specific location within a mobile app, rather than launching the app

NOTE:   If there is no directly assigned metadata of the specified kind, an empty array is returned.

abstract void

removeTag(String tagType)

Unassigns all metadata of the specified kind that is directly assigned to ALL views:

tagType Kind of metadata:  
TAG_TYPE_PLAIN_TEXT Alphanumeric text
TAG_TYPE_TITLE Title data
TAG_TYPE_URL URL data
TAG_TYPE_APP_DEEP_LINK Uniform Resource Identifier (URI)
that links to a specific location within a mobile app, rather than launching the app

Interface: SlookSmartClip.DataExtractionListener

Listens for notifications when users delineate an area for capture.

Methods    

int

onExtractSmartClipData(View view, SlookSmartClipDataElement resultElement, SlookSmartClipCroppedArea croppedArea)

Specifies in a view-call listener to assign variables to contain: (1) the name of the captured view (2) all metadata that the view-call listener indirectly assigns to its view and the user-cropped display text (3) the screen capture area.

Returns to SmartClip: the screen capture data EXTRACTION availability setting:

view     Variable name to be assigned to the name of the view that was partially or entirely captured within the user-crop area

resultElement

Variable name to be assigned to the user-cropped display text captured from the listener's view and all metadata that the view-call listener indirectly assigns to the listener's view 

NOTE:  This setting must be the same as
extractDefaultSmartClipData(resultElement).

croppedArea

Variable name to be assigned to the screen area that was cropped by the user

NOTE:  This setting must be the same as 
extractDefaultSmartClipData(croppedArea) setting.

 

return SlookSmartClip.DataExtractionListener
.[EXTRACTION Setting]

Specifies whether or not SmartClip is to make the screen-captured view's direct and/or indirect metadata and user-cropped display text available to screen capture management tools:

EXTRACTION_DEFAULT Direct and/or indirect metadata and user-cropped display text are to be made available.
EXTRACTION_DISCARD Only user-cropped display text is to be made available.

Interface: SlookSmartClipCroppedArea

Returns the screen area most recently cropped by the user, and whether a view or a specified rectangular screen area is within that user-cropped area.

Methods    
Rect getRect() Returns the rectangular screen area (Android left, top, right, bottom coordinates) that was most recently cropped by the user.

boolean

 

intersects(View view)

 

Returns whether or not the most recently user-cropped area includes part or all of the specified view:

view Declared name or specification of the view object

Returns:

true The user-cropped area does include part or all of the view.
false The user-cropped area does not include any part of the view.

boolean

intesects(Rect rect)

Returns whether or not the most recently user-cropped area includes part or all of the specified rectangular screen area:

rect Screen coordinates (Android left, top, right, bottom) of the rectangular screen area

Returns:

true The user-cropped area does include part or all of the rectangular screen area.
false The user-cropped area does not include any part of the rectangular screen area.

Interface: SlookSmartClipDataElement

Manages metadata that is directly and indirectly assigned to views, and is associated with screen areas.

Methods    

void

setMetaAreaRect(Rect rect)

Specifies the rectangular screen area of the metadata area rectangle.

rect Screen coordinates (left, top, right, bottom) of the rectangular screen area

Rect

getMetaAreaRect()

Returns the current coordinates (left, top, right, bottom) of the metadata area rectangular.  

The default value is the rectangular screen area of the matched view.  

void

addTag(
SlookSmartClipMetaTag metaTag)

 

Specified in a view-call listener object to indirectly assign metadata to the view that the listener is registered to.

metaTag Declared name or specification of the meta-tag object

void

removeTag(String tagType)

Unassigns all metadata of the specified kind that was directly assigned to the associated view:

tagType Kind of metadata:  
TAG_TYPE_PLAIN_TEXT Alphanumeric text
TAG_TYPE_TITLE Title data
TAG_TYPE_URL URL data
TAG_TYPE_APP_DEEP_LINK Uniform Resource Identifier (URI)
that links to a specific location within a mobile app, rather than launching the app

When there are more than one meta-tags of the specified tagType, each entire meta-tag will be removed.  

SlookSmartClip
​MetaTagArray

getTag(String tagType)

Returns an array containing all metadata of the specified kind that is currently directly assigned to the associated view:

tagType Kind of metadata:  
TAG_TYPE_PLAIN_TEXT Alphanumeric text
TAG_TYPE_TITLE Title data
TAG_TYPE_URL URL data
TAG_TYPE_APP_DEEP_LINK Uniform Resource Identifier (URI)
that links to a specific location within a mobile app, rather than launching the app

NOTE:   If there is no directly assigned metadata of the specified type, an empty array is returned.

SlookSmartClip
​MetaTagArray

getAllTag()

Returns an array containing all metadata of all metadata types that are directly assigned to the associated view.

NOTE:   If there is no directly assigned metadata of any type, an empty array is returned.

 

  • Was this article helpful?