summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLOnKeyboardInput.m
blob: a70a7d06c5234ebbd4b260cdacfaa1a23b655b72 (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
//  SDLOnKeyboardInput.m
//

#import "SDLOnKeyboardInput.h"

#import "SDLKeyboardEvent.h"
#import "SDLNames.h"


@implementation SDLOnKeyboardInput

- (instancetype)init {
    if (self = [super initWithName:NAMES_OnKeyboardInput]) {
    }
    return self;
}

- (instancetype)initWithDictionary:(NSMutableDictionary *)dict {
    if (self = [super initWithDictionary:dict]) {
    }
    return self;
}

- (void)setEvent:(SDLKeyboardEvent *)event {
    if (event != nil) {
        [parameters setObject:event forKey:NAMES_event];
    } else {
        [parameters removeObjectForKey:NAMES_event];
    }
}

- (SDLKeyboardEvent *)event {
    NSObject *obj = [parameters objectForKey:NAMES_event];
    if (obj == nil || [obj isKindOfClass:SDLKeyboardEvent.class]) {
        return (SDLKeyboardEvent *)obj;
    } else {
        return [SDLKeyboardEvent valueOf:(NSString *)obj];
    }
}

- (void)setData:(NSString *)data {
    if (data != nil) {
        [parameters setObject:data forKey:NAMES_data];
    } else {
        [parameters removeObjectForKey:NAMES_data];
    }
}

- (NSString *)data {
    return [parameters objectForKey:NAMES_data];
}

@end