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/SDLHMILevel.m | |
parent | f7540a02262832e34c67b0953dd8a1804a046fea (diff) | |
download | sdl_ios-fb8e9903a323acaf5fc78819bb3c203567542ab2.tar.gz |
Shift files into root directory
Diffstat (limited to 'SmartDeviceLink/SDLHMILevel.m')
-rw-r--r-- | SmartDeviceLink/SDLHMILevel.m | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLHMILevel.m b/SmartDeviceLink/SDLHMILevel.m new file mode 100644 index 000000000..88b0be5b6 --- /dev/null +++ b/SmartDeviceLink/SDLHMILevel.m @@ -0,0 +1,65 @@ +// SDLHMILevel.m +// + + +#import "SDLHMILevel.h" + +SDLHMILevel *SDLHMILevel_FULL = nil; +SDLHMILevel *SDLHMILevel_LIMITED = nil; +SDLHMILevel *SDLHMILevel_BACKGROUND = nil; +SDLHMILevel *SDLHMILevel_NONE = nil; + +NSArray *SDLHMILevel_values = nil; + +@implementation SDLHMILevel + ++ (SDLHMILevel *)valueOf:(NSString *)value { + for (SDLHMILevel *item in SDLHMILevel.values) { + if ([item.value isEqualToString:value]) { + return item; + } + } + return nil; +} + ++ (NSArray *)values { + if (SDLHMILevel_values == nil) { + SDLHMILevel_values = @[ + [SDLHMILevel FULL], + [SDLHMILevel LIMITED], + [SDLHMILevel BACKGROUND], + [SDLHMILevel NONE] + ]; + } + return SDLHMILevel_values; +} + ++ (SDLHMILevel *)FULL { + if (SDLHMILevel_FULL == nil) { + SDLHMILevel_FULL = [[SDLHMILevel alloc] initWithValue:@"FULL"]; + } + return SDLHMILevel_FULL; +} + ++ (SDLHMILevel *)LIMITED { + if (SDLHMILevel_LIMITED == nil) { + SDLHMILevel_LIMITED = [[SDLHMILevel alloc] initWithValue:@"LIMITED"]; + } + return SDLHMILevel_LIMITED; +} + ++ (SDLHMILevel *)BACKGROUND { + if (SDLHMILevel_BACKGROUND == nil) { + SDLHMILevel_BACKGROUND = [[SDLHMILevel alloc] initWithValue:@"BACKGROUND"]; + } + return SDLHMILevel_BACKGROUND; +} + ++ (SDLHMILevel *)NONE { + if (SDLHMILevel_NONE == nil) { + SDLHMILevel_NONE = [[SDLHMILevel alloc] initWithValue:@"NONE"]; + } + return SDLHMILevel_NONE; +} + +@end |