summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLButtonName.m
diff options
context:
space:
mode:
Diffstat (limited to 'SmartDeviceLink/SDLButtonName.m')
-rw-r--r--SmartDeviceLink/SDLButtonName.m193
1 files changed, 17 insertions, 176 deletions
diff --git a/SmartDeviceLink/SDLButtonName.m b/SmartDeviceLink/SDLButtonName.m
index 8e0ae3454..23ac32eb9 100644
--- a/SmartDeviceLink/SDLButtonName.m
+++ b/SmartDeviceLink/SDLButtonName.m
@@ -4,179 +4,20 @@
#import "SDLButtonName.h"
-SDLButtonName *SDLButtonName_OK = nil;
-SDLButtonName *SDLButtonName_SEEKLEFT = nil;
-SDLButtonName *SDLButtonName_SEEKRIGHT = nil;
-SDLButtonName *SDLButtonName_TUNEUP = nil;
-SDLButtonName *SDLButtonName_TUNEDOWN = nil;
-SDLButtonName *SDLButtonName_PRESET_0 = nil;
-SDLButtonName *SDLButtonName_PRESET_1 = nil;
-SDLButtonName *SDLButtonName_PRESET_2 = nil;
-SDLButtonName *SDLButtonName_PRESET_3 = nil;
-SDLButtonName *SDLButtonName_PRESET_4 = nil;
-SDLButtonName *SDLButtonName_PRESET_5 = nil;
-SDLButtonName *SDLButtonName_PRESET_6 = nil;
-SDLButtonName *SDLButtonName_PRESET_7 = nil;
-SDLButtonName *SDLButtonName_PRESET_8 = nil;
-SDLButtonName *SDLButtonName_PRESET_9 = nil;
-SDLButtonName *SDLButtonName_CUSTOM_BUTTON = nil;
-SDLButtonName *SDLButtonName_SEARCH = nil;
-
-NSArray *SDLButtonName_values = nil;
-
-@implementation SDLButtonName
-
-+ (SDLButtonName *)valueOf:(NSString *)value {
- for (SDLButtonName *item in SDLButtonName.values) {
- if ([item.value isEqualToString:value]) {
- return item;
- }
- }
- return nil;
-}
-
-+ (NSArray *)values {
- if (SDLButtonName_values == nil) {
- SDLButtonName_values = @[
- SDLButtonName.OK,
- SDLButtonName.SEEKLEFT,
- SDLButtonName.SEEKRIGHT,
- SDLButtonName.TUNEUP,
- SDLButtonName.TUNEDOWN,
- SDLButtonName.PRESET_0,
- SDLButtonName.PRESET_1,
- SDLButtonName.PRESET_2,
- SDLButtonName.PRESET_3,
- SDLButtonName.PRESET_4,
- SDLButtonName.PRESET_5,
- SDLButtonName.PRESET_6,
- SDLButtonName.PRESET_7,
- SDLButtonName.PRESET_8,
- SDLButtonName.PRESET_9,
- SDLButtonName.CUSTOM_BUTTON,
- SDLButtonName.SEARCH,
- ];
- }
- return SDLButtonName_values;
-}
-
-+ (SDLButtonName *)OK {
- if (SDLButtonName_OK == nil) {
- SDLButtonName_OK = [[SDLButtonName alloc] initWithValue:@"OK"];
- }
- return SDLButtonName_OK;
-}
-
-+ (SDLButtonName *)SEEKLEFT {
- if (SDLButtonName_SEEKLEFT == nil) {
- SDLButtonName_SEEKLEFT = [[SDLButtonName alloc] initWithValue:@"SEEKLEFT"];
- }
- return SDLButtonName_SEEKLEFT;
-}
-
-+ (SDLButtonName *)SEEKRIGHT {
- if (SDLButtonName_SEEKRIGHT == nil) {
- SDLButtonName_SEEKRIGHT = [[SDLButtonName alloc] initWithValue:@"SEEKRIGHT"];
- }
- return SDLButtonName_SEEKRIGHT;
-}
-
-+ (SDLButtonName *)TUNEUP {
- if (SDLButtonName_TUNEUP == nil) {
- SDLButtonName_TUNEUP = [[SDLButtonName alloc] initWithValue:@"TUNEUP"];
- }
- return SDLButtonName_TUNEUP;
-}
-
-+ (SDLButtonName *)TUNEDOWN {
- if (SDLButtonName_TUNEDOWN == nil) {
- SDLButtonName_TUNEDOWN = [[SDLButtonName alloc] initWithValue:@"TUNEDOWN"];
- }
- return SDLButtonName_TUNEDOWN;
-}
-
-+ (SDLButtonName *)PRESET_0 {
- if (SDLButtonName_PRESET_0 == nil) {
- SDLButtonName_PRESET_0 = [[SDLButtonName alloc] initWithValue:@"PRESET_0"];
- }
- return SDLButtonName_PRESET_0;
-}
-
-+ (SDLButtonName *)PRESET_1 {
- if (SDLButtonName_PRESET_1 == nil) {
- SDLButtonName_PRESET_1 = [[SDLButtonName alloc] initWithValue:@"PRESET_1"];
- }
- return SDLButtonName_PRESET_1;
-}
-
-+ (SDLButtonName *)PRESET_2 {
- if (SDLButtonName_PRESET_2 == nil) {
- SDLButtonName_PRESET_2 = [[SDLButtonName alloc] initWithValue:@"PRESET_2"];
- }
- return SDLButtonName_PRESET_2;
-}
-
-+ (SDLButtonName *)PRESET_3 {
- if (SDLButtonName_PRESET_3 == nil) {
- SDLButtonName_PRESET_3 = [[SDLButtonName alloc] initWithValue:@"PRESET_3"];
- }
- return SDLButtonName_PRESET_3;
-}
-
-+ (SDLButtonName *)PRESET_4 {
- if (SDLButtonName_PRESET_4 == nil) {
- SDLButtonName_PRESET_4 = [[SDLButtonName alloc] initWithValue:@"PRESET_4"];
- }
- return SDLButtonName_PRESET_4;
-}
-
-+ (SDLButtonName *)PRESET_5 {
- if (SDLButtonName_PRESET_5 == nil) {
- SDLButtonName_PRESET_5 = [[SDLButtonName alloc] initWithValue:@"PRESET_5"];
- }
- return SDLButtonName_PRESET_5;
-}
-
-+ (SDLButtonName *)PRESET_6 {
- if (SDLButtonName_PRESET_6 == nil) {
- SDLButtonName_PRESET_6 = [[SDLButtonName alloc] initWithValue:@"PRESET_6"];
- }
- return SDLButtonName_PRESET_6;
-}
-
-+ (SDLButtonName *)PRESET_7 {
- if (SDLButtonName_PRESET_7 == nil) {
- SDLButtonName_PRESET_7 = [[SDLButtonName alloc] initWithValue:@"PRESET_7"];
- }
- return SDLButtonName_PRESET_7;
-}
-
-+ (SDLButtonName *)PRESET_8 {
- if (SDLButtonName_PRESET_8 == nil) {
- SDLButtonName_PRESET_8 = [[SDLButtonName alloc] initWithValue:@"PRESET_8"];
- }
- return SDLButtonName_PRESET_8;
-}
-
-+ (SDLButtonName *)PRESET_9 {
- if (SDLButtonName_PRESET_9 == nil) {
- SDLButtonName_PRESET_9 = [[SDLButtonName alloc] initWithValue:@"PRESET_9"];
- }
- return SDLButtonName_PRESET_9;
-}
-
-+ (SDLButtonName *)CUSTOM_BUTTON {
- if (SDLButtonName_CUSTOM_BUTTON == nil) {
- SDLButtonName_CUSTOM_BUTTON = [[SDLButtonName alloc] initWithValue:@"CUSTOM_BUTTON"];
- }
- return SDLButtonName_CUSTOM_BUTTON;
-}
-
-+ (SDLButtonName *)SEARCH {
- if (SDLButtonName_SEARCH == nil) {
- SDLButtonName_SEARCH = [[SDLButtonName alloc] initWithValue:@"SEARCH"];
- }
- return SDLButtonName_SEARCH;
-}
-
-@end
+SDLButtonName const SDLButtonNameOk = @"OK";
+SDLButtonName const SDLButtonNameSeekLeft = @"SEEKLEFT";
+SDLButtonName const SDLButtonNameSeekRight = @"SEEKRIGHT";
+SDLButtonName const SDLButtonNameTuneUp = @"TUNEUP";
+SDLButtonName const SDLButtonNameTuneDown = @"TUNEDOWN";
+SDLButtonName const SDLButtonNamePreset0 = @"PRESET_0";
+SDLButtonName const SDLButtonNamePreset1 = @"PRESET_1";
+SDLButtonName const SDLButtonNamePreset2 = @"PRESET_2";
+SDLButtonName const SDLButtonNamePreset3 = @"PRESET_3";
+SDLButtonName const SDLButtonNamePreset4 = @"PRESET_4";
+SDLButtonName const SDLButtonNamePreset5 = @"PRESET_5";
+SDLButtonName const SDLButtonNamePreset6 = @"PRESET_6";
+SDLButtonName const SDLButtonNamePreset7 = @"PRESET_7";
+SDLButtonName const SDLButtonNamePreset8 = @"PRESET_8";
+SDLButtonName const SDLButtonNamePreset9 = @"PRESET_9";
+SDLButtonName const SDLButtonNameCustomButton = @"CUSTOM_BUTTON";
+SDLButtonName const SDLButtonNameSearch = @"SEARCH";