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

SDLSoftButton Class Reference

Section Contents

Overview

Describes an on-screen button which may be presented in various contexts, e.g. templates or alerts

-initWithHandler:

Convenience init

Objective-C

- (nonnull instancetype)initWithHandler:
    (nullable SDLRPCButtonNotificationHandler)handler;

Swift

init(handler: SDLRPCButtonNotificationHandler? = nil)

Parameters

handler

A handler that may optionally be run when the SDLSoftButton has a corresponding notification occur

-initWithType:text:image:highlighted:buttonId:systemAction:handler:

Convenience init

Objective-C

- (nonnull instancetype)initWithType:(nonnull SDLSoftButtonType)type
                                text:(nullable NSString *)text
                               image:(nullable SDLImage *)image
                         highlighted:(BOOL)highlighted
                            buttonId:(UInt16)buttonId
                        systemAction:(nullable SDLSystemAction)systemAction
                             handler:(nullable SDLRPCButtonNotificationHandler)
                                         handler;

Swift

init(type: SDLSoftButtonType, text: String?, image: SDLImage?, highlighted: Bool, buttonId: UInt16, systemAction: SDLSystemAction?, handler: SDLRPCButtonNotificationHandler? = nil)

Parameters

type

Describes whether this soft button displays only text, only an image, or both

text

Optional text to display (if defined as TEXT or BOTH type)

image

Optional image struct for SoftButton (if defined as IMAGE or BOTH type)

highlighted

Displays in an alternate mode, e.g. with a colored background or foreground. Depends on the IVI system

buttonId

Value which is returned via OnButtonPress / OnButtonEvent

systemAction

Parameter indicating whether selecting a SoftButton shall call a specific system action

handler

A handler that may optionally be run when the SDLSoftButton has a corresponding notification occur.

handler

A handler that may optionally be run when the SDLSoftButton has a corresponding notification occur.

Objective-C

@property (nonatomic, copy) SDLRPCButtonNotificationHandler _Nonnull handler;

Swift

var handler: SDLRPCButtonNotificationHandler { get set }

type

Describes whether this soft button displays only text, only an image, or both

Required

Objective-C

@property (nonatomic, strong) SDLSoftButtonType _Nonnull type;

Swift

var type: SDLSoftButtonType { get set }

text

Optional text to display (if defined as TEXT or BOTH type)

Optional

Objective-C

@property (nonatomic, strong, nullable) NSString *text;

Swift

var text: String? { get set }

image

Optional image struct for SoftButton (if defined as IMAGE or BOTH type)

Optional

Objective-C

@property (nonatomic, strong, nullable) SDLImage *image;

Swift

var image: SDLImage? { get set }

isHighlighted

Displays in an alternate mode, e.g. with a colored background or foreground. Depends on the IVI system.

Optional

Objective-C

@property (nonatomic, strong, nullable) NSNumber<SDLBool> *isHighlighted;

Swift

var isHighlighted: (NSNumber & SDLBool)? { get set }

softButtonID

Value which is returned via OnButtonPress / OnButtonEvent

Required

Objective-C

@property (nonatomic, strong) NSNumber<SDLInt> *_Nonnull softButtonID;

Swift

var softButtonID: NSNumber & SDLInt { get set }

systemAction

Parameter indicating whether selecting a SoftButton shall call a specific system action. This is intended to allow Notifications to bring the callee into full / focus; or in the case of persistent overlays, the overlay can persist when a SoftButton is pressed.

Optional

Objective-C

@property (nonatomic, strong, nullable) SDLSystemAction systemAction;

Swift

var systemAction: SDLSystemAction? { get set }
View on GitHub.com
Previous Section Next Section