Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Documentation
Sidebar

Protocols Reference

Section Contents

Overview

The following protocols are available globally.

SDLInt

A decleration that this NSNumber contains an NSInteger.

Objective-C

@protocol SDLInt

Swift

protocol SDLInt

SDLUInt

A declaration that this NSNumber contains an NSUInteger.

Objective-C

@protocol SDLUInt

Swift

protocol SDLUInt

SDLBool

A declaration that this NSNumber contains a BOOL.

Objective-C

@protocol SDLBool

Swift

protocol SDLBool

SDLFloat

A declaration that this NSNumber contains a float.

Objective-C

@protocol SDLFloat

Swift

protocol SDLFloat

SDLAudioStreamManagerDelegate

Undocumented

See more

Objective-C

@protocol SDLAudioStreamManagerDelegate <NSObject>

@required

/**
 Called when a file from the SDLAudioStreamManager finishes playing

 @param audioManager A reference to the audio stream manager
 @param fileURL The URL that finished playing
 @param successfully Whether or not it was played successfully
 */
- (void)audioStreamManager:(SDLAudioStreamManager *)audioManager fileDidFinishPlaying:(NSURL *)fileURL successfully:(BOOL)successfully;

/**
 Called when a file from the SDLAudioStreamManager could not play

 @param audioManager  A reference to the audio stream manager
 @param fileURL The URL that failed
 @param error The error that occurred
 */
- (void)audioStreamManager:(SDLAudioStreamManager *)audioManager errorDidOccurForFile:(NSURL *)fileURL error:(NSError *)error;

@end

Swift

protocol SDLAudioStreamManagerDelegate : NSObjectProtocol

SDLChoiceSetDelegate

Undocumented

See more

Objective-C

@protocol SDLChoiceSetDelegate <NSObject>

- (void)choiceSet:(SDLChoiceSet *)choiceSet didSelectChoice:(SDLChoiceCell *)choice withSource:(SDLTriggerSource)source atRowIndex:(NSUInteger)rowIndex;
- (void)choiceSet:(SDLChoiceSet *)choiceSet didReceiveError:(NSError *)error;

@end

Swift

protocol SDLChoiceSetDelegate : NSObjectProtocol

SDLKeyboardDelegate

Undocumented

See more

Objective-C

@protocol SDLKeyboardDelegate <NSObject>

//

/**
 The keyboard session completed with some input.

 This will be sent upon ENTRY_SUBMITTED or ENTRY_VOICE. If the event is ENTRY_VOICE, the user requested to start a voice session in order to submit input to this keyboard. This MUST be handled by you. Start an Audio Pass Thru session if supported.

 @param inputText The submitted input text on the keyboard
 @param source ENTRY_SUBMITTED if the user pressed the submit button on the keyboard, ENTRY_VOICE if the user requested that a voice session begin
 */
- (void)userDidSubmitInput:(NSString *)inputText withEvent:(SDLKeyboardEvent)source;

/**
 The keyboard session aborted.

 This will be sent if the keyboard event ENTRY_CANCELLED or ENTRY_ABORTED is sent

 @param event ENTRY_CANCELLED if the user cancelled the keyboard input, or ENTRY_ABORTED if the system aborted the input due to a higher priority event
 */
- (void)keyboardDidAbortWithReason:(SDLKeyboardEvent)event;

@optional
/**
 Implement this in order to provide a custom keyboard configuration to just this keyboard. To apply default settings to all keyboards, see SDLScreenManager.keyboardConfiguration

 @return The custom keyboard configuration to use.
 */
- (SDLKeyboardProperties *)customKeyboardConfiguration;

/**
 Implement this if you wish to update the KeyboardProperties.autoCompleteText as the user updates their input. This is called upon a KEYPRESS event.

 @param currentInputText The user's full current input text
 @param completionHandler A completion handler to update the autoCompleteText
 */
- (void)updateAutocompleteWithInput:(NSString *)currentInputText completionHandler:(SDLKeyboardAutocompleteCompletionHandler)completionHandler;

/**
 Implement this if you wish to update the limitedCharacterSet as the user updates their input. This is called upon a KEYPRESS event.

 @param currentInputText The user's full current input text
 @param completionHandler A completion handler to update the limitedCharacterSet
 */
-(void)updateCharacterSetWithInput:(NSString *)currentInputText completionHandler:(SDLKeyboardCharacterSetCompletionHandler)completionHandler;

// This will be sent for any event that occurs with the event and the current input text

/**
 Implement this to be notified of all events occurring on the keyboard

 @param event The event that occurred
 @param currentInputText The user's full current input text
 */
