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

#import "SDLKeyboardProperties.h"

#import "SDLKeyboardLayout.h"
#import "SDLKeypressMode.h"
#import "SDLLanguage.h"



@implementation SDLKeyboardProperties

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

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

- (void)setLanguage:(SDLLanguage *)language {
    if (language != nil) {
        [store setObject:language forKey:SDLNameLanguage];
    } else {
        [store removeObjectForKey:SDLNameLanguage];
    }
}

- (SDLLanguage *)language {
    NSObject *obj = [store objectForKey:SDLNameLanguage];
    if (obj == nil || [obj isKindOfClass:SDLLanguage.class]) {
        return (SDLLanguage *)obj;
    } else {
        return [SDLLanguage valueOf:(NSString *)obj];
    }
}

- (void)setKeyboardLayout:(SDLKeyboardLayout *)keyboardLayout {
    if (keyboardLayout != nil) {
        [store setObject:keyboardLayout forKey:SDLNameKeyboardLayout];
    } else {
        [store removeObjectForKey:SDLNameKeyboardLayout];
    }
}

- (SDLKeyboardLayout *)keyboardLayout {
    NSObject *obj = [store objectForKey:SDLNameKeyboardLayout];
    if (obj == nil || [obj isKindOfClass:SDLKeyboardLayout.class]) {
        return (SDLKeyboardLayout *)obj;
    } else {
        return [SDLKeyboardLayout valueOf:(NSString *)obj];
    }
}

- (void)setKeypressMode:(SDLKeypressMode *)keypressMode {
    if (keypressMode != nil) {
        [store setObject:keypressMode forKey:SDLNameKeypressMode];
    } else {
        [store removeObjectForKey:SDLNameKeypressMode];
    }
}

- (SDLKeypressMode *)keypressMode {
    NSObject *obj = [store objectForKey:SDLNameKeypressMode];
    if (obj == nil || [obj isKindOfClass:SDLKeypressMode.class]) {
        return (SDLKeypressMode *)obj;
    } else {
        return [SDLKeypressMode valueOf:(NSString *)obj];
    }
}

- (void)setLimitedCharacterList:(NSMutableArray *)limitedCharacterList {
    if (limitedCharacterList != nil) {
        [store setObject:limitedCharacterList forKey:SDLNameLimitedCharacterList];
    } else {
        [store removeObjectForKey:SDLNameLimitedCharacterList];
    }
}

- (NSMutableArray *)limitedCharacterList {
    return [store objectForKey:SDLNameLimitedCharacterList];
}

- (void)setAutoCompleteText:(NSString *)autoCompleteText {
    if (autoCompleteText != nil) {
        [store setObject:autoCompleteText forKey:SDLNameAutoCompleteText];
    } else {
        [store removeObjectForKey:SDLNameAutoCompleteText];
    }
}

- (NSString *)autoCompleteText {
    return [store objectForKey:SDLNameAutoCompleteText];
}

@end