Avaya Client Services API Reference (OS X)

- Main Page
- Classes
- Files
- Related Pages

- Class List
- Class Index
- Class Hierarchy
- Class Members

Instance Methods | Properties | List of all members
CSContentSharing Class Reference

The CSContentSharing object provides access to content sharing related capabilities and actions. More...

`#import <CSContentSharing.h>`

Inherits NSObject.

## Instance Methods
(void) | - startScrapingWindow:withZOrder:
| This method is used during application sharing to start scraping additional window besides main application window. More...
(void) | - stopScrapingWindow:
| Removes window from which scraping is being performed. More...
(void) | - stopScrapingAllWindows
| Empties the collection of additional windows which are scrapped besides main application window. More...
(void) | - startSharingFullScreenWithScreenId:completionHandler:
| Starts sharing full screen. More...
(void) | - startSharingApplicationWindowWithWindow:completionHandler:
| Starts sharing of an application window. More...
(void) | - startSharingScreenRegionWithScreenId:posX:posY:width:height:completionHandler:
| Starts sharing of a specified screen region. More...
(void) | - endWithCompletionHandler:
| Ends content sharing of local user or content sharing of another collaboration participant if local user has sufficient permissions i.e. More...
(void) | - pauseWithCompletionHandler:
| Pauses content sharing of local user. More...
(void) | - resumeWithCompletionHandler:
| Resumes content sharing. More...
(void) | - grantRemoteControlWithParticipant:completionHandler:
| Grants remote control to given participant. More...
(void) | - denyRemoteControlWithParticipant:completionHandler:
| Denies incoming remote control request of collaboration participant. More...
(void) | - requestRemoteControlWithCompletionHandler:
| Request remote control from current presenter if sharing is active. More...
(void) | - declineRemoteControlWithCompletionHandler:
| Decline remote control offer from current presenter for local user. More...
(void) | - endRemoteControlWithCompletionHandler:
| Ends remote control session. More...
(void) | - startRemoteControlWithCompletionHandler:
| Starts remote control. More...
(void) | - sendKeyboardEvent:
| Sends keyboard event. More...
(void) | - sendMouseEvent:
| Sends mouse event. More...
(void) | - sendClipboardEvent:
| Sends clipboard event. More...
(void) | - retrieveRemoteControlParticipantsWithCompletionHandler:
| Obtain the participants that support remote control. More...

## Properties
id< CSContentSharingDelegate > | delegate
| The delegate used to handle content sharing related events. More...
CSScreenSharingListener * | screenSharingListener
| Should be created and set by client here and also in the screen sharing view. More...
id< CSContentSharingRemoteControlDelegate > | remoteControlDelegate
| The delegate used to handle remote control related events. More...
CSParticipant * | currentPresenter
| Indicates participant who is currently sharing. More...
CSCapability * | shareFullScreenCapability
| CSCapability object indicating whether sharing full screen is supported. More...
BOOL | isSharingFullScreen
| Indicates whether local user is sharing full screen. More...
CSCapability * | shareApplicationWindowCapability
| CSCapability object indicating whether sharing application window is supported. More...
BOOL | isSharingApplicationWindow
| Indicates whether local user is sharing application window. More...
CSCapability * | sharedScreenRegionCapability
| CSCapability object indicating whether sharing region of screen is supported. More...
BOOL | isSharingScreenRegion
| Indicates whether local user is sharing region of screen. More...
BOOL | hasPresenterPrivilege
| Deprecated since 3.0.50. More...
BOOL | isPresenting
| Indicates whether local user is sharing. More...
CSCapability * | supportRemoteControlCapability
| CSCapability object indicating whether the content sharing supports remote control. More...
CSCapability * | offerRemoteControlCapability
| CSCapability object indicating whether the content sharing supports offering a remote control. More...
CSCapability * | requestRemoteControlCapability
| CSCapability object indicating whether the content sharing supports requesting for remote control. More...
BOOL | isRemoteControlOn
| Returns true if remote control session is currently started and current user is either presenting or remote-controlling the presenter. More...
CSParticipant * | remoteController
| Participant who has remote control over any other collaboration participant. More...
CSContentSharingCapabilities * | sharingCapabilities
| CSContentSharingCapabilities object containing set of content sharing capabilities. More...
CSSharingApplicationWindow * | sharedApplicationWindow
| CSharingApplicationWindow object. More...
NSDictionary * | availableDisplays
| NSDictionary containing objects of CSSharingDisplay. More...
NSArray * | availableAppWindows
| NSArray containing CSharingApplicationWindow objects which can be shared using content sharing method startSharingApplicationWindowWithWindow:completionHandler:. More...
CGRect | sharingFrame
| CGRect object which indicates frame of the display which is currently shared. More...