- (void)keyboardDidSendEvent:(SDLKeyboardEvent)event text:(NSString *)currentInputText;

@end

Swift

protocol SDLKeyboardDelegate : NSObjectProtocol

SDLLogTarget

A protocol describing a place logs from SDLLogManager are logged to

See more

Objective-C

@protocol SDLLogTarget <NSObject>

Swift

protocol SDLLogTarget : NSObjectProtocol

SDLManagerDelegate

Undocumented

See more

Objective-C

@protocol SDLManagerDelegate <NSObject>

/**
 *  Called upon a disconnection from the remote system.
 */
- (void)managerDidDisconnect;

/**
 *  Called when the HMI level state of this application changes on the remote system. This is equivalent to the application's state changes in iOS such as foreground, background, or closed.
 *
 *  @param oldLevel The previous level which has now been left.
 *  @param newLevel The current level.
 */
- (void)hmiLevel:(SDLHMILevel)oldLevel didChangeToLevel:(SDLHMILevel)newLevel;

@optional
/**
 *  Called when the audio streaming state of this application changes on the remote system. This refers to when streaming audio is audible to the user.
 *
 *  @param oldState The previous state which has now been left.
 *  @param newState The current state.
 */
- (void)audioStreamingState:(nullable SDLAudioStreamingState)oldState didChangeToState:(SDLAudioStreamingState)newState;

/**
 *  Called when the system context of this application changes on the remote system. This refers to whether or not a user-initiated interaction is in progress, and if so, what it is.
 *
 *  @param oldContext The previous context which has now been left.
 *  @param newContext The current context.
 */
- (void)systemContext:(nullable SDLSystemContext)oldContext didChangeToContext:(SDLSystemContext)newContext;

/**
 * Called when the lifecycle manager detected a language mismatch. In case of a language mismatch the manager should change the apps registration by updating the lifecycle configuration to the specified language. If the app can support the specified language it should return an Object of SDLLifecycleConfigurationUpdate, otherwise it should return nil to indicate that the language is not supported.
 *
 * @param language The language of the connected head unit the manager is trying to update the configuration.
 * @return An object of SDLLifecycleConfigurationUpdate if the head unit language is supported, otherwise nil to indicate that the language is not supported.
 */
- (nullable SDLLifecycleConfigurationUpdate *)managerShouldUpdateLifecycleToLanguage:(SDLLanguage)language;


@end

Swift

protocol SDLManagerDelegate : NSObjectProtocol

SDLSecurityType

A protocol used by SDL Security libraries.

Warning

Used internally
See more

Objective-C

@protocol SDLSecurityType <NSObject>

Swift

protocol SDLSecurityType : NSObjectProtocol

SDLStreamingAudioManagerType

Undocumented

See more

Objective-C

@protocol SDLStreamingAudioManagerType <NSObject>

/**
 Whether or not the audio byte stream is currently connected
 */
@property (assign, nonatomic, readonly, getter=isAudioConnected) BOOL audioConnected;

/**
 Send audio data bytes over the audio byte stream

 @param audioData The PCM data bytes
 @return Whether or not it sent successfully
 */
- (BOOL)sendAudioData:(NSData *)audioData;

@end

Swift

protocol SDLStreamingAudioManagerType : NSObjectProtocol

SDLStreamingMediaManagerDataSource

Undocumented

See more

Objective-C

@protocol SDLStreamingMediaManagerDataSource <NSObject>

/**
 Implement to return a different preferred order of attempted format usage than the head unit's preferred order. In nearly all cases, it's best to simply return the head unit's preferred order, or not implement this method (which does the same thing).
 
 @warning If you return a format that is not supported by the StreamingMediaManager, that format will be skipped.
 
 @note If the head unit does not support the `GetSystemCapabilities` RPC, this method will not be called and H264 RAW will be used.

 @param headUnitPreferredOrder The head unit's preferred order of format usage. The first item is the one that will be used unless this proxy does not support it, then the next item, etc.
 @return Your preferred order of format usage.
 */
- (NSArray<SDLVideoStreamingFormat *> *)preferredVideoFormatOrderFromHeadUnitPreferredOrder:(NSArray<SDLVideoStreamingFormat *> *)headUnitPreferredOrder;

/**
 Implement to return a different resolution to use for video streaming than the head unit's requested resolution. If you return a resolution that the head unit does not like, the manager will fail to start up. In nearly all cases, it's best to simply return the head unit's preferred order, or not implement this method (which does the same thing), and adapt your UI to the head unit's preferred resolution instead.

 @param headUnitPreferredResolution The resolution the head unit requested to use.
 @return Your preferred order of image resolution usage. This system will not attempt more than 3 resolutions. It is strongly recommended that at least one resolution is the head unit's preferred resolution.
 */
