diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2016-05-25 08:44:23 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2016-05-25 08:44:23 -0400 |
commit | fb8e9903a323acaf5fc78819bb3c203567542ab2 (patch) | |
tree | e40665103ac7db492e0a40e34cd92f3390defa55 /SmartDeviceLink/SDLSoftButton.m | |
parent | f7540a02262832e34c67b0953dd8a1804a046fea (diff) | |
download | sdl_ios-fb8e9903a323acaf5fc78819bb3c203567542ab2.tar.gz |
Shift files into root directory
Diffstat (limited to 'SmartDeviceLink/SDLSoftButton.m')
-rw-r--r-- | SmartDeviceLink/SDLSoftButton.m | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLSoftButton.m b/SmartDeviceLink/SDLSoftButton.m new file mode 100644 index 000000000..a93ce510c --- /dev/null +++ b/SmartDeviceLink/SDLSoftButton.m @@ -0,0 +1,113 @@ +// SDLSoftButton.m +// + +#import "SDLSoftButton.h" + +#import "SDLImage.h" +#import "SDLNames.h" +#import "SDLSoftButtonType.h" +#import "SDLSystemAction.h" + + +@implementation SDLSoftButton + +- (instancetype)init { + if (self = [super init]) { + } + return self; +} + +- (instancetype)initWithDictionary:(NSMutableDictionary *)dict { + if (self = [super initWithDictionary:dict]) { + } + return self; +} + +- (void)setType:(SDLSoftButtonType *)type { + if (type != nil) { + [store setObject:type forKey:NAMES_type]; + } else { + [store removeObjectForKey:NAMES_type]; + } +} + +- (SDLSoftButtonType *)type { + NSObject *obj = [store objectForKey:NAMES_type]; + if (obj == nil || [obj isKindOfClass:SDLSoftButtonType.class]) { + return (SDLSoftButtonType *)obj; + } else { + return [SDLSoftButtonType valueOf:(NSString *)obj]; + } +} + +- (void)setText:(NSString *)text { + if (text != nil) { + [store setObject:text forKey:NAMES_text]; + } else { + [store removeObjectForKey:NAMES_text]; + } +} + +- (NSString *)text { + return [store objectForKey:NAMES_text]; +} + +- (void)setImage:(SDLImage *)image { + if (image != nil) { + [store setObject:image forKey:NAMES_image]; + } else { + [store removeObjectForKey:NAMES_image]; + } +} + +- (SDLImage *)image { + NSObject *obj = [store objectForKey:NAMES_image]; + if (obj == nil || [obj isKindOfClass:SDLImage.class]) { + return (SDLImage *)obj; + } else { + return [[SDLImage alloc] initWithDictionary:(NSMutableDictionary *)obj]; + } +} + +- (void)setIsHighlighted:(NSNumber *)isHighlighted { + if (isHighlighted != nil) { + [store setObject:isHighlighted forKey:NAMES_isHighlighted]; + } else { + [store removeObjectForKey:NAMES_isHighlighted]; + } +} + +- (NSNumber *)isHighlighted { + return [store objectForKey:NAMES_isHighlighted]; +} + +- (void)setSoftButtonID:(NSNumber *)softButtonID { + if (softButtonID != nil) { + [store setObject:softButtonID forKey:NAMES_softButtonID]; + } else { + [store removeObjectForKey:NAMES_softButtonID]; + } +} + +- (NSNumber *)softButtonID { + return [store objectForKey:NAMES_softButtonID]; +} + +- (void)setSystemAction:(SDLSystemAction *)systemAction { + if (systemAction != nil) { + [store setObject:systemAction forKey:NAMES_systemAction]; + } else { + [store removeObjectForKey:NAMES_systemAction]; + } +} + +- (SDLSystemAction *)systemAction { + NSObject *obj = [store objectForKey:NAMES_systemAction]; + if (obj == nil || [obj isKindOfClass:SDLSystemAction.class]) { + return (SDLSystemAction *)obj; + } else { + return [SDLSystemAction valueOf:(NSString *)obj]; + } +} + +@end |