## Detailed Description

The CSContentSharing object provides access to content sharing related capabilities and actions.

This class is used for receiving and sending content sharing. CSContentSharing object is accessible via CSCollaboration. Status updates concerning content sharing are reported via CSContentSharingDelegate. CSContentSharing caches last frame of received content sharing. It's needed in situation when sharing is started before creating UI elements needed to present it.

See also
  CSCollaboration
  CSContentSharingDelegate
  CSScreenSharingListener
  CSOSXScreenSharingView

## Method Documentation

- (void) declineRemoteControlWithCompletionHandler: |  | (void(^)(CSParticipant *participant, NSError *error)) | handler |

Decline remote control offer from current presenter for local user.

Should be invoked after receiving contentSharing:didReceiveRemoteControlOffer: (CSContentSharingRemoteControlDelegate-p).

Parameters

  handler | A block to be called when the operation is completed. `participant` participant The participant whose offer was declined if operation was succesful. `error` If the operation was successful this parameter is nil. If an error occurred it contains an object describing the error.

- (void) denyRemoteControlWithParticipant: |  | (CSParticipant *) | participant
completionHandler: |  | (void(^)(CSParticipant *participant, NSError *error)) | handler

Denies incoming remote control request of collaboration participant.

Shoule be invoked after receiving notification contentSharing:didReceiveRemoteControlRequest: (CSContentSharingRemoteControlDelegate-p).

Parameters

  participant | Participant whose request is to be denied.
  handler | A block to be called when the operation is completed. `participant` Participant whose request was denied if operation was succesful. `error` If the operation was successful this parameter is nil. If an error occurred it contains an object describing the error.

- (void) endRemoteControlWithCompletionHandler: |  | (void(^)(CSParticipant *participant, NSError *error)) | handler |

Ends remote control session.

Parameters

  handler | A block to be called when the operation is completed. `participant` The local user data. `error` If the operation was successful this parameter is nil. If an error occurred it contains an object describing the error.

- (void) endWithCompletionHandler: |  | (void(^)(NSError *error)) | handler |

Ends content sharing of local user or content sharing of another collaboration participant if local user has sufficient permissions i.e.

is presenter or moderator.

Parameters

  handler | A block to be called when the operation is completed. `error` If the operation was successful this parameter is nil. If an error occurred it contains an object describing the error.

- (void) grantRemoteControlWithParticipant: |  | (CSParticipant *) | participant
completionHandler: |  | (void(^)(CSParticipant *participant, NSError *error)) | handler

Grants remote control to given participant.

Can be also be invoked as response after contentSharing:didReceiveRemoteControlRequest: (CSContentSharingRemoteControlDelegate-p).

Parameters

  participant | Participant who is offered remote control.
  handler | A block to be called when the operation is completed. `participant` Particpant granting remote control. `error` If the operation was successful this parameter is nil. If an error occurred it contains an object describing the error.

- (void) pauseWithCompletionHandler: |  | (void(^)(NSError *error)) | handler |

Pauses content sharing of local user.