- (NSArray<SDLImageResolution *> *)resolutionFromHeadUnitPreferredResolution:(SDLImageResolution *)headUnitPreferredResolution;

@end

Swift

protocol SDLStreamingMediaManagerDataSource : NSObjectProtocol

SDLTouchManagerDelegate

Undocumented

See more

Objective-C

@protocol SDLTouchManagerDelegate <NSObject>

@optional

/**
 A single tap was received

 @param manager The SDLTouchManager issuing the callback
 @param view The view under the touch if it could be determined
 @param point The point at which the touch occurred in the head unit's coordinate system
 */
- (void)touchManager:(SDLTouchManager *)manager didReceiveSingleTapForView:(UIView *_Nullable)view atPoint:(CGPoint)point;

/**
 A double tap was received

 @param manager The SDLTouchManager issuing the callback
 @param view The view under the touch if it could be determined
 @param point Location of the double tap in the head unit's coordinate system. This is the average of the first and second tap.
 */
- (void)touchManager:(SDLTouchManager *)manager didReceiveDoubleTapForView:(UIView *_Nullable)view atPoint:(CGPoint)point;

/**
 Panning started

 @param manager The SDLTouchManager issuing the callback
 @param view The view under where the panning started if it could be determined
 @param point Location of the panning start point in the head unit's coordinate system.
 */
- (void)touchManager:(SDLTouchManager *)manager panningDidStartInView:(UIView *_Nullable)view atPoint:(CGPoint)point;

/**
 Panning moved between points

 @param manager The SDLTouchManager issuing the callback
 @param fromPoint Location of the panning's previous point in the head unit's coordinate system
 @param toPoint Location of the panning's new point in the head unit's coordinate system
 */
- (void)touchManager:(SDLTouchManager *)manager didReceivePanningFromPoint:(CGPoint)fromPoint toPoint:(CGPoint)toPoint;

/**
 Panning ended

 @param manager The SDLTouchManager issuing the callback
 @param view The view under where the panning ended if it could be determined
 @param point Location of the panning's end point in the head unit's coordinate system
 */
- (void)touchManager:(SDLTouchManager *)manager panningDidEndInView:(UIView *_Nullable)view atPoint:(CGPoint)point;

/**
 Panning canceled

 @param manager The SDLTouchManager issuing the callback
 @param point Location of the panning's end point in the head unit's coordinate system
 */
- (void)touchManager:(SDLTouchManager *)manager panningCanceledAtPoint:(CGPoint)point;

/**
 Pinch did start

 @param manager The SDLTouchManager issuing the callback
 @param view The view under the center of the pinch start
 @param point Center point of the pinch in the head unit's coordinate system
 */
- (void)touchManager:(SDLTouchManager *)manager pinchDidStartInView:(UIView *_Nullable)view atCenterPoint:(CGPoint)point;

/**
 *  @abstract
 *      Pinch did move.
 *  @param manager
 *      Current initalized SDLTouchManager issuing the callback.
 *  @param point
 *      Center point of the pinch in the head unit's coordinate system.
 *  @param scale
 *      Scale relative to the distance between touch points.
 */
- (void)touchManager:(SDLTouchManager *)manager didReceivePinchAtCenterPoint:(CGPoint)point withScale:(CGFloat)scale;

/**
 Pinch moved and changed scale

 @param manager The SDLTouchManager issuing the callback
 @param view The view under the center of the pinch
 @param point Center point of the pinch in the head unit's coordinate system
 @param scale Scale relative to the distance between touch points
 */
- (void)touchManager:(SDLTouchManager *)manager didReceivePinchInView:(UIView *_Nullable)view atCenterPoint:(CGPoint)point withScale:(CGFloat)scale;

/**
 Pinch did end

 @param manager The SDLTouchManager issuing the callback
 @param view The view under the center of the pinch
 @param point Center point of the pinch in the head unit's coordinate system
 */
- (void)touchManager:(SDLTouchManager *)manager pinchDidEndInView:(UIView *_Nullable)view atCenterPoint:(CGPoint)point;

/**
 Pinch canceled

 @param manager The SDLTouchManager issuing the callback
 @param point Center point of the pinch in the head unit's coordinate system
 */
- (void)touchManager:(SDLTouchManager *)manager pinchCanceledAtCenterPoint:(CGPoint)point;

@end

Swift

protocol SDLTouchManagerDelegate : NSObjectProtocol
View on GitHub.com