-
Notifications
You must be signed in to change notification settings - Fork 0
/
IntentsUI.framework.h
318 lines (235 loc) · 13 KB
/
IntentsUI.framework.h
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
// ========== IntentsUI.framework/Headers/INUIAddVoiceShortcutViewController.h
//
// INUIAddVoiceShortcutViewController.h
// IntentsUI
//
// Copyright © 2018 Apple Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
@class INShortcut;
@class INVoiceShortcut;
@protocol INUIAddVoiceShortcutViewControllerDelegate;
NS_ASSUME_NONNULL_BEGIN
/*!
@abstract A view controller that will take the user through the setup flow to add a shortcut to Siri.
@discussion First create the @c INShortcut object that represents the shortcut the user wants to perform. Then create an @c INUIAddVoiceShortcutViewController object and set its delegate. Then, present the view controller modally from another view controller in your app. The delegate must dismiss the view controller when the user completes the set up.
*/
API_AVAILABLE(ios(12.0))
API_UNAVAILABLE(watchos, macosx, tvos)
@interface INUIAddVoiceShortcutViewController : UIViewController
@property (nonatomic, nullable, weak) id<INUIAddVoiceShortcutViewControllerDelegate> delegate;
/*!
@param shortcut The shortcut is what will be run when the resulting voice shortcut is invoked. It also provides the suggested invocation phrase, via the @c suggestedInvocationPhrase property on the intent or user activity.
*/
- (instancetype)initWithShortcut:(INShortcut *)shortcut API_UNAVAILABLE(uikitformac);
@end
API_AVAILABLE(ios(12.0))
API_UNAVAILABLE(watchos, macosx, tvos)
@protocol INUIAddVoiceShortcutViewControllerDelegate <NSObject>
/*!
@abstract Called after the user finishes the setup flow for the voice shortcut, with either the successfully-added voice shortcut, or an error.
@discussion Your implementation of this method should dismiss the view controller.
*/
- (void)addVoiceShortcutViewController:(INUIAddVoiceShortcutViewController *)controller didFinishWithVoiceShortcut:(nullable INVoiceShortcut *)voiceShortcut error:(nullable NSError *)error;
/*!
@abstract Called if the user cancels the setup flow; the voice shortcut was not added.
@discussion Your implementation of this method should dismiss the view controller.
*/
- (void)addVoiceShortcutViewControllerDidCancel:(INUIAddVoiceShortcutViewController *)controller;
@end
NS_ASSUME_NONNULL_END
// ========== IntentsUI.framework/Headers/IntentsUI.h
//
// IntentsUI.h
// IntentsUI
//
// Copyright (c) 2016 Apple Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for IntentsUI.
FOUNDATION_EXPORT double IntentsUIVersionNumber;
//! Project version string for IntentsUI.
FOUNDATION_EXPORT const unsigned char IntentsUIVersionString[];
#import <IntentsUI/INImage+IntentsUI.h>
#import <IntentsUI/INUIAddVoiceShortcutButton.h>
#import <IntentsUI/INUIAddVoiceShortcutViewController.h>
#import <IntentsUI/INUIEditVoiceShortcutViewController.h>
#import <IntentsUI/INUIHostedViewControlling.h>
#import <IntentsUI/INUIHostedViewSiriProviding.h>
// ========== IntentsUI.framework/Headers/INUIHostedViewSiriProviding.h
//
// INUIHostedViewSiriProviding.h
// Intents
//
// Copyright (c) 2016 Apple Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
API_AVAILABLE(ios(10.0))
API_UNAVAILABLE(macosx, watchos, tvos)
@protocol INUIHostedViewSiriProviding <NSObject>
@optional
@property (nonatomic, assign, readonly) BOOL displaysMap;
@property (nonatomic, assign, readonly) BOOL displaysMessage;
@property (nonatomic, assign, readonly) BOOL displaysPaymentTransaction;
@end
NS_ASSUME_NONNULL_END
// ========== IntentsUI.framework/Headers/INUIHostedViewControlling.h
//
// INUIHostedViewControlling.h
// Intents
//
// Copyright (c) 2016 Apple Inc. All rights reserved.
//
#import <CoreGraphics/CoreGraphics.h>
#import <Foundation/Foundation.h>
@class INInteraction;
@class INParameter;
typedef NS_ENUM(NSUInteger, INUIHostedViewContext) {
INUIHostedViewContextSiriSnippet,
INUIHostedViewContextMapsCard,
} API_AVAILABLE(ios(10.0)) API_UNAVAILABLE(macosx, watchos, tvos);
typedef NS_ENUM(NSUInteger, INUIInteractiveBehavior) {
INUIInteractiveBehaviorNone,
INUIInteractiveBehaviorNextView, // Show UI representing navigation to a new view, such as a navigation chevron
INUIInteractiveBehaviorLaunch, // Show UI representing a launch to leave the context, such as a button
INUIInteractiveBehaviorGenericAction, // Show UI representing a generic follow-on action within the context, such as a large tap target
} API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(macosx, watchos, tvos);
NS_ASSUME_NONNULL_BEGIN
API_AVAILABLE(ios(10.0))
API_UNAVAILABLE(macosx, watchos, tvos)
@protocol INUIHostedViewControlling <NSObject>
@optional
/*!
@abstract Perform configuration of UI based on the provided INInteraction object.
@discussion When configuration is complete for the given interaction, the hosted view controller should call the completion block with its view's desired size. This size will be constrained between hostedViewMinimumAllowedSize and hostedViewMaximumAllowedSize of the extension context.
@param interaction The input interaction
@param context The hosting context for this interaction. The hosted view will be displayed alongside this context -- for instance, a Siri result snippet, or a place card within Maps.
@param completion The response handling block takes one parameter corresponding the optional desiredSize property of the INUIHostedViewControlling protocol
@see INInteraction
*/
- (void)configureWithInteraction:(INInteraction *)interaction context:(INUIHostedViewContext)context completion:(void (^)(CGSize desiredSize))completion;
/*!
@abstract Perform configuration of UI based on the provided INInteraction and INParameter objects.
@discussion When configuration is complete for the given parameters and interaction, the hosted view controller should call the completion block with whether it was successful, the parameters it configured itself with, and its view's desired size. The size of the view will ultimately be constrained between hostedViewMinimumAllowedSize and hostedViewMaximumAllowedSize of the extension context.
@param parameters The parameters of the interaction for which to configure the view
@param interaction The input interaction
@param interactiveBehavior The behavior that will be driven by user interaction of this view
@param context The hosting context for this interaction. The hosted view will be displayed within/alongside this context -- for instance, a Siri result snippet, or a place card within Maps.
@param completion The response handling block takes the following: A) a success boolean, which tells the hosted view context if this view was successfully configured, B) the set of parameters that this view was successfully configured for, and C) a desiredSize for this view to be sized at within the hosted view context.
@see INParameter
@see INInteraction
*/
- (void)configureViewForParameters:(NSSet <INParameter *> *)parameters ofInteraction:(INInteraction *)interaction interactiveBehavior:(INUIInteractiveBehavior)interactiveBehavior context:(INUIHostedViewContext)context completion:(void (^)(BOOL success, NSSet <INParameter *> *configuredParameters, CGSize desiredSize))completion API_AVAILABLE(ios(11.0));
@end
@interface NSExtensionContext (INUIHostedViewControlling)
@property (nonatomic, assign, readonly) CGSize hostedViewMinimumAllowedSize API_AVAILABLE(ios(10.0)) API_UNAVAILABLE(macosx, watchos, tvos);
@property (nonatomic, assign, readonly) CGSize hostedViewMaximumAllowedSize API_AVAILABLE(ios(10.0)) API_UNAVAILABLE(macosx, watchos, tvos);
- (NSString *)interfaceParametersDescription API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(macosx, watchos, tvos);
@end
NS_ASSUME_NONNULL_END
// ========== IntentsUI.framework/Headers/INUIEditVoiceShortcutViewController.h
//
// INUIEditVoiceShortcutViewController.h
// IntentsUI
//
// Copyright © 2018 Apple Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
@class INVoiceShortcut;
@protocol INUIEditVoiceShortcutViewControllerDelegate;
NS_ASSUME_NONNULL_BEGIN
/*!
@abstract A view controller that shows the details of a voice shortcut, and lets the user edit the phrase.
@discussion To have the user edit a voice shortcut, create an @c INUIEditVoiceShortcutViewController object with the @c INVoiceShortcut that they wish to edit, and set its delegate. Then, present the view controller modally from another view controller in your app. Your delegate must dismiss the view controller when the user finishes editing.
*/
API_AVAILABLE(ios(12.0))
API_UNAVAILABLE(watchos, macosx, tvos)
@interface INUIEditVoiceShortcutViewController : UIViewController
@property (nonatomic, nullable, weak) id<INUIEditVoiceShortcutViewControllerDelegate> delegate;
/*!
@param voiceShortcut The voice shortcut to be edited.
*/
- (instancetype)initWithVoiceShortcut:(INVoiceShortcut *)voiceShortcut API_UNAVAILABLE(uikitformac);
@end
API_AVAILABLE(ios(12.0))
API_UNAVAILABLE(watchos, macosx, tvos)
@protocol INUIEditVoiceShortcutViewControllerDelegate <NSObject>
/*!
@abstract Called if the user updates the voice shortcut, with either the successfully-updated voice shortcut, or an error.
@discussion Your implementation of this method should dismiss the view controller.
*/
- (void)editVoiceShortcutViewController:(INUIEditVoiceShortcutViewController *)controller didUpdateVoiceShortcut:(nullable INVoiceShortcut *)voiceShortcut error:(nullable NSError *)error;
/*!
@abstract Called if the user deletes the voice shortcut.
@discussion Your implementation of this method should dismiss the view controller.
*/
- (void)editVoiceShortcutViewController:(INUIEditVoiceShortcutViewController *)controller didDeleteVoiceShortcutWithIdentifier:(NSUUID *)deletedVoiceShortcutIdentifier;
/*!
@abstract Called if the user cancelled; no changes were made to the voice shortcut.
@discussion Your implementation of this method should dismiss the view controller.
*/
- (void)editVoiceShortcutViewControllerDidCancel:(INUIEditVoiceShortcutViewController *)controller;
@end
NS_ASSUME_NONNULL_END
// ========== IntentsUI.framework/Headers/INImage+IntentsUI.h
//
// INImage+IntentsUI.h
// Intents
//
// Copyright (c) 2016 Apple Inc. All rights reserved.
//
#import <Intents/INImage.h>
#import <CoreGraphics/CoreGraphics.h>
#import <UIKit/UIKit.h>
@class INIntentResponse;
NS_ASSUME_NONNULL_BEGIN
@interface INImage (IntentsUI)
+ (instancetype)imageWithCGImage:(CGImageRef)imageRef API_AVAILABLE(ios(10.0), watchos(5.0)) API_UNAVAILABLE(macosx, tvos);
+ (instancetype)imageWithUIImage:(UIImage *)image API_AVAILABLE(ios(10.0), watchos(5.0)) API_UNAVAILABLE(macosx, tvos);
/*!
@abstract Returns the image size at which the image for an INIntentResponse will be displayed
*/
+ (CGSize)imageSizeForIntentResponse:(INIntentResponse *)response API_AVAILABLE(ios(10.0), watchos(5.0)) API_UNAVAILABLE(macosx, tvos);
- (void)fetchUIImageWithCompletion:(void (^)(UIImage * _Nullable image))completion API_AVAILABLE(ios(11.0), watchos(5.0)) API_UNAVAILABLE(macosx, tvos);
@end
NS_ASSUME_NONNULL_END
// ========== IntentsUI.framework/Headers/INUIAddVoiceShortcutButton.h
//
// INUIAddVoiceShortcutButton
// IntentsUI
//
// Copyright © 2018 Apple Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, INUIAddVoiceShortcutButtonStyle) {
INUIAddVoiceShortcutButtonStyleWhite = 0,
INUIAddVoiceShortcutButtonStyleWhiteOutline,
INUIAddVoiceShortcutButtonStyleBlack,
INUIAddVoiceShortcutButtonStyleBlackOutline,
INUIAddVoiceShortcutButtonStyleAutomatic API_AVAILABLE(ios(13.0)),
INUIAddVoiceShortcutButtonStyleAutomaticOutline API_AVAILABLE(ios(13.0)),
} API_AVAILABLE(ios(12.0)) API_UNAVAILABLE(watchos, macosx, tvos);
@class INShortcut, INUIAddVoiceShortcutButton, INUIAddVoiceShortcutViewController, INUIEditVoiceShortcutViewController;
API_AVAILABLE(ios(12.0))
API_UNAVAILABLE(watchos, macosx, tvos)
@protocol INUIAddVoiceShortcutButtonDelegate <NSObject>
- (void)presentAddVoiceShortcutViewController:(INUIAddVoiceShortcutViewController *)addVoiceShortcutViewController forAddVoiceShortcutButton:(INUIAddVoiceShortcutButton *)addVoiceShortcutButton;
- (void)presentEditVoiceShortcutViewController:(INUIEditVoiceShortcutViewController *)editVoiceShortcutViewController forAddVoiceShortcutButton:(INUIAddVoiceShortcutButton *)addVoiceShortcutButton;
@end
API_AVAILABLE(ios(12.0))
API_UNAVAILABLE(watchos, macosx, tvos)
IB_DESIGNABLE @interface INUIAddVoiceShortcutButton : UIButton
- (instancetype)initWithStyle:(INUIAddVoiceShortcutButtonStyle)style API_UNAVAILABLE(uikitformac);
@property (nonatomic, readonly) INUIAddVoiceShortcutButtonStyle style;
- (void)setStyle:(INUIAddVoiceShortcutButtonStyle)style API_AVAILABLE(ios(13.0));
@property (nonatomic, weak) id<INUIAddVoiceShortcutButtonDelegate> delegate;
@property (nonatomic, strong, nullable) INShortcut *shortcut;
/*!
@abstract A custom corner radius for the @c INUIAddVoiceShortcutButton.
@discussion If the provided corner radius is greater than half of the button’s height, it will be capped at half of the button’s height.
*/
@property (nonatomic, assign) IBInspectable CGFloat cornerRadius API_AVAILABLE(ios(13.0));
@end
NS_ASSUME_NONNULL_END