It doesn't pause content sharing of another collaboration participant.

Parameters

  handler | A block to be called when the operation is completed. `error` If the operation was successful this parameter is nil. If an error occurred it contains an object describing the error.

- (void) requestRemoteControlWithCompletionHandler: |  | (void(^)(CSParticipant *participant, NSError *error)) | handler |

Request remote control from current presenter if sharing is active.

After presenter response, client is notified with contentSharing:didReceiveRemoteControlDeny: (CSContentSharingRemoteControlDelegate-p) or contentSharing:didReceiveRemoteControlGrant: (CSContentSharingRemoteControlDelegate-p).

Parameters

  handler | A block to be called when the operation is completed. `participant` participant The participant, who request was sent to, if operation was succesful. `error` If the operation was successful this parameter is nil. If an error occurred it contains an object describing the error.

- (void) resumeWithCompletionHandler: |  | (void(^)(NSError *error)) | handler |

Resumes content sharing.

It doesn't resume content sharing of another collaboration participant.

Parameters

  handler | A block to be called when the operation is completed. `error` If the operation was successful this parameter is nil. If an error occurred it contains an object describing the error.

- (void) retrieveRemoteControlParticipantsWithCompletionHandler: |  | (CSRemoteControlParticipantsCompletionHandler) | completionHandler |

Obtain the participants that support remote control.

Before calling the method you need to check that CSContentSharing::supportRemoteControlCapability is in allowed state. Otherwise the method call will fail with appropriate error.

Since there is no collaboration/content sharing event notification about a change of participants, client has to rely on corresponding CSConference events to be notified about participant list changes. Whenever such notification occurs, client must expect that remote control participant list might have changed and this method must be called again, if up to date participant list is to be presented to the user.

See also
  CSConference::participants

Parameters

  completionHandler | Completion handler for this operation.

- (void) sendClipboardEvent: |  | (CSClipboardEvent *) | clipboardEvent |

Sends clipboard event.

Client doesn't need to use this method unless custom sharing view is developed.

- (void) sendKeyboardEvent: |  | (CSKeyboardEvent *) | keyboardEvent |

Sends keyboard event.

Client doesn't need to use this method unless custom sharing view is developed.

- (void) sendMouseEvent: |  | (CSMouseEvent *) | mouseEvent |

Sends mouse event.

Client doesn't need to use this method unless custom sharing view is developed.

- (void) startRemoteControlWithCompletionHandler: |  | (void(^)(CSParticipant *participant, NSError *error)) | handler |

Starts remote control.

Should be called after receiving contentSharing:didReceiveRemoteControlOffer: (CSContentSharingRemoteControlDelegate-p). It doesn't need to be called in situation when local user requests remote control and gets grant for remote control because it's invoked internally by Client SDK.

Parameters

  handler | A block to be called when the operation is completed. `participant` The local user data. `error` If the operation was successful this parameter is nil. If an error occurred it contains an object describing the error.

- (void) startScrapingWindow: |  | (NSWindow *) | window
withZOrder: |  | (NSUInteger) | zOrder

This method is used during application sharing to start scraping additional window besides main application window.

To start sharing application window use startSharingApplicationWindowWithWindow:completionHandler:. Should be used solely during sharing application window, doesn't work without application sharing started and doesn't start application sharing. Method should be used to add custom client windows which are supposed to overlay shared application window. Windows which are added via this method, but doesn't overlay main shared application window, aren't shared. Windows added with this function should be removed with stopScrapingWindow: or stopScrapingAllWindows.

Parameters

  window | NSWindow object which should be scrapped besides main application window
  zOrder | Ordering of overlapping scraped window images. A window with a higher z-order value than another window appears on the foreground and may hide a portion of, or entire window with the lower z-order.

See also
  - startSharingApplicationWindowWithWindow:completionHandler:
  - stopScrapingWindow:
  - stopScrapingAllWindows

