-
Notifications
You must be signed in to change notification settings - Fork 110
/
SDLAlertManeuver.m
62 lines (45 loc) 路 1.75 KB
/
SDLAlertManeuver.m
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
// SDLAlertManeuver.m
//
#import "SDLAlertManeuver.h"
#import "NSMutableDictionary+Store.h"
#import "SDLRPCParameterNames.h"
#import "SDLRPCFunctionNames.h"
#import "SDLSoftButton.h"
#import "SDLTTSChunk.h"
NS_ASSUME_NONNULL_BEGIN
@implementation SDLAlertManeuver
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (instancetype)init {
if (self = [super initWithName:SDLRPCFunctionNameAlertManeuver]) {
}
return self;
}
#pragma clang diagnostic pop
- (instancetype)initWithTTS:(nullable NSString *)ttsText softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons {
NSArray *ttsChunks = [SDLTTSChunk textChunksFromString:ttsText];
return [self initWithTTSChunks:ttsChunks softButtons:softButtons];
}
- (instancetype)initWithTTSChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons {
self = [self init];
if (!self) {
return nil;
}
self.ttsChunks = [ttsChunks mutableCopy];
self.softButtons = [softButtons mutableCopy];
return self;
}
- (void)setTtsChunks:(nullable NSArray<SDLTTSChunk *> *)ttsChunks {
[self.parameters sdl_setObject:ttsChunks forName:SDLRPCParameterNameTTSChunks];
}
- (nullable NSArray<SDLTTSChunk *> *)ttsChunks {
return [self.parameters sdl_objectsForName:SDLRPCParameterNameTTSChunks ofClass:SDLTTSChunk.class error:nil];
}
- (void)setSoftButtons:(nullable NSArray<SDLSoftButton *> *)softButtons {
[self.parameters sdl_setObject:softButtons forName:SDLRPCParameterNameSoftButtons];
}
- (nullable NSArray<SDLSoftButton *> *)softButtons {
return [self.parameters sdl_objectsForName:SDLRPCParameterNameSoftButtons ofClass:SDLSoftButton.class error:nil];
}
@end
NS_ASSUME_NONNULL_END