summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLShowConstantTBT.m
blob: f4565d92392c283665f5c0cef6d92712de382043 (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
//  SDLShowConstantTBT.m
//


#import "SDLShowConstantTBT.h"

#import "NSMutableDictionary+Store.h"
#import "SDLImage.h"
#import "SDLNames.h"
#import "SDLSoftButton.h"

NS_ASSUME_NONNULL_BEGIN

@implementation SDLShowConstantTBT

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

- (instancetype)initWithNavigationText1:(nullable NSString *)navigationText1 navigationText2:(nullable NSString *)navigationText2 eta:(nullable NSString *)eta timeToDestination:(nullable NSString *)timeToDestination totalDistance:(nullable NSString *)totalDistance turnIcon:(nullable SDLImage *)turnIcon nextTurnIcon:(nullable SDLImage *)nextTurnIcon distanceToManeuver:(double)distanceToManeuver distanceToManeuverScale:(double)distanceToManeuverScale maneuverComplete:(BOOL)maneuverComplete softButtons:(nullable NSArray<SDLSoftButton *> *)softButtons {
    self = [self init];
    if (!self) {
        return nil;
    }

    self.navigationText1 = navigationText1;
    self.navigationText2 = navigationText2;
    self.eta = eta;
    self.timeToDestination = timeToDestination;
    self.totalDistance = totalDistance;
    self.turnIcon = turnIcon;
    self.nextTurnIcon = nextTurnIcon;
    self.distanceToManeuver = @(distanceToManeuver);
    self.distanceToManeuverScale = @(distanceToManeuverScale);
    self.maneuverComplete = @(maneuverComplete);
    self.softButtons = [softButtons mutableCopy];

    return self;
}

- (void)setNavigationText1:(nullable NSString *)navigationText1 {
    [parameters sdl_setObject:navigationText1 forName:SDLNameNavigationText1];
}

- (nullable NSString *)navigationText1 {
    return [parameters sdl_objectForName:SDLNameNavigationText1];
}

- (void)setNavigationText2:(nullable NSString *)navigationText2 {
    [parameters sdl_setObject:navigationText2 forName:SDLNameNavigationText2];
}

- (nullable NSString *)navigationText2 {
    return [parameters sdl_objectForName:SDLNameNavigationText2];
}

- (void)setEta:(nullable NSString *)eta {
    [parameters sdl_setObject:eta forName:SDLNameETA];
}

- (nullable NSString *)eta {
    return [parameters sdl_objectForName:SDLNameETA];
}

- (void)setTimeToDestination:(nullable NSString *)timeToDestination {
    [parameters sdl_setObject:timeToDestination forName:SDLNameTimeToDestination];
}

- (nullable NSString *)timeToDestination {
    return [parameters sdl_objectForName:SDLNameTimeToDestination];
}

- (void)setTotalDistance:(nullable NSString *)totalDistance {
    [parameters sdl_setObject:totalDistance forName:SDLNameTotalDistance];
}

- (nullable NSString *)totalDistance {
    return [parameters sdl_objectForName:SDLNameTotalDistance];
}

- (void)setTurnIcon:(nullable SDLImage *)turnIcon {
    [parameters sdl_setObject:turnIcon forName:SDLNameTurnIcon];
}

- (nullable SDLImage *)turnIcon {
    return [parameters sdl_objectForName:SDLNameTurnIcon ofClass:SDLImage.class];
}

- (void)setNextTurnIcon:(nullable SDLImage *)nextTurnIcon {
    [parameters sdl_setObject:nextTurnIcon forName:SDLNameNextTurnIcon];
}

- (nullable SDLImage *)nextTurnIcon {
    return [parameters sdl_objectForName:SDLNameNextTurnIcon ofClass:SDLImage.class];
}

- (void)setDistanceToManeuver:(nullable NSNumber<SDLFloat> *)distanceToManeuver {
    [parameters sdl_setObject:distanceToManeuver forName:SDLNameDistanceToManeuver];
}

- (nullable NSNumber<SDLFloat> *)distanceToManeuver {
    return [parameters sdl_objectForName:SDLNameDistanceToManeuver];
}

- (void)setDistanceToManeuverScale:(nullable NSNumber<SDLFloat> *)distanceToManeuverScale {
    [parameters sdl_setObject:distanceToManeuverScale forName:SDLNameDistanceToManeuverScale];
}

- (nullable NSNumber<SDLFloat> *)distanceToManeuverScale {
    return [parameters sdl_objectForName:SDLNameDistanceToManeuverScale];
}

- (void)setManeuverComplete:(nullable NSNumber<SDLBool> *)maneuverComplete {
    [parameters sdl_setObject:maneuverComplete forName:SDLNameManeuverComplete];
}

- (nullable NSNumber<SDLBool> *)maneuverComplete {
    return [parameters sdl_objectForName:SDLNameManeuverComplete];
}

- (void)setSoftButtons:(nullable NSArray<SDLSoftButton *> *)softButtons {
    [parameters sdl_setObject:softButtons forName:SDLNameSoftButtons];
}

- (nullable NSArray<SDLSoftButton *> *)softButtons {
    return [parameters sdl_objectsForName:SDLNameSoftButtons ofClass:SDLSoftButton.class];
}

@end

NS_ASSUME_NONNULL_END