- (void) startSharingApplicationWindowWithWindow: |  | (CSSharingApplicationWindow *) | window
completionHandler: |  | (void(^)(NSError *error)) | handler

Starts sharing of an application window.

You don't need to stop another sharing before using it. When this method is used while sharing is received, sharing of another participant will be stopped if local user have sufficient permissions (local user is moderator or presenter). Application windows possible to share can be obtained by CSContentSharing::availableAppWindows.

Note
  So as to make it possibile to share minimised application and bring application to front when sharing is started accessibility API needs to be used. Because of it, when starting sharing application, alert is shown. User can allow application to control computer in system preferences or deny it. Alert is shown asynchronously.

Parameters

  window | CSSharingApplicationWindow which should be shared
  handler | A block to be called when the operation is completed. `error` If the operation was successful this parameter is nil. If an error occurred it contains an object describing the error.

See also
  availableAppWindows
  CSSharingApplicationWindow

- (void) startSharingFullScreenWithScreenId: |  | (NSInteger) | screenId
completionHandler: |  | (void(^)(NSError *error)) | handler

Starts sharing full screen.

You don't need to stop another sharing before using it. When this method is used while sharing is received, sharing of another participant will be stopped if local user have sufficient permissions (local user is moderator or presenter). Screens possible to share can be obtained using CSContentSharing::availableDisplays.

Parameters

  screenId | ID of screen which should be shared.
  handler | Block to be called when the operation is completed. `error` If the operation was successful this parameter is nil. If an error occurred it contains an object describing the error.

See also
  availableDisplays
  CSSharingDisplay

- (void) startSharingScreenRegionWithScreenId: |  | (NSInteger) | screenId
posX: |  | (NSInteger) | x
posY: |  | (NSInteger) | y
width: |  | (NSInteger) | width
height: |  | (NSInteger) | height
completionHandler: |  | (void(^)(NSError *error)) | handler

Starts sharing of a specified screen region.

You don't need to stop another sharing before using it. When this method is used while sharing is received, sharing of another participant will be stopped if local user have sufficient permissions (local user is moderator or presenter). Screens possible to share can be obtained using CSContentSharing::availableDisplays. Sharing coordinates are relative to given screenId.

Parameters

  screenId | ID of screen which should be shared.
  x | X coordinate of the bottom left corner in pixels.
  y | Y coordinate of the bottom left corner in pixels.
  width | Width of the shared region in pixels.
  height | Height of the shared region in pixels.
  handler | A block to be called when the operation is completed. `error` If the operation was successful this parameter is nil. If an error occurred it contains an object describing the error.

See also
  availableDisplays

- (void) stopScrapingAllWindows |  |  |

Empties the collection of additional windows which are scrapped besides main application window.

It doesn't stop application sharing, it doesn't remove main application window from scraping and it doesn't stop sharing application window. It should be used solely during sharing application window.

See also
  - startScrapingWindow:withZOrder:
  - startSharingApplicationWindowWithWindow:completionHandler:
  - stopScrapingWindow:

- (void) stopScrapingWindow: |  | (NSWindow *) | window |

Removes window from which scraping is being performed.

It doesn't stop application window sharing. You can't remove the main application window form scraping via this method. It should be used solely during sharing application window.

Parameters

  window | Window object

See also
  - startSharingApplicationWindowWithWindow:completionHandler:
  - startScrapingWindow:withZOrder:
  - stopScrapingAllWindows

## Property Documentation

- (NSArray*) availableAppWindows
| read nonatomic assign

NSArray containing CSharingApplicationWindow objects which can be shared using content sharing method startSharingApplicationWindowWithWindow:completionHandler:.

Array contains also windows of client application which can be filtered out using NSWindow::windowNumber and CSSharingApplicationWindow::winId.

See also
  - startSharingApplicationWindowWithWindow:completionHandler:
  CSSharingApplicationWindow

