summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLCancelInteraction.h
blob: d8f9078d273773b2cbbe0d51c7ab538078ff5ca4 (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
//
//  SDLCancelInteraction.h
//  SmartDeviceLink
//
//  Created by Nicole on 7/12/19.
//  Copyright © 2019 smartdevicelink. All rights reserved.
//

#import "SDLRPCRequest.h"

NS_ASSUME_NONNULL_BEGIN

/*
 Used to dismiss a modal view programmatically without needing to wait for the timeout to complete. Can be used to dismiss alerts, scrollable messages, sliders, and perform interactions (i.e. pop-up menus).

 @see SDLAlert, SDLScrollableMessage, SDLSlider, SDLPerformInteraction
 */
@interface SDLCancelInteraction : SDLRPCRequest

/**
 Convenience init for dismissing the currently presented modal view (either an alert, slider, scrollable message, or perform interation).

 @param functionID The ID of the type of modal view to dismiss
 @return A SDLCancelInteraction object
 */
- (instancetype)initWithFunctionID:(UInt32)functionID;

/**
 Convenience init for dismissing a specific view.

 @param functionID The ID of the type of interaction to dismiss
 @param cancelID The ID of the specific interaction to dismiss
 @return A SDLCancelInteraction object
 */
- (instancetype)initWithFunctionID:(UInt32)functionID cancelID:(UInt32)cancelID;

/**
 Convenience init for dismissing an alert.

 @param cancelID The ID of the specific interaction to dismiss
 @return A SDLCancelInteraction object
 */
- (instancetype)initWithAlertCancelID:(UInt32)cancelID;

/**
 Convenience init for dismissing a slider.

 @param cancelID The ID of the specific interaction to dismiss
 @return A SDLCancelInteraction object
 */
- (instancetype)initWithSliderCancelID:(UInt32)cancelID;

/**
 Convenience init for dismissing a scrollable message.

 @param cancelID The ID of the specific interaction to dismiss
 @return A SDLCancelInteraction object
 */
- (instancetype)initWithScrollableMessageCancelID:(UInt32)cancelID;

/**
 Convenience init for dismissing a perform interaction.

 @param cancelID The ID of the specific interaction to dismiss
 @return A SDLCancelInteraction object
 */
- (instancetype)initWithPerformInteractionCancelID:(UInt32)cancelID;

/**
 Convenience init for dismissing the currently presented alert.

 @return A SDLCancelInteraction object
 */
+ (instancetype)alert;

/**
 Convenience init for dismissing the currently presented slider.

 @return A SDLCancelInteraction object
 */
+ (instancetype)slider;

/**
 Convenience init for dismissing the currently presented scrollable message.

 @return A SDLCancelInteraction object
 */
+ (instancetype)scrollableMessage;

/**
 Convenience init for dismissing the currently presented perform interaction.

 @return A SDLCancelInteraction object
 */
+ (instancetype)performInteraction NS_SWIFT_NAME(performInteraction());

/**
 The ID of the specific interaction to dismiss. If not set, the most recent of the RPC type set in functionID will be dismissed.

 Integer, Optional
 */
@property (nullable, strong, nonatomic) NSNumber<SDLInt> *cancelID;

/**
 The ID of the type of interaction to dismiss.

 Only values 10 (PerformInteractionID), 12 (AlertID), 25 (ScrollableMessageID), and 26 (SliderID) are permitted.

 Integer, Required
 */
@property (strong, nonatomic) NSNumber<SDLInt> *functionID;

@end

NS_ASSUME_NONNULL_END