blob: d313edb3916099b032a673694ec80dc7d169fbc8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
//
// SDLNotificationConstants.h
// SmartDeviceLink-iOS
//
// Created by Justin Dickow on 9/30/15.
// Copyright © 2015 smartdevicelink. All rights reserved.
//
#import <Foundation/Foundation.h>
@class SDLOnButtonEvent;
@class SDLOnButtonPress;
@class SDLOnCommand;
@class SDLRPCNotification;
@class SDLRPCResponse;
@class SDLRPCRequest;
NS_ASSUME_NONNULL_BEGIN
// Resolves issue of using Swift 3 and pre-iOS 10 versions due to NSNotificationName unavailability.
#if __IPHONE_OS_VERSION_MAX_ALLOWED <= __IPHONE_9_3
#define NOTIFICATION_TYPEDEF NSString *
#else
#define NOTIFICATION_TYPEDEF NSNotificationName
#endif
typedef NOTIFICATION_TYPEDEF SDLNotificationName;
typedef NSString *SDLNotificationUserInfoKey;
#pragma mark - Blocks
/**
* A handler used on SDLPerformAudioPassThru.
*
* @param audioData The audio data contained in the notification.
*/
typedef void (^SDLAudioPassThruHandler)(NSData *__nullable audioData);
/**
* A handler used on all RPC requests which fires when the response is received.
*
* @param request The request which was sent.
* @param response The response which was received.
* @param error If sending the request encountered an error, this parameter will not be nil.
*/
typedef void (^SDLResponseHandler)(__kindof SDLRPCRequest *__nullable request, __kindof SDLRPCResponse *__nullable response, NSError *__nullable error);
/**
A handler that may optionally be run when an SDLSubscribeButton or SDLSoftButton has a corresponding notification occur.
@warning This only works if you send the RPC using SDLManager.
@warning Only one of the two parameters will be set for each block call.
@param buttonPress An SDLOnButtonPress object that corresponds to this particular button.
@param buttonEvent An SDLOnButtonEvent object that corresponds to this particular button.
*/
typedef void (^SDLRPCButtonNotificationHandler)(SDLOnButtonPress *_Nullable buttonPress, SDLOnButtonEvent *_Nullable buttonEvent);
/**
A handler that may optionally be run when an SDLAddCommand has a corresponding notification occur.
@warning This only works if you send the RPC using SDLManager.
@param command An SDLOnCommand object that corresponds to this particular SDLAddCommand.
*/
typedef void (^SDLRPCCommandNotificationHandler)(SDLOnCommand *command);
/**
* The key used in all SDL NSNotifications to extract the response or notification from the userinfo dictionary.
*/
#pragma mark - Notification info dictionary keys
extern SDLNotificationUserInfoKey const SDLNotificationUserInfoObject;
/**
* Some general NSNotification names not associated with any specific RPC response or request.
*/
#pragma mark - General notifications
extern SDLNotificationName const SDLTransportDidDisconnect;
extern SDLNotificationName const SDLTransportDidConnect;
extern SDLNotificationName const SDLDidReceiveError;
extern SDLNotificationName const SDLDidReceiveLockScreenIcon;
extern SDLNotificationName const SDLDidBecomeReady;
/**
* NSNotification names associated with specific RPC responses.
*/
#pragma mark - RPC responses
extern SDLNotificationName const SDLDidReceiveAddCommandResponse;
extern SDLNotificationName const SDLDidReceiveAddSubMenuResponse;
extern SDLNotificationName const SDLDidReceiveAlertResponse;
extern SDLNotificationName const SDLDidReceiveAlertManeuverResponse;
extern SDLNotificationName const SDLDidReceiveChangeRegistrationResponse;
extern SDLNotificationName const SDLDidReceiveCreateInteractionChoiceSetResponse;
extern SDLNotificationName const SDLDidReceiveDeleteCommandResponse;
extern SDLNotificationName const SDLDidReceiveDeleteFileResponse;
extern SDLNotificationName const SDLDidReceiveDeleteInteractionChoiceSetResponse;
extern SDLNotificationName const SDLDidReceiveDeleteSubmenuResponse;
extern SDLNotificationName const SDLDidReceiveDiagnosticMessageResponse;
extern SDLNotificationName const SDLDidReceiveDialNumberResponse;
extern SDLNotificationName const SDLDidReceiveEncodedSyncPDataResponse;
extern SDLNotificationName const SDLDidReceiveEndAudioPassThruResponse;
extern SDLNotificationName const SDLDidReceiveGenericResponse;
extern SDLNotificationName const SDLDidReceiveGetDTCsResponse;
extern SDLNotificationName const SDLDidReceiveGetSystemCapabilitiesResponse;
extern SDLNotificationName const SDLDidReceiveGetVehicleDataResponse;
extern SDLNotificationName const SDLDidReceiveGetWaypointsResponse;
extern SDLNotificationName const SDLDidReceiveListFilesResponse;
extern SDLNotificationName const SDLDidReceivePerformAudioPassThruResponse;
extern SDLNotificationName const SDLDidReceivePerformInteractionResponse;
extern SDLNotificationName const SDLDidReceivePutFileResponse;
extern SDLNotificationName const SDLDidReceiveReadDIDResponse;
extern SDLNotificationName const SDLDidReceiveRegisterAppInterfaceResponse;
extern SDLNotificationName const SDLDidReceiveResetGlobalPropertiesResponse;
extern SDLNotificationName const SDLDidReceiveScrollableMessageResponse;
extern SDLNotificationName const SDLDidReceiveSendHapticDataResponse;
extern SDLNotificationName const SDLDidReceiveSendLocationResponse;
extern SDLNotificationName const SDLDidReceiveSetAppIconResponse;
extern SDLNotificationName const SDLDidReceiveSetDisplayLayoutResponse;
extern SDLNotificationName const SDLDidReceiveSetGlobalPropertiesResponse;
extern SDLNotificationName const SDLDidReceiveSetMediaClockTimerResponse;
extern SDLNotificationName const SDLDidReceiveShowConstantTBTResponse;
extern SDLNotificationName const SDLDidReceiveShowResponse;
extern SDLNotificationName const SDLDidReceiveSliderResponse;
extern SDLNotificationName const SDLDidReceiveSpeakResponse;
extern SDLNotificationName const SDLDidReceiveSubscribeButtonResponse;
extern SDLNotificationName const SDLDidReceiveSubscribeVehicleDataResponse;
extern SDLNotificationName const SDLDidReceiveSubscribeWaypointsResponse;
extern SDLNotificationName const SDLDidReceiveSyncPDataResponse;
extern SDLNotificationName const SDLDidReceiveUpdateTurnListResponse;
extern SDLNotificationName const SDLDidReceiveUnregisterAppInterfaceResponse;
extern SDLNotificationName const SDLDidReceiveUnsubscribeButtonResponse;
extern SDLNotificationName const SDLDidReceiveUnsubscribeVehicleDataResponse;
extern SDLNotificationName const SDLDidReceiveUnsubscribeWaypointsResponse;
/**
* NSNotification names associated with specific RPC notifications.
*/
#pragma mark - RPC Notifications
extern SDLNotificationName const SDLDidChangeDriverDistractionStateNotification;
extern SDLNotificationName const SDLDidChangeHMIStatusNotification;
extern SDLNotificationName const SDLDidReceiveAudioPassThruNotification;
extern SDLNotificationName const SDLDidReceiveAppUnregisteredNotification;
extern SDLNotificationName const SDLDidReceiveButtonEventNotification;
extern SDLNotificationName const SDLDidReceiveButtonPressNotification;
extern SDLNotificationName const SDLDidReceiveCommandNotification;
extern SDLNotificationName const SDLDidReceiveEncodedDataNotification;
extern SDLNotificationName const SDLDidReceiveKeyboardInputNotification;
extern SDLNotificationName const SDLDidChangeLanguageNotification;
extern SDLNotificationName const SDLDidChangeLockScreenStatusNotification;
extern SDLNotificationName const SDLDidReceiveNewHashNotification;
extern SDLNotificationName const SDLDidReceiveVehicleIconNotification;
extern SDLNotificationName const SDLDidChangePermissionsNotification;
extern SDLNotificationName const SDLDidReceiveSystemRequestNotification;
extern SDLNotificationName const SDLDidChangeTurnByTurnStateNotification;
extern SDLNotificationName const SDLDidReceiveTouchEventNotification;
extern SDLNotificationName const SDLDidReceiveVehicleDataNotification;
extern SDLNotificationName const SDLDidReceiveWaypointNotification;
@interface SDLNotificationConstants : NSObject
+ (NSArray<SDLNotificationName> *)allResponseNames;
+ (NSArray<SDLNotificationName> *)allButtonEventNotifications;
@end
NS_ASSUME_NONNULL_END
|