- (NSDictionary*) availableDisplays
| read nonatomic assign

NSDictionary containing objects of CSSharingDisplay.

Each CSSharingDisplay can be shared using content sharing method startSharingFullScreenWithScreenId:completionHandler:. Display IDs are keys of this dictionary.

See also
  - startSharingFullScreenWithScreenId:completionHandler:
  CSSharingDisplay

- (CSParticipant*) currentPresenter
| read nonatomic assign

Indicates participant who is currently sharing.

Returns nil in case sharing is not active.

- (id<CSContentSharingDelegate>) delegate
| read write nonatomic weak

The delegate used to handle content sharing related events.

- (BOOL) hasPresenterPrivilege
| read nonatomic assign

Deprecated since 3.0.50.

Please use CSCollaboration property.

See also
  CSCollaboration::hasPresenterPrivilege

- (BOOL) isPresenting
| read nonatomic assign

Indicates whether local user is sharing.

- (BOOL) isRemoteControlOn
| read nonatomic assign

Returns true if remote control session is currently started and current user is either presenting or remote-controlling the presenter.

- (BOOL) isSharingApplicationWindow
| read nonatomic assign

Indicates whether local user is sharing application window.

- (BOOL) isSharingFullScreen
| read nonatomic assign

Indicates whether local user is sharing full screen.

- (BOOL) isSharingScreenRegion
| read nonatomic assign

Indicates whether local user is sharing region of screen.

- (CSCapability*) offerRemoteControlCapability
| read nonatomic assign

CSCapability object indicating whether the content sharing supports offering a remote control.

- (id<CSContentSharingRemoteControlDelegate>) remoteControlDelegate
| read write nonatomic weak

The delegate used to handle remote control related events.

- (CSParticipant*) remoteController
| read nonatomic assign

Participant who has remote control over any other collaboration participant.

Nil in case remote control is not active.

- (CSCapability*) requestRemoteControlCapability
| read nonatomic assign

CSCapability object indicating whether the content sharing supports requesting for remote control.

- (CSScreenSharingListener*) screenSharingListener
| read write nonatomic strong

Should be created and set by client here and also in the screen sharing view.

See also
  CSContentSharingDelegate
  CSOSXScreenSharingView

- (CSCapability*) shareApplicationWindowCapability
| read nonatomic assign

CSCapability object indicating whether sharing application window is supported.

See also
  CSCollaboration::contentSharingCapability

- (CSSharingApplicationWindow*) sharedApplicationWindow
| read nonatomic assign

CSharingApplicationWindow object.

During application sharing it's object of currently shared application window. Otherwise, it's not guaranteed that this object is valid.

See also
  availableAppWindows
  - startSharingApplicationWindowWithWindow:completionHandler:

- (CSCapability*) sharedScreenRegionCapability
| read nonatomic assign

CSCapability object indicating whether sharing region of screen is supported.

See also
  CSCollaboration::contentSharingCapability

- (CSCapability*) shareFullScreenCapability
| read nonatomic assign

CSCapability object indicating whether sharing full screen is supported.

See also
  CSCollaboration::contentSharingCapability

- (CSContentSharingCapabilities*) sharingCapabilities
| read nonatomic assign

CSContentSharingCapabilities object containing set of content sharing capabilities.

- (CGRect) sharingFrame
| read nonatomic assign

CGRect object which indicates frame of the display which is currently shared.

For example, in case of sharing application window, CGRect is frame of shared window. Change of this property is notified by contentSharing:didChangeSharingFrame: (CSContentSharingDelegate-p). When sharing is not active, it's not guaranteed that this object is valid.

See also
  - contentSharing:didChangeSharingFrame: (CSContentSharingDelegate-p)

- (CSCapability*) supportRemoteControlCapability
| read nonatomic assign

CSCapability object indicating whether the content sharing supports remote control.

The documentation for this class was generated from the following file:

- CSContentSharing.h