/core/externals/update-engine/externals/gdata-objectivec-client/Source/Clients/YouTube/GDataEntryYouTubeFeedLinkBase.m
Objective C | 107 lines | 59 code | 26 blank | 22 comment | 1 complexity | 136bf605b6f7e546a22b9e6098c18256 MD5 | raw file
1/* Copyright (c) 2008 Google Inc. 2 * 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16// 17// GDataEntryYouTubeFeedLinkBase.m 18// 19 20#if !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE 21 22#import "GDataEntryYouTubeFeedLinkBase.h" 23#import "GDataYouTubeConstants.h" 24 25// this is the superclass for GDataEntryYouTubeSubscription and 26// GDataEntryYouTubePlaylistLink 27 28@implementation GDataEntryYouTubeFeedLinkBase 29 30- (void)addExtensionDeclarations { 31 32 [super addExtensionDeclarations]; 33 34 Class entryClass = [self class]; 35 36 // YouTube element extensions 37 [self addExtensionDeclarationForParentClass:entryClass 38 childClasses: 39 [GDataYouTubePrivate class], 40 [GDataYouTubeCountHint class], 41 [GDataYouTubePlaylistID class], 42 43 // elements present in GData v1 only 44 [GDataFeedLink class], 45 46 // media extensions 47 [GDataMediaGroup class], 48 nil]; 49} 50 51#if !GDATA_SIMPLE_DESCRIPTIONS 52- (NSMutableArray *)itemsForDescription { 53 54 static struct GDataDescriptionRecord descRecs[] = { 55 { @"mediaGroup", @"mediaGroup", kGDataDescValueLabeled }, 56 { @"countHint", @"countHint", kGDataDescValueLabeled }, 57 { nil, nil, (GDataDescRecTypes)0 } 58 }; 59 60 NSMutableArray *items = [super itemsForDescription]; 61 [self addDescriptionRecords:descRecs toItems:items]; 62 return items; 63} 64#endif 65 66+ (NSString *)defaultServiceVersion { 67 return kGDataYouTubeDefaultServiceVersion; 68} 69 70#pragma mark - 71 72- (GDataMediaGroup *)mediaGroup { 73 GDataMediaGroup *obj = [self objectForExtensionClass:[GDataMediaGroup class]]; 74 return obj; 75} 76 77- (void)setMediaGroup:(GDataMediaGroup *)obj { 78 [self setObject:obj forExtensionClass:[GDataMediaGroup class]]; 79} 80 81- (NSString *)countHint { 82 GDATA_DEBUG_ASSERT_MIN_SERVICE_V2(); 83 84 GDataYouTubeCountHint *obj = [self objectForExtensionClass:[GDataYouTubeCountHint class]]; 85 return [obj stringValue]; 86} 87 88- (void)setCountHint:(NSString *)str { 89 GDATA_DEBUG_ASSERT_MIN_SERVICE_V2(); 90 91 GDataYouTubeCountHint *obj = [GDataYouTubeCountHint valueWithString:str]; 92 [self setObject:obj forExtensionClass:[GDataYouTubeCountHint class]]; 93} 94 95- (NSString *)playlistID { 96 GDataYouTubePlaylistID *obj = [self objectForExtensionClass:[GDataYouTubePlaylistID class]]; 97 return [obj stringValue]; 98} 99 100- (void)setPlaylistID:(NSString *)str { 101 GDataYouTubePlaylistID *obj = [GDataYouTubePlaylistID valueWithString:str]; 102 [self setObject:obj forExtensionClass:[GDataYouTubePlaylistID class]]; 103} 104 105@end 106 107#endif // !GDATA_REQUIRE_SERVICE_INCLUDES || GDATA_INCLUDE_YOUTUBE_SERVICE